Switch
Pass u₁ when the control is above threshold, otherwise u₂.
- signal
- Gradara equations
- 4 ports
- 1 parameter
switch2LibraryRoutingDescription
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
Also in this example:ConstantRampPulseManual switch
Ports
Inputs 3
-
u₁
u1Input passed when sel ≥ Threshold.
-
sel
Control signal compared with Threshold.
-
u₂
u3Input u₂, passed when sel < Threshold.
Outputs 1
-
y
Output signal.
Parameters
-
Threshold
threshold0Level 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.