Software
The number of software tools for defining and analysing state automata is huge, as is the number of domains of application of this modelling concept. As we are leaning towards the control systems domain, we first encounter the tools produced by The Mathworks company (Matlab and Simulink)
Matlab and Simulink
- StateFlow – finite state automata within Simulink. A nice interactive tutorial is launched directly within Simulink upon entering
learning.simulink.launchOnramp("stateflow")
in Matlab. This is the primary tool for our course, as it extends nicely to hybrid systems. An example is shown in Fig 1 below.
- SimEvents – oriented towards one instance of the (state) automata, namely queuing systems. You may want to have a look at the series of introductory videos by the Mathworks, although we are not going to rely on this tool in our course.
Several tools are also available outside Matlab and Simulink, and it is certainly good to be aware of these alternatives.
(Open)Modelica
A popular modelling language for physical systems is Modelica. Starting with version 3.3 (several years ago already), it has a support for state machines, see Chapter 17 in the language specification and the screenshot in Fig 2 below. A readable introduction to state machines in Modelica is in [1].
Several implementations of Modelica language and compiler exist. On the FOSS side, OpenModelica is a popular choice. Slides from an introdutory presentation [2] about state machines in OpenModelica are available for free download.
UPPAAL
Dedicated software for timed automata. Not only modelling and simulation but also formal verification. Available at https://uppaal.org/. In our course we will only use it in this block/week. A tutorial is [3].
Python
SimPy – discrete-event simulation in Python. We are not going to use it in our course, but if you are a Python enthusiast, you may want to have a look at it.
Julia
Two major packages for discrete-event simulation in Julia are:
- ConcurrentSim.jl – discrete-event simulation in Julia.
- DiscreteEvents.jl – discrete-event simulation in Julia.
UML/SysML
If you have been exposed to software engineering, you have probably seen UML diagrams. Their extension (and restriction at the same time) toward systems that also contain hardware is called SysML. And SysML does have support for defining state machines (by drawing the state machine diagrams), see the screenshot in Fig 3 below.
SysML standard also augments the original concept of a state automaton with hierarchies, and some more. But we are not going to discuss it here. Should you need to follow this standard in your project, you may consider exploring some free&open-source (FOSS) tool for creating SysML diagrams such as Modelio or Eclipse Papyrus. But we are not going to use them in our course.
Drawing tools
Last but not least, you may want only to draw state automata (state machines). While there is no shortage of general WYSIWYG drawing and diagramming tools, you may want to consider Graphviz software that processes text description of automata in DOT language. This is what I used in this lecture. As an alternative, but still text-based, you may want to give a try to Mermaid, which can also draw what they call state diagrams.
If you still prefer WISYWIG tools, have a look at IPE, which I also used for some other figures in this lecture and in the rest of the course. Unlike most other tools, it also allows to enter LaTeX math.