Modelica.StateGraph.Examples

Examples to demonstrate the usage of the components of the StateGraph library

Information

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Modelica.StateGraph.Examples.FirstExample FirstExample A first simple StateGraph example
Modelica.StateGraph.Examples.FirstExample_Variant2 FirstExample_Variant2 A variant of the first simple StateGraph example
Modelica.StateGraph.Examples.FirstExample_Variant3 FirstExample_Variant3 A variant of the first simple StateGraph example
Modelica.StateGraph.Examples.ExecutionPaths ExecutionPaths Example to demonstrate parallel and alternative execution paths
Modelica.StateGraph.Examples.ShowCompositeStep ShowCompositeStep Example to demonstrate parallel activities described by a StateGraph
Modelica.StateGraph.Examples.ShowExceptions ShowExceptions Example to demonstrate how a hierarchically structured StateGraph can suspend and resume actions on different levels
Modelica.StateGraph.Examples.ControlledTanks ControlledTanks Demonstrating the controller of a tank filling/emptying system
Modelica.StateGraph.Examples.Utilities Utilities Utility components for the examples

Modelica.StateGraph.Examples.FirstExample Modelica.StateGraph.Examples.FirstExample

A first simple StateGraph example

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.FirstExample_Variant2 Modelica.StateGraph.Examples.FirstExample_Variant2

A variant of the first simple StateGraph example

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.FirstExample_Variant3 Modelica.StateGraph.Examples.FirstExample_Variant3

A variant of the first simple StateGraph example

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.ExecutionPaths Modelica.StateGraph.Examples.ExecutionPaths

Example to demonstrate parallel and alternative execution paths

Information


This is an example to demonstrate in which way parallel activities can be modelled by a StateGraph. When transition1 fires (after 1 second), two branches are executed in parallel. After 6 seconds the two branches are synchronized in order to arrive at step6.

Before simulating the model, try to figure out whether which branch of the alternative sequence is executed. Note, that alternatives have priorities according to the port index (alternative.split[1] has a higher priority to fire as alternative.split[2]).

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.ShowCompositeStep Modelica.StateGraph.Examples.ShowCompositeStep

Example to demonstrate parallel activities described by a StateGraph

Information


This is the same example as "ExecutionPaths". The only difference is that the alternative paths are included in a "CompositeStep".

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.ShowExceptions Modelica.StateGraph.Examples.ShowExceptions

Example to demonstrate how a hierarchically structured StateGraph can suspend and resume actions on different levels

Information


CompositeStep "compositeStep" is a hierarchical StateGraph consisting of two other subgraphs. Whenever component "compositeStep" is suspended, all steps with in "compositeStep" are deactivated. By entering "compositeStep" via its "resume" port, all steps within "compositeStep" are activated according to their setting before leaving the "compositeStep" via its "suspend" port.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica.StateGraph.Examples.ControlledTanks Modelica.StateGraph.Examples.ControlledTanks

Demonstrating the controller of a tank filling/emptying system

Information


With this example the controller of a tank filling/emptying system is demonstrated. This example is from Dressler (2004), see Literature. The basic operation is to fill and empty the two tanks:

  1. Valve 1 is opened and tank 1 is filled.
  2. When tank 1 reaches its fill level limit, valve 1 is closed.
  3. After a waiting time, valve 2 is opened and the fluid flows from tank 1 into tank 2.
  4. When tank 1 is empty, valve 2 is closed.
  5. After a waiting time, valve 3 is opened and the fluid flows out of tank 2
  6. When tank 3 is empty, valve 3 is closed

The above "normal" process can be influenced by three buttons:

Extends from Modelica.Icons.Example (Icon for runnable examples).
Automatically generated Mon Sep 23 17:20:26 2013.