Skip to content
Step.md

Step ​

Generates a step signal that transitions from offset to height+offset at the specified time.

The step component produces an output y that changes from the offset value to height+offset when the simulation time reaches start_time. This provides a way to model abrupt changes in signals for testing system responses. The behavior is defined by the equation:

y={height+offsetif time≥start_timeoffsetotherwise

This component extends from Signal

Usage ​

BlockComponents.Step(start_time=0.0, offset=0.0, height)

Parameters: ​

NameDescriptionUnitsDefault value
start_timeTime at which the signal starts changing from its offset values0
offsetConstant value added to the signal output–0
heightMagnitude of the step change–

Connectors ​

  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior ​

y(t)=ifelse(t≥start_time,height+offset,offset)

Source ​

dyad
"""
Generates a step signal that transitions from `offset` to `height+offset` at the specified time.

The step component produces an output y that changes from the `offset` value to `height+offset`
when the simulation time reaches `start_time`. This provides a way to model abrupt changes
in signals for testing system responses. The behavior is defined by the equation:

math y = \begin{cases} \text{height} + \text{offset} & \text{if time} \geq \text{start_time} MarkdownAST.LineBreak()

\text{offset} & \text{otherwise} \end

"""
component Step
  extends Signal
  "Magnitude of the step change"
  parameter height::Real
relations
  y = ifelse(time >= start_time, height + offset, offset)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Step.svg"}
  }
}
end
Flattened Source
dyad
"""
Generates a step signal that transitions from `offset` to `height+offset` at the specified time.

The step component produces an output y that changes from the `offset` value to `height+offset`
when the simulation time reaches `start_time`. This provides a way to model abrupt changes
in signals for testing system responses. The behavior is defined by the equation:

math y = \begin{cases} \text{height} + \text{offset} & \text{if time} \geq \text{start_time} MarkdownAST.LineBreak()

\text{offset} & \text{otherwise} \end

"""
component Step
  "Real-valued output connector for the component"
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      }
    }
  }
  "Time at which the signal starts changing from its offset value"
  parameter start_time::Time = 0.0
  "Constant value added to the signal output"
  parameter offset::Real = 0.0
  "Magnitude of the step change"
  parameter height::Real
relations
  y = ifelse(time >= start_time, height + offset, offset)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Step.svg"}
  }
}
end


Test Cases ​

No test cases defined.