WOLFRAM SYSTEM MODELER

StateMachines

State Machines

Wolfram Language

In[1]:=
SystemModel["ModelicaReference.StateMachines"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

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.