Manual switch
Pick an input with a parameter. 1 uses the top input.
- signal
- Gradara equations
- 3 ports
- 1 parameter
manualSwitchLibraryRoutingDescription
Passes one of two inputs chosen by a parameter. Use it to try alternatives between runs without rewiring.
Example
Switches A switch that follows a control signal, and a manual switch set by a parameter.
Ramp−1ControlSwitchManual switch
Ports
Inputs 2
-
1
u1Input 1, passed when Select is 1.
-
2
u2Input 2, passed when Select is 2.
Outputs 1
-
y
Output signal.
Parameters
-
Select 1 or 2
sel1≥ 1
Which input to pass: 1 or 2. Values below 1.5 select input 1; 1.5 and above select input 2.
Equations
Modelica
y = u2 if sel ≥ 1.5 y = u1 otherwise
Implementation
The block’s Modelica model
y = if sel >= 1.5 then u2 else u1;
Assumptions and limitations
- The choice is fixed during a run. To switch during a run, use Switch.
Tips
- Both inputs must still be connected: an unconnected input is an error even when it is not selected.
See also
Select a block in Gradara and press F1 to open its page offline.