Conference article

Modelica on the Java Virtual Machine

Christoph Höger
Technische Universität Berlin, Germany

Download article

Published in: Proceedings of the 5th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools; April 19; University of Nottingham; Nottingham; UK

Linköping Electronic Conference Proceedings 84:14, p. 111-120

Show more +

Published: 2013-03-27

ISBN: 978-91-7519-621-3 (print)

ISSN: 1650-3686 (print), 1650-3740 (online)


Modelica has seen a steady growth of adaption in industry and research. Yet; most of the currently available tools follow the same technological path: A Modelica model is usually interpreted into a system of equations which is then compiled into e.g. C. In this work; we demonstrate how a compiler can translate Modelica models into Java classes. Those Java classes can be evaluated into a system of equations which can be solved directly on the JVM. Implementing this tool yields some interesting problems. Among these are the representation of polymorphic data; runtime-causalisation and equation optimization and Modelica’s modification system. All those problems can be solved efficiently on the JVM.


Modelica; separate compilation; Java


[1] Modelica - a unified object-oriented language for physical systems modeling; 2012.

[2] Joshua Bloch. Effective Java (2nd Edition) (The Java Series). Prentice Hall PTR; Upper Saddle River; NJ; USA; 2 edition; 2008.

[3] R.F. Boisvert; J. Moreira; M. Philippsen; and R. Pozo. Java and numerical computing. Computing in Science Engineering; 3(2):18 –24; mar/apr 2001.

[4] Willi Braun; Lennart Ochel; and Bernhard Bachmann. Symbolically derived jacobians using automatic differentiation - enhancement of the openmodelica compiler.

[5] David Broman. Meta-Languages and Semantics for Equation- Based Modeling and Simulation. PhD thesis; Department of Computer and Information Science; Linköping University; Sweden; 2010.

[6] Peter Fritzson; Peter Aronsson; Håkan Lundvall; Kaj Nyström; Adrian Pop; Levon Saldamli; and David Broman. The openmodelica modeling; simulation; and development environment. In Proceedings of the 46th Conference on Simulation and Modeling; pages 83–90; 2005.

[7] G. Giorgidze. First-class models: On a noncausal language for higher-order and structurally dynamic modelling and simulation. PhD thesis; The University of Nottingham; 2012.

[8] Christoph Höger; Florian Lorenzen; and Peter Pepper. Notes on the separate compilation of modelica. In Peter Fritzson; Edward Lee; François E. Cellier; and David Broman; editors; 3rd International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools; pages 43–51. Linköping University Electronic Press; 2010.

[9] Christoph Höger. Separate compilation of causalized equations -work in progress. In François E. Cellier; David Broman; Peter Fritzson; and Edward A. Lee; editors; EOOLT; volume 56 of Linköping Electronic Conference Proceedings; pages 113–120. Linköping University Electronic Press; 2011.

[10] Christoph Höger. Modim - a modelica frontend with static analysis. In Vienna International Conference on Mathematical Modelling 2012; Vienna; Austria; February 2012.

[11] Chris Lattner and Vikram Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO’04); Palo Alto; California; Mar 2004.

[12] Tim Lindholm and Frank Yellin. Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co.; Inc.; Boston; MA; USA; 2nd edition; 1999.

[13] Sven Erik Mattsson; Hans Olsson; and Hilding Elmqvist. Dynamic selection of states in dymola. In Modelica Workshop 2000 Proceedings; pages 61–67; 2000.

[14] Sven Erik Mattsson and Gustaf Söderlind. Index reduction in differential-algebraic equations using dummy derivatives. SIAM Journal on Scientific Computing; 14(3):677–692; 1993.

[15] A. Mehlhase. A Python Package for Simulating Variable- Structure Models with Dymola. In Inge Troch; editor; Proceedings of MATHMOD 2012; Vienna; Austria; feb 2012. IFAC. submitted.

[16] Uwe Naumann. The Art of Differentiating Computer Programs: An Introduction to Algorithmic Differentiation.

[17] Barak Naveh et al. Jgrapht. Internet: http://jgrapht. sourceforge. net; 2008.

[18] Franck Verdiere; Abir Rezgui; Sana Gaaloul; Benoit Delinchant; Laurent Gerbaud; Frédéric Wurtz; and Xavier Brunotte. Modelica models translation into java components for optimization and dae solving using automatic differentiation. In David Al-Dabass; Alessandra Orsoni; and Richard Cant; editors; UKSim; pages 340–344. IEEE; 2012.

[19] Dirk Zimmer. Module-preserving compilation of modelica models. In Proceedings of the 7th International Modelica Conference; Como; Italy; 20-22 September 2009; Linköping Electronic Conference Proceedings; pages 880– 889. Linköping University Electronic Press; Linköpings universitet; 2009.

[20] Dirk Zimmer. Equation-based Modeling of Variablestructure Systems. PhD thesis; ETH Zürich; 2010.

[21] Dirk Zimmer. A reference-based parameterization scheme for equation-based object-oriented modeling languagesmodim - a modelica frontend with static analysis. In Vienna International Conference on Mathematical Modelling 2012; Vienna; Austria; February 2012.

Citations in Crossref