Modeling and simulation in Engineering using Modelica
A. Urquía, C. Martín‐Villalba
This book offers an introduction to the development and simulation of Modelica
models for engineering applications. The target audience are bachelor’s or master’s
level students, interested in modeling and simulation, and with a background in both
physics and numerical methods.
The modeling methodology, the Modelica language features, and the use of modeling
environments are explained through examples. This facilitates the use of this book in
the context of student‐centered learning strategies, such as problem‐based learning,
and project‐based learning.
The book is structured into three parts: (i) continuous‐time modeling; (ii) simulation of
continuous‐time models; and (iii) hybrid system modeling and simulation.
The modeling methodology and the Modelica features for continuous‐time modeling
are discussed in the first part of the book. The modeling methodology supported by
Modelica, named object‐oriented modeling, is discussed in Lesson 1. The mathematical
formalism underlying the Modelica language and algorithms for simulating this type of
model, named hybrid DAE system, are also discussed in the first lesson, and the use of
Dymola and OpenModelica is introduced. The description of atomic models and model
libraries in Modelica is discussed in Lessons 2 and 3.
The simulation of continuous‐time Modelica models is addressed in the second part of
the book. We have favored simplicity, clarity and readability over mathematical rigor.
The main objective is to provide the reader with the minimum knowledge required for
understanding the messages generated by the modeling environment (e.g., Dymola
and OpenModelica) during the model translation and simulation. A broad range of
topics are introduced: computational causality assignment, DAE index reduction, DAE
initialization, state variable selection, and numerical methods for DAE systems. The
analyses and symbolic manipulations that modeling environments perform on
Modelica models are discussed in Lessons 4 and 5, and the numerical methods in
The third part of the book is devoted to discuss hybrid modeling and simulation in
Modelica. The formal specification of hybrid models, and the relationship of this
specification with the simulation algorithm and the Modelica description, are
described in Lesson 7. Numerical methods for event detection and handling are
discussed in Lesson 8. Once again, simplicity has been favored over mathematical
rigor. The objective is to provide the reader with the minimum knowledge required to
understand the issues associated with the description of events, and variable structure
models in Modelica. The goal is not to explain how to implement a simulator, but to
explain how to design and implement models that can be simulated efficiently,
without causing errors. Finally, the language features for describing time and state
events, and runtime changes in the model mathematical description, are illustrated by
a series of examples in Lesson 9.