Switch

Pass u₁ when the control is above threshold, otherwise u₂.

  • signal
  • Gradara equations
  • 4 ports
  • 1 parameter
BlockSwitchKindswitch2LibraryRouting

Description

Passes one of two inputs depending on a control signal: u₁ when the control is at or above Threshold, otherwise u₂.

Example

Switches A switch that follows a control signal, and a manual switch set by a parameter.

Ramp−1ControlSwitchManual switch
In Gradara, select a Switch block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:ConstantRampPulseManual switch

Ports

Inputs 3

  • u₁u1

    Input passed when sel ≥ Threshold.

  • sel

    Control signal compared with Threshold.

  • u₂u3

    Input u₂, passed when sel < Threshold.

Outputs 1

  • y

    Output signal.

Parameters

  • Thresholdthreshold0

    Level the control signal is compared with. The upper input is chosen when sel equals it.

Equations

Modelica
y = u1 if sel ≥ threshold
y = u3 otherwise

Implementation

The block’s Modelica model
y = if sel >= threshold then u1 else u3;

Assumptions and limitations

  • The switch is instant, so the output jumps when the selection changes. It takes a real-valued control; for a Boolean control, use Logical switch.

See also

Select a block in Gradara and press F1 to open its page offline.