---
url: /dyad/dev/stdlib/BlockComponents/tests/Sources.Tests.Step.md
description: >-
  Dyad Sources.Tests.Step docs.  Test that validates step response behavior by
  connecting a step signal to a terminator.
---

# `Sources.Tests.Step` {#Sources.Tests.Step}

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 {#Usage}

`BlockComponents.Sources.Tests.Step()`

## Behavior {#Behavior}

$$ \begin{align}
0 &= \mathrm{connect}\left( signal\_{+}y, terminator\_{+}u \right) \\
\mathtt{signal.y}\left( t \right) &= ifelse\left( t \geq \mathtt{signal.start_time}, \mathtt{signal.height} + \mathtt{signal.offset}, \mathtt{signal.offset} \right)
\end{align}
$$

## Source {#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 Step
  "Terminates a signal connection without passing it further"
  terminator = BlockComponents.Routing.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 = BlockComponents.Sources.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}
        }
      }
    }
  }
}
end
```

```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 Step
  "Terminates a signal connection without passing it further"
  terminator = BlockComponents.Routing.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 = BlockComponents.Sources.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}
        }
      }
    }
  }
}
end
```

## Test Cases {#Test-Cases}

### Test Case `case1` {#Test-Case-case1}

```julia
plt
```

![](kbmduvi.svg)

```julia
plt
```

![](fspskvx.svg)

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`LimPID`](Sources.Tests.Step.md)

  * [`LimPIDExternalDerivative`](Sources.Tests.Step.md)

  * [`LimPIDPOnly`](Sources.Tests.Step.md)

  * [`LimPIDWithoutD`](Sources.Tests.Step.md)

  * [`LimPIDWithoutI`](Sources.Tests.Step.md)

  * [`PID`](Sources.Tests.Step.md)

  * [`PadeDelay`](Sources.Tests.Step.md)

  * [`StateSpace`](Sources.Tests.Step.md)

  * [`Step`](Sources.Tests.Step.md)

  * [`Step`](Sources.Tests.Step.md)

  * [`Terminator`](Sources.Tests.Step.md)

  * [`TransferFunction`](Sources.Tests.Step.md)
