Abstract
A new language called Modelica for hierarchical physical modeling is developed through an international effort. Modelica 1.0 [http:// www.Dynasim.se/Modelica] 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 previous object-oriented modeling languages. Compared with the widespread simulation languages available today this language offers three important advances: 1) non-causal modeling based on differential and algebraic equations; 2) multidomain 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) can be regarded as a special case of local 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 multi-domain 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.
Preview
Unable to display preview. Download preview PDF.
References
Abadi M., and L. Cardelli: A Theory of Objects. Springer Verlag, ISBN 0-387-94775-2, 1996.
Andersson M.: Object-Oriented Modeling and Simulation of Hybrid Systems. PhD thesis ISRN LUTFD2/TFRT—1043—SE, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden, December 1994.
Barton P.I., and C.C. Pantelides: Modeling of combined discrete/continuous processes. AIChE J., 40, pp. 966–979, 1994.
Elmqvist H., D. Brück, and M. Otter: Dymola — User's Manual. Dynasim AB, Research Park Ideon, Lund, Sweden, 1996.
Ernst T., S. Jähnichen, and M. Klose: The Architecture of the Smile/M Simulation Environment. Proc. 15th IMACS World Congress on Scientific Computation, Modelling and Applied Mathematics, Vol. 6, Berlin, Germany, pp. 653–658, 1997
Jeandel A., F. Boudaud., and E. Larivière: ALLAN Simulation release 3.1 description M.DéGIMA.GSA1887. GAZ DE FRANCE, DR, Saint Denis La plaine, FRANCE, 1997.
Peter Wegner. Concepts and paradigms of object-oriented programming. OOPS Messenger, 1 (1):9–87, August 1990.
Dynasim Home page, http://www.Dynasim.se
Mathematica Home page, http://www.wolfram.com
Fritzson, P. Static and String Typing for Extended Mathematica, Innovation in Mathematics, Proceedings of the Second International Mathematica Symposium, Rovaniemi, Finland, 29 June–4 July, V. Keränen, P. Mitic, A. Hietamäki (Ed.), pp 153–160.
Peter Fritzson, Lars Viklund, Dag Fritzson, Johan Herber. High-Level Mathematical Modelling and Programming, IEEE Software, 12(4):77–87, July 1995.
Sahlin P., A. Bring, and E.F. Sowell: The Neutral Model Format for building Simulation, Version 3.02. Technical Report, Department of Building Sciences, The Royal Institute of Technology, Stockholm, Sweden, June 1996.
ObjectMath Home Page, http://www.ida.liu.se/labs/pelab/omath
Hindmarsh, A.C., ODEPACK, A Systematized Collection of ODE Solvers, Scientific Computing, R. S. Stepleman et al. (eds.), North-Holland, Amsterdam, 1983 (Vol. 1 of IMACS Transactions on Scientific Computation), pp. 55–64, also http://www.netlib.org/odepack/index.html
Otter M., C. Schlegel, and H. Elmqvist, Modeling and Real-time Simulation of an Automatic Gearbox using Modelica. In Proceedings of ESS'97 — European Simulation Symposium, Passau, Oct. 19–23, 1997.
Tummescheit H., T. Ernst and M. Klose, Modelica and Smile — A Case Study Applying Object-Oriented Concepts to Multi-facet Modeling. In Proceedings of ESS'97 — European Simulation Symposium, Passau, Oct. 19–23, 1997.
Broenink J.F., Bond-Graph Modeling in Modelica. In Proceedings of ESS'97 — European Simulation Symposium, Passau, Oct. 19–23, 1997.
SIMULINK 2 — Dynamic System Simulation. http://www.mathworks.com/products/simulink/
ACSL software. http://www.mga.com
Jan Van der Spiegel. SPICE — A Brief Overview. http://howard.engr.siu.edu/ elec/faculty/etienne/spice.overview.html, http://www.seas.upenn.edu/~jan/spice/spice.overview.html
ADAMS — virtual prototyping virtually anything that moves. http://www.adams.com
V. Engelson, P. Fritzson, D. Fritzson. Generating Efficient 3D graphics animation code with OpenGL from object oriented models in Mathematica, In Innovation in Mathematics. Proceedings of the Second International Mathematica Symposium, Rovaniemi, Finland, 29 June–4 July 1997, V.Keränen, P. Mitic, A. Hietamäki (Ed.), pp. 129–136
Modelica Home Page http://www.Dynasim.se/Modelica
V. Engelson, P. Fritzson, D. Fritzson. Automatic Generation of User Interfaces From Data Structure Specifications and Object-Oriented Application Models. In Proceedings of European Conference on Object-Oriented Programming (ECOOP96), Linz, Austria, 8–12 July 1996, vol. 1098 of Lecture Notes in Computer Science, Pierre Cointe (Ed.), pp. 114–141. Springer-Verlag, 1996
V. Engelson, P. Fritzson, D. Fritzson. Using the Mathematica environment for generating efficient 3D graphics. In Proceedings of COMPUGRAPHICS/EDUGRAPHICS, Vilamoura, Portugal, 15–18 December 1997 (to appear).
D. Fritzson, P. Nordling. Solving Ordinary Differential Equations on Parallel Computers Applied to Dynamic Rolling Bearing Simulation. In Parallel Programming and Applications, P. Fritzson, L. Finmo, eds., IOS Press, 1995
SIMPACK Home page http://www.cis.ufl.edu/mpack/~fishwick/simpack.html
M. Löfgren, J. Lindskov Knudsen, B. Magnusson, O. Lehrmann Madsen Object-Oriented Environments — The Mjølner Approach ISBN 0-13-009291-6, Prentice Hall, 1994. See also Beta Home Page, http://www.daimi.aau.dk/~beta/
H. Elmqvist, S. E. Mattsson: “Modelica — The Next Generation Modeling Language — An International Design Effort”. In Proceedings of First World Congress of System Simulation, Singapore, September 1–3 1997.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Fritzson, P., Engelson, V. (1998). Modelica — A unified object-oriented language for system modeling and simulation. In: Jul, E. (eds) ECOOP’98 — Object-Oriented Programming. ECOOP 1998. Lecture Notes in Computer Science, vol 1445. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054087
Download citation
DOI: https://doi.org/10.1007/BFb0054087
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64737-9
Online ISBN: 978-3-540-69064-1
eBook Packages: Springer Book Archive