Modelica

Modelica classes are not compiled in the usual sense, but they are translated into objects which are then exercised by a simulation engine.

Second, although classes may contain algorithmic components similar to statements or blocks in programming languages, their primary content is a set of equations.

Modelica 1.0 is based on the PhD thesis[5] of Hilding Elmqvist and on the experience with the modeling languages Allan,[6] Dymola, NMF[7] ObjectMath,[8] Omola,[9] SIDOPS+,[10] and Smile.

In September 1997, version 1.0 of the Modelica specification was released which was the basis for a prototype implementation within the commercial Dymola software system.

Openmodelica[17] is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage.

Its long-term development is supported by a non-profit organization – the Open Source Modelica Consortium (OSMC).

): The following code fragment shows an example to calculate the second derivative [23] of a trigonometric function, using OMShell, as a means to develop the program written below.

The most basic structuring concepts are shown at hand of simple examples from the electrical domain: Modelica has the four built-in types Real, Integer, Boolean, String.

Typically, user-defined types are derived, to associate physical quantity, unit, nominal values, and other attributes: The interaction of a component to other components is defined by physical ports, called connectors, e.g., an electrical pin is defined as When drawing connection lines between ports, the meaning is that corresponding connector variables without the "flow" prefix are identical (here: "v") and that corresponding connector variables with the "flow" prefix (here: "i") are defined by a zero-sum equation (the sum of all corresponding "flow" variables is zero).

A typical example is the following electrical circuit: Via the language element annotation(...), definitions can be added to a model that do not have an influence on a simulation.

Modelica is designed to be domain neutral and, as a result, is used in a wide variety of applications, such as fluid systems (for example, steam power generation, hydraulics, etc.

caption
caption