Test_Pow Icon
Test_Pow
Usage
PrimitiveComponents.Test_Pow()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( sine_{1_{+}y(t)}, pow_{+}u1(t) \right) \\ \mathrm{connect}\left( sine_{2_{+}y(t)}, pow_{+}u2(t) \right) \\ \mathtt{pow.y}\left( t \right) = \left( \left|\mathtt{pow.u1}\left( t \right)\right| \right)^{\mathtt{pow.u2}\left( t \right)} sign\left( \mathtt{pow.u1}\left( t \right) \right) \\ \mathtt{sine\_1.y}\left( t \right) = \mathtt{sine\_1.offset} + \mathtt{sine\_1.amplitude} ifelse\left( t \geq \mathtt{sine\_1.start\_time}, \sin\left( \mathtt{sine\_1.phase} + 6.2832 \mathtt{sine\_1.frequency} \left( - \mathtt{sine\_1.start\_time} + t \right) \right), \sin\left( \mathtt{sine\_1.phase} \right) \right) \\ \mathtt{sine\_2.y}\left( t \right) = \mathtt{sine\_2.offset} + \mathtt{sine\_2.amplitude} ifelse\left( t \geq \mathtt{sine\_2.start\_time}, \sin\left( \mathtt{sine\_2.phase} + 6.2832 \mathtt{sine\_2.frequency} \left( - \mathtt{sine\_2.start\_time} + t \right) \right), \sin\left( \mathtt{sine\_2.phase} \right) \right) \\ \end{array} \right] \end{equation} \]
Source
component Test_Pow
pow = PrimitiveComponents.Mathematical.Pow() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 230, "y1": 200, "x2": 330, "y2": 300, "rot": 0}
}
}
}
sine_1 = BlockComponents.Sine(start_time = 3, offset = 0, amplitude = 1, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 50, "x2": 120, "y2": 150, "rot": 0}
}
}
}
sine_2 = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 1, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 300, "x2": 120, "y2": 400, "rot": 0}
}
}
}
relations
connect(sine_1.y, pow.u1) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 175, "y": 100}, {"x": 175, "y": 220}], "E": 2}]
}
}
connect(pow.u2, sine_2.y) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 175, "y": 280}, {"x": 175, "y": 350}], "E": 2}]
}
}
metadata {
"Dyad": {
"experiments": {},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["pow.y", "pow.u1", "pow.u2"]}
}
},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 1100,
"rot": 0,
"layer": "icon",
"attrs": {}
}
],
"path": {},
"doc": {"behavior": true}
}
}
end
Flattened Source
component Test_Pow
pow = PrimitiveComponents.Mathematical.Pow() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 230, "y1": 200, "x2": 330, "y2": 300, "rot": 0}
}
}
}
sine_1 = BlockComponents.Sine(start_time = 3, offset = 0, amplitude = 1, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 50, "x2": 120, "y2": 150, "rot": 0}
}
}
}
sine_2 = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 1, frequency = 1 / 5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 300, "x2": 120, "y2": 400, "rot": 0}
}
}
}
relations
connect(sine_1.y, pow.u1) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 175, "y": 100}, {"x": 175, "y": 220}], "E": 2}]
}
}
connect(pow.u2, sine_2.y) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 175, "y": 280}, {"x": 175, "y": 350}], "E": 2}]
}
}
metadata {
"Dyad": {
"experiments": {},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["pow.y", "pow.u1", "pow.u2"]}
}
},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 1100,
"rot": 0,
"layer": "icon",
"attrs": {}
}
],
"path": {},
"doc": {"behavior": true}
}
}
endTest Cases
Test Case case1
pltpltpltRelated
- Examples
- Experiments
- Analyses