Test_Unit_Delay Icon
Test_Unit_Delay
Usage
PrimitiveComponents.Test_Unit_Delay()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( periodicsampler_{+}y(t), unitdelay_{+}u(t) \right) \\ \mathrm{connect}\left( step_{+}y(t), periodicsampler_{+}u(t) \right) \\ \mathrm{connect}\left( u(t), sampler_{+}u(t) \right) \\ \mathrm{connect}\left( sampler_{+}y(t), y(t), clock_{+}y(t) \right) \\ \frac{\mathrm{d} \mathtt{periodicsampler.clock.dummy.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{periodicsampler.sampler.y}\left( t \right) = Sample(ModelingToolkit.InferredClock.var"typeof(InferredClock)"(ModelingToolkit.InferredClock.var"##Storage#InferredDiscrete"(0)))\left( \mathtt{periodicsampler.sampler.u}\left( t \right) \right) \\ \mathtt{unitdelay.y}\left( t \right) = Shift(t, -1)\left( \mathtt{unitdelay.u}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{unitdelay.dummy.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{step.y}\left( t \right) = ifelse\left( t \geq \mathtt{step.start\_time}, \mathtt{step.height} + \mathtt{step.offset}, \mathtt{step.offset} \right) \\ \end{array} \right] \end{equation} \]
Source
test component Test_Unit_Delay
periodicsampler = PrimitiveComponents.DiscretePrimitives.PeriodicSampler(offset = 0, dt = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
},
"tags": []
}
}
unitdelay = PrimitiveComponents.DiscretePrimitives.UnitDelay(ic = 1.0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 282, "y1": 20, "x2": 382, "y2": 120, "rot": 0}
},
"tags": []
}
}
step = BlockComponents.Step(start_time = 1, offset = 0, height = 1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
},
"tags": []
}
}
relations
connect(periodicsampler.y, unitdelay.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(periodicsampler.u, step.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
end
Flattened Source
test component Test_Unit_Delay
periodicsampler = PrimitiveComponents.DiscretePrimitives.PeriodicSampler(offset = 0, dt = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
},
"tags": []
}
}
unitdelay = PrimitiveComponents.DiscretePrimitives.UnitDelay(ic = 1.0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 282, "y1": 20, "x2": 382, "y2": 120, "rot": 0}
},
"tags": []
}
}
step = BlockComponents.Step(start_time = 1, offset = 0, height = 1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
},
"tags": []
}
}
relations
connect(periodicsampler.y, unitdelay.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(periodicsampler.u, step.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses
- Tests