TestDiscreteTransferFunction_Impulse Icon
TestDiscreteTransferFunction_Impulse
Test component for DiscreteTransferFunction with impulse input. Tests a second-order system H(z) = (0.25 + 0.5z^-1 + 0.25z^-2) / (1 - 0.5z^-1 + 0.25z^-2)
Usage
PrimitiveComponents.TestDiscreteTransferFunction_Impulse()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( ud_{+}y(t), tf_{+}u(t) \right) \\ \mathrm{connect}\left( zero_{+}y(t), ud_{+}u(t) \right) \\ \mathtt{ud.y}\left( t \right) = Shift(t, -1)\left( \mathtt{ud.u}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{ud.dummy.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{zero.y}\left( t \right) = \mathtt{zero.k} \\ \mathtt{tf.x1}\left( t \right) = 0.5 Shift(t, -1)\left( \mathtt{tf.x\_1}\left( t \right) \right) - 0.25 Shift(t, -1)\left( \mathtt{tf.x\_2}\left( t \right) \right) + \mathtt{tf.u}\left( t \right) \\ \mathtt{tf.x\_1}\left( t \right) = \mathtt{tf.x1}\left( t \right) \\ \mathtt{tf.x\_2}\left( t \right) = Shift(t, -1)\left( \mathtt{tf.x\_1}\left( t \right) \right) \\ \mathtt{tf.y}\left( t \right) = 0.5 Shift(t, -1)\left( \mathtt{tf.x\_1}\left( t \right) \right) + 0.25 \mathtt{tf.x1}\left( t \right) + 0.25 Shift(t, -1)\left( \mathtt{tf.x\_2}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{tf.dummy.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \end{array} \right] \end{equation} \]
Source
"""
Test component for DiscreteTransferFunction with impulse input.
Tests a second-order system H(z) = (0.25 + 0.5z^-1 + 0.25z^-2) / (1 - 0.5z^-1 + 0.25z^-2)
"""
test component TestDiscreteTransferFunction_Impulse
ud = PrimitiveComponents.DiscretePrimitives.UnitDelay(ic = 1.0)
zero = BlockComponents.Constant(k = 0.0)
tf = PrimitiveComponents.DiscretePrimitives.DiscreteTransferFunction(dt = 0.1, n_num = 3, n_den = 3, num = [0.25, 0.5, 0.25], den = [1.0, -0.5, 0.25], ic = 0.0)
relations
connect(ud.y, tf.u)
connect(zero.y, ud.u)
end
Flattened Source
"""
Test component for DiscreteTransferFunction with impulse input.
Tests a second-order system H(z) = (0.25 + 0.5z^-1 + 0.25z^-2) / (1 - 0.5z^-1 + 0.25z^-2)
"""
test component TestDiscreteTransferFunction_Impulse
ud = PrimitiveComponents.DiscretePrimitives.UnitDelay(ic = 1.0)
zero = BlockComponents.Constant(k = 0.0)
tf = PrimitiveComponents.DiscretePrimitives.DiscreteTransferFunction(dt = 0.1, n_num = 3, n_den = 3, num = [0.25, 0.5, 0.25], den = [1.0, -0.5, 0.25], ic = 0.0)
relations
connect(ud.y, tf.u)
connect(zero.y, ud.u)
metadata {}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses
- Tests