.ModelicaDEVS.FunctionBlocks.Switch

Information

The Switch Block

Parameters:
level switching level


Description:

The Switch block can be thought to direct either the first or the third input port to its output port. The second input port takes the decision which of the input ports is actually propagated: if the value of the second input port is bigger than a given level, the Switch propagates the first input port, otherwise the third one.

Contrary to PowerDEVS, where this block is an atomic model, ModelicaDEVS makes use of the fact that the DEVS formalism allows for hierarchical models: by putting a multi-component model into one of the predefined block hull templates it can be used as a normal block for further models. The interior life of the Switch block looks as shown in the following figure:



Let us have a look at the purpose of each of the internal blocks. The two pictures below illustrate the behaviour of a Switch block.

The first picture shows the trajectory of the second input port (a sine signal plotted in blue) and the switching level (red) given by the parameter level. The crossing instants of the sine signal with the switching level determines the time instants when the Switch has to flip, thereby changing the source (port 1 or port 3) for its output port.



The second picture shows the first input port (blue) that is simply a constant value at v=3 and the third input port that is a sine signal that starts only at time t=0.8. The output of the Switch block is then plotted in red. It can be easily seen that when the sine signal in the first picture is bigger than the switching level, the output is constant at the value 3, and when the sine signal drops below the switching level, the Switch output equals the trajectory of the sine signal of the third input port.




Generated at 2024-11-20T19:25:51Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos