SecondOrderSystemTest
IconSecondOrderSystemTest
Usage
SecondOrderSystemTest()
Connectors
collector
- This connector represents a real signal as an input to a component (RealInput
)
Behavior
\[ \begin{align} \mathtt{collector}\left( t \right) &= \mathtt{sys.sum.y}\left( t \right) \\ \mathtt{src.y}\left( t \right) &= \mathtt{sys.xdd}\left( t \right) \\ \mathtt{src.y}\left( t \right) &= ifelse\left( \mathtt{src.start\_time} < t, \mathtt{src.offset} + \mathtt{src.amplitude} \sin\left( \mathtt{src.phase} + 6.2832 \mathtt{src.frequency} \left( - \mathtt{src.start\_time} + t \right) \right), \mathtt{src.offset} \right) \\ \mathtt{sys.xdd\_internal\_var}\left( t \right) &= \mathtt{sys.xdd}\left( t \right) \\ \mathtt{sys.xdd}\left( t \right) &= \mathtt{sys.integrator1.u}\left( t \right) \\ \mathtt{sys.integrator1.u}\left( t \right) &= \mathtt{sys.gain1.u}\left( t \right) \\ \mathtt{sys.integrator1.y}\left( t \right) &= \mathtt{sys.integrator2.u}\left( t \right) \\ \mathtt{sys.integrator2.u}\left( t \right) &= \mathtt{sys.gain2.u}\left( t \right) \\ \mathtt{sys.integrator2.y}\left( t \right) &= \mathtt{sys.gain3.u}\left( t \right) \\ \mathtt{sys.gain1.y}\left( t \right) &= \mathtt{sys.sum.u3}\left( t \right) \\ \mathtt{sys.gain2.y}\left( t \right) &= \mathtt{sys.sum.u2}\left( t \right) \\ \mathtt{sys.gain3.y}\left( t \right) &= \mathtt{sys.sum.u1}\left( t \right) \\ \frac{\mathrm{d} \mathtt{sys.integrator1.x}\left( t \right)}{\mathrm{d}t} &= \mathtt{sys.integrator1.k} \mathtt{sys.integrator1.u}\left( t \right) \\ \mathtt{sys.integrator1.y}\left( t \right) &= \mathtt{sys.integrator1.x}\left( t \right) \\ \frac{\mathrm{d} \mathtt{sys.integrator2.x}\left( t \right)}{\mathrm{d}t} &= \mathtt{sys.integrator2.k} \mathtt{sys.integrator2.u}\left( t \right) \\ \mathtt{sys.integrator2.y}\left( t \right) &= \mathtt{sys.integrator2.x}\left( t \right) \\ \mathtt{sys.gain1.y}\left( t \right) &= \mathtt{sys.gain1.k} \mathtt{sys.gain1.u}\left( t \right) \\ \mathtt{sys.gain2.y}\left( t \right) &= \mathtt{sys.gain2.k} \mathtt{sys.gain2.u}\left( t \right) \\ \mathtt{sys.gain3.y}\left( t \right) &= \mathtt{sys.gain3.k} \mathtt{sys.gain3.u}\left( t \right) \\ \mathtt{sys.sum.y}\left( t \right) &= \mathtt{sys.sum.k1} \mathtt{sys.sum.u1}\left( t \right) + \mathtt{sys.sum.k2} \mathtt{sys.sum.u2}\left( t \right) + \mathtt{sys.sum.k3} \mathtt{sys.sum.u3}\left( t \right) \end{align} \]
Source
component SecondOrderSystemTest
src = BlockComponents.Sine(amplitude=1, frequency=5) [{"Dyad": {"placement": {"icon": {"x1": 100, "y1": 100, "x2": 300, "y2": 300}}}}]
sys = SecondOrderSystem(k1=2, k2=3, k3=4) [{"Dyad": {"placement": {"icon": {"x1": 400, "y1": 100, "x2": 600, "y2": 300}}}}]
collector = RealInput() [{"Dyad": {"placement": {"icon": {"x1": 700, "y1": 100, "x2": 900, "y2": 300}}}}]
relations
connect(src.y, sys.xdd) [{"Dyad": {"edges": [{"S": 1, "E": 2}]}}]
collector = sys.sum.y
metadata {
"Dyad": {
"tests": {
"case1": {
"stop": 10,
"atol": {"collector": 0.0001},
"expect": {"final": {"collector": 1.2778338688703827}}
}
}
}
}
end
Flattened Source
component SecondOrderSystemTest src = BlockComponents.Sine(amplitude=1, frequency=5) [{"Dyad": {"placement": {"icon": {"x1": 100, "y1": 100, "x2": 300, "y2": 300}}}}] sys = SecondOrderSystem(k1=2, k2=3, k3=4) [{"Dyad": {"placement": {"icon": {"x1": 400, "y1": 100, "x2": 600, "y2": 300}}}}] collector = RealInput() [{"Dyad": {"placement": {"icon": {"x1": 700, "y1": 100, "x2": 900, "y2": 300}}}}] relations connect(src.y, sys.xdd) [{"Dyad": {"edges": [{"S": 1, "E": 2}]}}] collector = sys.sum.y metadata { "Dyad": { "tests": { "case1": { "stop": 10, "atol": {"collector": 0.0001}, "expect": {"final": {"collector": 1.2778338688703827}} } } } } end
Test Cases
Test Case case1
Related
- Examples
- Experiments
- Analyses