StepTest ​
Test that validates step response behavior by connecting a step signal to a terminator.
This component creates a test setup for validating the Step block by connecting its output to a Terminator. The Step block generates a signal that starts at the offset value and jumps by the height value at the start_time. The test case verifies that the signal properly transitions from the initial offset value to the final value (offset + height).
Usage ​
BlockComponents.StepTest()
Behavior ​
Source ​
dyad
"""
Test that validates step response behavior by connecting a step signal to a terminator.
This component creates a test setup for validating the `Step` block by connecting its output
to a `Terminator`. The `Step` block generates a signal that starts at the `offset` value and jumps
by the `height` value at the `start_time`. The test case verifies that the signal properly
transitions from the initial offset value to the final value (offset + height).
"""
test component StepTest
"Terminates a signal connection without passing it further"
terminator = Terminator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
}
}
}
"Generates a step signal with configurable height, offset and start time"
signal = Step(height = 1.4, offset = 0.5, start_time = 0.5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
}
}
}
relations
"Connects the step signal output to the terminator input"
connect(signal.y, terminator.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {
"Dyad": {
"icons": {"default": "dyad://BlockComponents/Example.svg"},
"tests": {
"case1": {
"stop": 1,
"expect": {
"initial": {"signal.y": 0.5},
"signals": ["signal.y", "terminator.u"],
"final": {"signal.y": 1.9, "terminator.u": 1.9}
}
}
}
}
}
endFlattened Source
dyad
"""
Test that validates step response behavior by connecting a step signal to a terminator.
This component creates a test setup for validating the `Step` block by connecting its output
to a `Terminator`. The `Step` block generates a signal that starts at the `offset` value and jumps
by the `height` value at the `start_time`. The test case verifies that the signal properly
transitions from the initial offset value to the final value (offset + height).
"""
test component StepTest
"Terminates a signal connection without passing it further"
terminator = Terminator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 155, "y1": 20, "x2": 255, "y2": 120, "rot": 0}
}
}
}
"Generates a step signal with configurable height, offset and start time"
signal = Step(height = 1.4, offset = 0.5, start_time = 0.5) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
}
}
}
relations
"Connects the step signal output to the terminator input"
connect(signal.y, terminator.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {
"Dyad": {
"icons": {"default": "dyad://BlockComponents/Example.svg"},
"tests": {
"case1": {
"stop": 1,
"expect": {
"initial": {"signal.y": 0.5},
"signals": ["signal.y", "terminator.u"],
"final": {"signal.y": 1.9, "terminator.u": 1.9}
}
}
}
}
}
endTest Cases ​
Test Case case1 ​
julia
pltjulia
pltRelated ​
Examples
Experiments
Analyses
Tests