-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdes_software.qmd
60 lines (36 loc) · 4.88 KB
/
des_software.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "Software"
bibliography:
- ref_modelica.bib
- ref_des.bib
csl: ieee-control-systems.csl
format: html
crossref:
fig-prefix: Fig.
eq-prefix: Eq.
---
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](https://www.mathworks.com/products/stateflow.html) – 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-statechart-stateflow below.
![Screenshot of a state "chart" in Simscape](des_figures/aircontrol-chart_stateflow.png){#fig-statechart-stateflow}
- [SimEvents](https://www.mathworks.com/products/simevents.html) – oriented towards one instance of the (state) automata, namely *queuing systems*. You may want to have a look at the [series of introductory videos](https://www.mathworks.com/videos/series/understanding-discrete-event-simulation.html) 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](https://www.modelica.org). Starting with version 3.3 (several years ago already), it has a support for state machines, see Chapter 17 in the [language specification](https://specification.modelica.org/master/state-machines.html) and the screenshot in @fig-statemachine-modelica below. A readable introduction to state machines in Modelica is in @elmqvistStateMachinesModelica2012.
![Screenshot of a state machine diagram in Modelica](des_figures/statemachine_modelica.png){#fig-statemachine-modelica}
Several implementations of Modelica language and compiler exist. On the FOSS side, [OpenModelica](https://openmodelica.org) is a popular choice. Slides from an introdutory presentation @thieleStateMachinesOpenModelica2015 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/](https://uppaal.org). In our course we will only use it in this block/week. A tutorial is @behrmannTutorialUppaal2004.
## Python
[SimPy](https://simpy.readthedocs.io/en/latest/) – 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](https://github.com/JuliaDynamics/ConcurrentSim.jl) – discrete-event simulation in Julia.
- [DiscreteEvents.jl](https://github.com/JuliaDynamics/DiscreteEvents.jl) – discrete-event simulation in Julia.
## UML/SysML
If you have been exposed to software engineering, you have probably seen [UML](https://www.uml.org) diagrams. Their extension (and restriction at the same time) toward systems that also contain hardware is called [SysML](https://sysml.org). And SysML does have support for defining state machines (by drawing the [state machine diagrams]((https://sysml.org/sysml-faq/what-is-state-machine-diagram.html))), see the screenshot in @fig-statemachine-sysml below.
![Screenshot of a state machine diagram in SysML](des_figures/statemachine_sysml.png){#fig-statemachine-sysml}
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](https://www.modelio.org) or [Eclipse Papyrus](https://eclipse.dev/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](https://graphviz.org) software that processes text description of automata in [DOT](https://graphviz.org/doc/info/lang.html) 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](https://mermaid.js.org), which [can also draw what they call state diagrams](https://mermaid.js.org/syntax/stateDiagram.html).
If you still prefer WISYWIG tools, have a look at [IPE](https://ipe.otfried.org), 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.