Lecture 8. Object-oriented Modeling and Modelica

Learning Outcomes: You should get some knowledge of acausal, equation-based modeling and be able to explain its importance for model-reuse in modeling multidomain, large-scale systems.  You should be able to read simple Modelica code and setup and run a small example in a Modelica tool, such as Modelon Impact Links to an external site.. You should know what a DAE system Links to an external site. is and what the index of such a system is.

Reading Assignment: Section 7.1 and Chapter 8 in Ljung and Glad.

Lecture slides: Lecture08_ObjectOrientedModelingandModelica.pdf Download Lecture08_ObjectOrientedModelingandModelica.pdf

Lecture video:

also available at Youtube here https://youtu.be/p-yXFxCZwRI Links to an external site.

Motivation

All of you have probably had some experience from modeling and simulating some dynamical systems, perhaps using a tool such as Simulink on a small toy-example in a course or in a small project (say with less than 100 states, with models that can be described on a couple of computer screens or so).  But when you start working on larger systems, perhaps including models from different domains, and when experts from different fields, and different companies, are cooperating and exchanging dynamical simulation components, you will quickly see the need for a proper language and good tools.

Much time and effort can be needed to produce reliable and good model libraries describing dynamical properties of components from different fields. These component models should be possible to connect to a larger system in a flexible way. This is why a-causal equation-based modeling is needed.

We will here describe the Modelica Links to an external site. language and let you try the tool Modelon Impact (In 2020 we used the tool "Dymola" instead)

Note: There is a recent effort within Matlab/Simulink also in this direction, called SimScape. But we prefer to teach you this using Modelica. It is a real language, tools are open source,...

You might find it fun to also watch this small video 

https://www.youtube.com/watch?v=LkAKQsur_Do Links to an external site.

indicating advantages with the acausal/equation-based approach compared to a causal/signal-flow approach (Do not try to follow the details about what happens in the tool at this moment).