Inproceedings,

Modelica - A Unified Object-Oriented Language for System Modeling and Simulation

, and .
ECOOP'98 (the 12th European Conference on Object-Oriented Programming), (20--24 jul 1998)

Abstract

A new language called Modelica for hierarchical physical modeling is developed through an international effort. Modelica 1.0 http://www.Modelica.org was announced in September 1997. It is an object-oriented language for modeling of physical systems for the purpose of efficient simulation. The language unifies and generalizes experience from previous object-oriented modeling languages.Compared to the widespread simulation languages available today this language offers three important advances: 1) non-causal modeling based on differential and algebraic equations; 2) multi-domain modeling capability, i.e. it is possible to combine electrical, mechanical, thermodynamic, hydraulic etc. model components within the same application model; 3) a general type system that unifies object-orientation, multiple inheritance, and templates within a single class construct.A class in Modelica may contain variables (i.e. instances of other classes), equations and local class definitions. A function (method) is a special case of class without equations, but including an algorithm section.The equation based non-causal modeling makes Modelica classes more reusable than classes in ordinary object-oriented languages. The reason is that the class adapts itself to the data flow context where it is instantiated and connected. The multidomain capability is partly based on a notion of connectors, i.e. certain class members that can act as interfaces (ports) when connecting instantiated objects. Connectors themselves are classes just like any other entity in Modelica.Simulation models can be developed using a graphical editor for connection diagrams. Connections are established just by drawing lines between objects picked from a class library.The Modelica semantics is defined via translation of classes, instances and connections into a flat set of constants, variables and equations. Equations are sorted and converted to assignment statements when possible. Strongly connected sets of equations are solved by calling a symbolic and/or numeric solver. The generated C/C++ code is quite efficient.In this paper we present the Modelica language with emphasis on its class construct and type system. A few short examples are given for illustration and compared with similar constructs in C++ and Java when this is relevant.

Tags

Users

  • @thorade
  • @gdmcbain

Comments and Reviews