Test_Unary_Minus Icon
Test_Unary_Minus
Usage
PrimitiveComponents.Test_Unary_Minus()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( sine_{+}y(t), unary_{minus_{+}u(t)} \right) \\ \mathtt{unary\_minus.y}\left( t \right) = - \mathtt{unary\_minus.u}\left( t \right) \\ \mathtt{sine.y}\left( t \right) = \mathtt{sine.offset} + \mathtt{sine.amplitude} ifelse\left( t \geq \mathtt{sine.start\_time}, \sin\left( \mathtt{sine.phase} + 6.2832 \mathtt{sine.frequency} \left( - \mathtt{sine.start\_time} + t \right) \right), \sin\left( \mathtt{sine.phase} \right) \right) \\ \end{array} \right] \end{equation} \]
Source
component Test_Unary_Minus
unary_minus = PrimitiveComponents.Mathematical.UnaryMinus() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 340, "y1": 140, "x2": 440, "y2": 240, "rot": 0}
}
}
}
sine = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 10, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 140, "x2": 180, "y2": 240, "rot": 0}
}
}
}
relations
connect(sine.y, unary_minus.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
"Dyad": {
"experiments": {},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["sine.y", "unary_minus.y"]}
}
},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 1100,
"rot": 0,
"layer": "icon",
"attrs": {}
}
],
"path": {},
"doc": {"behavior": true}
}
}
end
Flattened Source
component Test_Unary_Minus
unary_minus = PrimitiveComponents.Mathematical.UnaryMinus() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 340, "y1": 140, "x2": 440, "y2": 240, "rot": 0}
}
}
}
sine = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 10, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 140, "x2": 180, "y2": 240, "rot": 0}
}
}
}
relations
connect(sine.y, unary_minus.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
"Dyad": {
"experiments": {},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["sine.y", "unary_minus.y"]}
}
},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 1100,
"rot": 0,
"layer": "icon",
"attrs": {}
}
],
"path": {},
"doc": {"behavior": true}
}
}
endTest Cases
Test Case case1
pltpltRelated
- Examples
- Experiments
- Analyses