.ModelicaReference.StateMachines

Information

The state machines defined in the Modelica Language are based on the synchronous language elements. Note that the state machines defined in the Modelica Standard Library are not based on this.

Examples

  inner Integer v(start=0);
  block Increase
    outer output Integer v;
  equation
    v = previous(v) + 2;
  end Increase;
  Increase increase;
  block Decrease
    outer output Integer v;
  equation
    v = previous(v) - 1;
  end Decrease;
  Decrease decrease;
equation
  initialState(increase);
  transition(increase, decrease, v>=6, immediate=false);
  transition(decrease, increase, v==0, immediate=false);
In this example we will start in increase and increase v until a limit, and then decrease it, and repeat.

Description

A detailed description of the State Machines using Synchronous Language Elements is given in Chapter 17 (State Machines) of the Modelica 3.4 specification.
Generated at 2024-04-19T18:16:02Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos