Static Validation of Modelica Models for Language Compliance and Structural Integrity

Roland Samlaus
Turbine Simulation, Software Development and Aerodynamics, Fraunhofer Institute for Wind Energy and Energy System Technology, Germany

Mareike Strach
Turbine Simulation, Software Development and Aerodynamics, Fraunhofer Institute for Wind Energy and Energy System Technology, Germany

Ladda ner artikel

Ingår i: 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:2, s. 5-13

Visa mer +

Publicerad: 2013-03-27

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

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


The increasing importance of the simulation of physical systems models demands enhanced support for developers. Models do not only increase in terms of quantity; but also complexity. Hence; libraries need to be created containing valid models for re-use. It is crucial for library developers to get immediate feedback about errors regarding the language specification. Moreover; users of libraries need to know immediately if existing components are misused. When using Modelica as the modeling language the models are validated at compilation time by recent development environments. This decreases the development speed as developers recognize errors in their models late and therefore need to recapitalize the design decisions made in order to maintain the intent of the code during error fixing. In this paper we present two implementations; i.e. Object Constraint Language (OCL) and Java; for Modelica code validation that can be triggered during model editing. Both variants are compared to each other regarding readability of constraints as well as execution performance. Therefore; rules are extracted from the Modelica language specification asserting that the models are correct. Furthermore; custom rules are defined restricting library models such that they can only be used in the intended way.


Modelica model validation; static source code analysis; constraint languages


[1] Frank Budinsky; Stephen A. Brodsky; and Ed Merks. Eclipse Modeling Framework. Pearson Education; 2003.

[2] Peter Bunus and Peter Fritzson. Automated static analysis of equation-based components. Simulation; 80(7-8):321– 345; 2004.

[3] Erich Gamma; Richard Helm; Ralph Johnson; and John Vlissides. Design Patterns – Elements of Reusable Object- Oriented Software. Addison-Wesley Longman; Amsterdam; 1 edition; 1995. 37. Reprint (2009).

[4] Christoph Höger. Modim - a modelica frontend with static analysis. In MATHMOD 2012 - 7th Vienna International Conference on Mathematical Modelling; 2012.

[5] Jan Köhnlein and Sven Efftinge. Xtext 2.1 documentation; October 31; 2011.

[6] Malte Lochau and Henning Günther. A static aspect language for modelica models. In Peter Fritzson; François E. Cellier; and David Broman; editors; EOOLT; volume 29 of Linköping Electronic Conference Proceedings; pages 47–57. Linköping University Electronic Press; 2008.

[7] Modelica Association. Modelica: A unified objectoriented language for physical systems modeling; language specification version 3.3; 2012.

[8] OMG. Meta Object Facility (MOF) Core Specification Version 2.0; 2006.

[9] Roland Samlaus; Claudio Hillmann; Birgit Demuth; and Martin Krebs. Towards a model driven modelica IDE. In 8th International Modelica Conference; 2011.

[10] Mirko Seifert and Roland Samlaus. Static Source Code Analysis using OCL. In Jordi Cabot and Pieter Van Gorp; editors; OCL’08; 2008.

[11] M. Strobel; R. Vorpahl; C. Hillmann; X. Gu; A. Zuga; and U. Wihlfahrt. The OnWind modelica library for offshore wind turbines – implementation and first results. In Proceedings of the Modelica Conference; 2011.

[12] Claas Wilke. Java code generation for dresden ocl2 for eclipse. Großer beleg (minor thesis); Technische Universität Dresden; Dresden; Germany; February 2009.

Citeringar i Crossref