What is Modelica and why bother?

by Marco Bonvini on Sunday October 16, 2016

In this post I try to explain what is Modelica and why it does matter. Modelica, as the name suggests, is a modeling language. Which type of models? Mathematical models. As you work with the language you’ll quickly realize it has a strong focus on math. Having said that, Modelica does not focus on a specific real-world domain, like mechanical models for automotive industry, or financial models for banks. Rather, it attempts to provide a structure and syntax that allows the user to represent as many types of physical systems as possible.

You can use the language to create mathematical models using any combination of the following formalisms

  • differential equations
  • algebraic equations
  • difference equations
  • discrete event systems

As you can probably imagine, this kind of flexibility makes it easier to tackle lots of different and interesting engineering problems, including multi-physical systems.

What are multi-physical systems?

A typical example is a car. The car is characterized by mechanical components that interact with electronics and hydraulic systems, all under the supervision of multiple control systems. So if you want to know how a car is actually going to work, you need to simulate the whole shebang

Ignoring the interaction between components – a rookie mistake in the world of simulations – would lead to a poor understanding of the system.

A car, typical example of multi-physical system.
A car, typical example of multi-physical systems.

It’s not hard to find other examples of Multi-phyisical systems that you might want to model in a computer program. They’re everywhere you look:

  • every private or public transportation vehicle – even electric-bikes
  • the electrical grid that powers our houses
  • data centers that process our data, etc.

Some of the most compelling examples are found right in our own homes. With the rise of electric vehicles that plug into our home battery systems, solar power panels on the roof, smart thermostats on the kitchen wall, and loads controlled by IoT devices scattered through the home, it becomes quite a task to control all these “things” to keep us warm, the car in the garage fully charged and the coffee ready at 8am. Of course all this should happen while minimizing our electric bill, our carbon footprint and avoid stress on the electric grid thereby avoiding blackouts!

So, at this point you should be convinced that multi-physical systems are a big part of everyday life. Modelica allows engineers and scientists to model these systems accurately and thereby get a good understanding how they works and and how to improve their performance. This is why Modelica matters.

For some actual examples of how Modelica works, let’s continue to the following of this series, SW engineering meets mathematical modeling - Modelica basics.

Aknowledgments

Special thanks to Daniel McQuillen for proof reading this post and providing helpful suggestions.

Disclaimer

All materials on this site are protected by copyright and intellectual property laws and are the property of Marco Bonvini. Unless stated otherwise, you may access and download the materials located on marcobonvini.com only for personal, non-commercial use.

Social Links

Location

California, US

Website powered by BlackTie, and Jekyll - © Marco Bonvini 2015-2020