Modelica is an open source, object-oriented and equation-based language, used to model complex physical systems involving, for instance, mechanics, electronics, hydraulics and controls.
Why is this language born?
- To model the complex and dynamical behavior of multi domain systems.
- Models are described by differential, algebraic and/or discrete equations.
- There can be no modeling through partial differential equation: that means no FEM and no CFD. Only results from these methods may only be used by Dymola.
Modelica-based Simulation Environment
Dymola is a Modelica based simulation environment, fully compatible with all its libraries. This means that Dymola is capable of solving and simulate any model developed with Modelica.
Modelica Language Features
- Mathematical notation for matrixes and arrays can be composed by numbers, and by models as well;
- Sub-models are replaceable and modifiable: for instance, it’s easy to quickly change between different versions of a transmission in a vehicle model.
- Constructs are available to define discontinuous systems and variables, like switch or frictions.
- Mathematical functions with a variable number of input/output. The procedural part of Modelica is used as a scripting language.
- Functions written in C, Fortran and Java can be called inside Modelica.
- Powerful concept of Library (compilers have enough data to automatically search inside models, manage the version, update models…)
- concetto di libreria (I compilatori dispongono di informazioni sufficienti per la ricerca automatica all’interno di modelli , la gestione della versione, aggiornamento dei modelli, …).
Modelica is an object–oriented language in which:
- Every icon represents a physical component (electrical resistance, pump, …)
- A connection line represents the real physical coupling (cable, fluid or heat flux, …)
- A component can be composed by subsystems connected (in a hierarchical way) and/or described by equations
- Through symbolic manipulation algorithms, high level Modelica description gets translated in a set of algebraic differential equations.
- For each domain, causal and acausal (bidirectional) connectors are defined:
- Every connector type is compatible only with itself, since it is defined from physical quantities which belong to a certain physical domain.
- For each domain, physical balance laws are defined for every generic component.
- Models are composed from a source code Modelica representation, and from the relative graphical block scheme illustration.
- Each block represents a class instance, define outside the model.
- External class instances can be modified or renamed while declaring them.
- Connections among blocks are equations, as well.
Hardware in the loop
In each model, Modelica source code can easily be divided into logic units and then partitioned by defining different tasks and subtasks. Once these logic units have been defined, the development tool based on Modelica (Dymola) will be able to automatically split equations, generating the code for each physical target, thanks to the syntactic Modelica structure.