To define a possible change of states, a Transition is connected to the output of the preceding Step and to the input of the succeeding Step, see figure to the right, where Transition t1 defines the transition from Step s1 to Step s2. Note: A Transition has exactly one preceding and one succeeding Step. A Transition is said to be enabled if the preceding step is active. An enabled transition is said to be fireable when the Boolean condition defined in the parameter menu of the transition is evaluated to true. This condition is also called Transition condition and is displayed in the icon of the Transition (e.g., "time > 1" is the condition of Transition t1). When parameter use_conditionPort is set, the Transition condition is alternatively defined by a Boolean signal that is connected to the enabled conditionPort.

A fireable transition will fire immediately. In the figure to the right, t1 fires when s1 is active and time is greater than one, i.e., s1 becomes inactive and s2 becomes active. The firing of a transition can optionally also be delayed for a certain period of time defined by parameter "waitTime". See, e.g., t2 in the figure to right, that is delayed for one second before it may fire, given that the condition remains true and the preceding Step remains active during the entire delay time.

In the following table different configurations of a Transition are shown:

Parameter setting Icon Description
Default transition The transition fires when the preceding step is active and the expression "condition" in the parameter menu is true.
use_conditionPort = true The transition fires when the preceding step is active and connector "conditionPort" is true.
delayedTransition = true The transition fires after the delay time "waitTime" (here: 1.23 s), if the preceding step was active, and "condition = true" during the entire delay time.
use_firePort = true Connector "firePort" is true when the transition fires. Actions may be triggered, e.g., by connecting block MultiSwitch to the firePort.
loopCheck = false
(in "Advanced" tab)
It is not checked whether the loop in which this Transition is used, has at least one delayed transition. Use this option only, if you are completley sure that infinite event looping is not possible in this loop. Consider to use LoopBreakingTransition instead!

At an event instant, an iteration occurs, due to the Modelica semantics (= whenever a new event occurs, the model is re-evaluated). This means that Transitions keep firing along a connected graph, as long as the firing conditions are true. In principal, it is therefore possible that infinite event looping occurs. A simple example of this kind is shown in the figure to the right. Here, all Transition conditions are true and therefore all Transitions would fire forever at the initial time. This is, however, no valid StateGraph2 model and will result in a translation error, since it is required that a StateGraph2 model has at least one delayed Transition per loop. This means that one of T1, T2, or T3, must have parameter delayedTransition=true. Since event iteration stops at a delayed Transition, infinite event looping cannot occur. This also means that at one time instant every Transition can fire at most once and therefore the number of model evaluations at an event instant is bounded by the number of Transition components.

If you have to artifically introduce a delay time in order to fulfill the requirement above, it is recommended to use the special LoopBreakingTransition that is designed for this case.

Note, it is still possible that infinite event looping occurs due to model errors in other parts of the model. For example, if a user introduces an equation of the form "J = pre(J) + 1" outside of a when-clause, event iteration does not stop.

There are rare situations, where infinite event looping cannot occur even if there is no delayed transition in a loop. When you do not want to introduce an artifical time delay in a loop in this case, you can switch off the loop check by setting parameter "loopCheck = false" in the "Advanced" tab of the parameter menu of one Transition in this loop.

Generated at 2024-07-21T18:15:58Z by OpenModelicaOpenModelica 1.23.1 using GenerateDoc.mos