Conditional Switch

Block-library: DUBSI
  block

The Conditional Switch block can be used to select between two signals, based on the outcome of a switch criterion.

The switch criterion function is a logical function that should output either 0 ('false'), or 1 ('true'). Its outcome depends on the value of the second inputsignal to the Conditional Switch block, u2. There is no restriction to the signal format of this inputsignal; all formats are allowed as long as they may be used within Simulink itself.

The criterion function must be entered as blockparameter by the user. Some examples of valid switch criterion functions are:

        u[1] < 3

        u[1] == u[2]+u[3]

        u[6] >= u[7] && u[1]+2*u[2] <= 10

If the returnvalue of this function is not equal to either 0 or 1, the block will act as if the criterion was not met. In other words: if the criterion is invalid, its output is forced to be zero.

The output of the block is equal to either the first input value, u1, or the third input value, u3. It uses the following logic:

  • when the switch criterion is met, u1 is passed through,
  • if the criterion is not met, u3 is passed through.

Notice that the switch is quite similar to the standard Switch block from the Nonlinear library in Simulink, except that the Conditional Switch block allows more flexibility in the definition of switching logic.

April 15, 2003