Skip to content. Skip to navigation

Modeling of Complex Physical Systems

Sections
Personal tools
You are here: Home Modelica 3.0 Specification Released
Document Actions

Modelica 3.0 Specification Released

by Martin Otter last modified 2007-09-10 05:38 PM


The Modelica language 3.0 specification text is available in the documents page or directly here in pdf format.

Picture taken at the Modelica design meeting in Lund, Sept. 5, 2007, just after Modelica 3.0 was released and before the celebration.

From the "Preface" of the 3.0 specification

[...] The Modelica language has been developed since 1996. This is the third main release. With the previous Modelica release (2.2) the practical limit for Modelica models is around several 100000 equations. Modelica 3.0 introduces nearly no new features, but redesigns the “kernel” by the introduction of mild restrictions. The main purpose is to provide a “cleaned-up” version so that the practical limit on the model size is increased by an order of magnitude. All previous eight Modelica releases have been backwards compatible. Modelica 3.0 is the first version that is slightly non-backwards compatible to the previous version, but an automated conversion is possible. The main new features of Modelica 3.0 are:

  • The new concept of “balanced models” is introduced, which basically means that on every level the “number of equations” and the “number of unknowns” must be identical. As a result, when components pass a Modelica translator successfully, it is guaranteed that the system model consisting of such components has always the property that the “number of equations” of the global model is identical to the “number of all unknowns”. In previous versions this was not the case and modelers had often a hard time to figure out the source of a modeling error, if the global count of equations and unknowns did not match. The feature of balanced models also allows compiling model components separately.
  • The type system, or equivalently the concept of interface of components and classes, has been redesigned and defined more precisely. As a result, if a replaceable component is redeclared (i.e., a component from a class A is replaced by a component of a class B), it is guaranteed that the redeclared component again leads to a balanced model and that no language error can occur by this redeclaration. Previously, a redeclaration could lead to a wrong model and it could be difficult to figure out the source of the error. It is, however, still possible, e.g., that the simulation of the redeclared model fails, because the model becomes numerically singular due to the redeclaration (e.g. due to too idealized model).

  • The graphical annotations that define the graphical layout of components and of component connections (= schematic) have been redesigned, based on practical experience with the Modelica 2 graphical annotations. Also, new graphical annotations have been introduced, e.g. to have Bezier-Splines as line style and annotations for schematic animations and for interactive user input.

  • The Modelica specification text was largely re-structured, completely new written and improved in many ways, e.g., more meaningful examples, fixing flaws in the language, and defining language elements more precisely.

From "Appendix D" of the 3.0 specification

Main Changes in Modelica 3.0

Modelica 3.0 is a “clean-up” version of the Modelica language. For example, the specification is newly written to define the language in a better way, errors in the language are fixed, unclear or undefined items are more precisely described, and mild restrictions are introduced into the language in order that a Modelica translator can much earlier and more precisely detect modeling errors. Automated conversion of models to Modelica 3.0 is possible. Furthermore, a tool can potentially handle much larger models.

This Modelica version is for the first time (slightly) not backward compatible to previous versions (all previous versions have been backward compatible with exception of tiny issues as newly introduced keywords). As a result, e.g., “unsafe” models of previous Modelica versions are no longer valid. It is expected that Modelica tool vendors provide (semi-) automatic mechanisms for conversion of models and libraries.

The following main changes in Modelica 3.0 are not backwards compatible:

  • Restrictions to connectors (see Section ‎9.3): For each non-partial connector class the number of flow variables shall be equal to the number of variables that are neither parameter, constant, input, output, nor flow. For example, the following connector is illegal in Modelica 3:

connector notValid // illegal connector
Real r1;
Real r2;
flow Real r3;
end notValid;

  • In a non-partial model or block, all non-connector inputs of model or block components must have binding equations.
  • A component declared with the inner or outer prefix shall not be of a class having top-level public connectors containing inputs.
  • Modifiers for components shall only contain redeclarations of replaceable elements and binding equations for parameters, constants, inputs and variables having a default binding equation.
  • All non-partial model and block classes must be locally balanced (see Section ‎4.7). This means that the local number of unknowns equals the local equation size. Together with other restrictions, this leads to the strong property that a simulation model is always globally balanced (i.e., the number of unknowns is equal to the number of equations).
  • Prefixes input, output, inner, outer, flow are not allowed in a record
  • The built-in operators “abs(...)” and “sign(...)” do no longer generate events but are implicitly defined with a noEvent(...) operator.
  • The constraining clause of a replaceable class or component is changed from keyword extends to the new keyword constrainedby (since the extends keyword could lead to the wrong impression that the redeclared model must inherit from the constraining class, but this is not the case).

The following changes in the Modelica 3.0 graphical annotations are also not backwards compatible:

  • Changed the definition of icon placement (record Transformation), so that the actual coordinates of the icon of a model instance are defined in the class where the instance is defined and no longer in the class where the icon is defined (this was a flaw in the Modelica 2.0 graphical annotations).
  • Improved the definition of the rotation of a graphical primitive.
  • Change fontSize unit from DrawingUnit to pt (since this is the usual unit for fonts).

The following main changes in Modelica 3.0 are backwards compatible:

  • New element-wise operators: .+, .-, .*, ./, .^.
  • A third argument AssertionLevel to built-in function assert(...) in order that warnings can optionally be defined.
  • New annotations section ‎14.1 “Vendor-Specific Annotations”:
    In this section it is precisely defined how vendor-specific annotations should be marked. Any tool shall save files with all standard annotations (defined in ‎Chapter 14) and all vendor-specific annotations intact. The advantage is that a typo in non-vendor annotations can now be detected and marked as an error, whereas in previous versions this had to be ignored.
  • New annotation in section ‎14.2 “Annotations for Documentation”:
    preferredView = info, diagram or text
  • New annotations section ‎14.3 “Annotations for Code Generation”:
    Evaluate, HideResult, Inline, LateInline, smoothOrder
  • New annotation section ‎14.4 “Annotations for Simulation Experiments”:
    StartTime, StopTime, Tolerance to define important parameters of an experiment setup.
  • New annotations for graphical annotations in section‎14.5:
    New attribute Smooth = enumeration(None, Bezier) for graphical objects and connection lines (Bezier defines a Bezier spline).
    New attribute visible in record Placement allows to make a graphical annotation invisible (e.g. after inheritance).
    New attributes startAngle, endAngle in record ellipse to define part of an ellipse.
    New layer specific annotations IconMap and DiagramMap for extends.
    New attribute horizontalAlignment to the Text record to define the horizontal alignment of text.
  • New annotations for schematic animation and interactive user input in section ‎14.5:
    DynamicSelect(..) to modify annotation literals by the actual values of variables.
    OnMouseDownSetBoolean, OnMouseUpSetBoolean, OnMouseMoveXSetReal, OnMouseMoveYSetReal, OnMouseDownEditReal, OnMouseDownEditString to interactively set the variable of a class during simulation.

The following errors have been fixed in the Modelica specification:

  • Syntax rule for a function call (e.g., according to the grammar in Modelica 2.2 a function call of the form Modelica.Math.Matrices.eig(...) was invalid because the function name could not have “.”. However, all Modelica tools supported the desired “full Modelica name” also for function calls).

Contributors to the Modelica Language, Version 3.0

The Modelica 3.0 specification was newly structured and written by Peter Fritzson using text from the previous specification and also adding new explanatory text. This draft specification was afterwards improved by members of the Modelica Association.

The concept of “balanced models” (which is the major change of the language) was developed by Hans Olsson with contributions from Martin Otter, Hilding Elmqvist, and Sven Erik Mattsson.

The graphical annotations have been redesigned and improved by Daniel Hedberg, Erik Areskog, Dag Brück, and Hilding Elmqvist with contributions from Peter Aronsson and Gerd Kurzbach.

The following members of the Modelica Association participated at design meetings and contributed to the Modelica 3.0 specification:

Peter Aronsson, MathCore AB, Linköping, Sweden
Bernhard Bachmann , University of Applied Sciences, Bielefeld, Germany

John Batteh, Ford Motor Company, Dearborn, MI, U.S.A.

David Broman, Linköping University, Linköping, Sweden

Peter Bunus, Linköping University, Linköping, Sweden

Dag Brück, Dynasim, Lund, Sweden

Francesco Casella, Politecnico di Milano, Milano, Italy

Christoph Clauß, Fraunhofer Institute for Integrated Circuits, Dresden, Germany

Thomas Doumenc, Dassault Systèmes, Paris, France

Jonas Eborn, Modelon AB, Lund, Sweden

Hilding Elmqvist, Dynasim, Lund, Sweden

Rüdiger Franke, ABB Corporate Research, Ladenburg, Germany

Peter Fritzson, Linköping University, Sweden

Sebastien Furic, Imagine, Roanne, France

Anton Haumer, Technical Consulting & Electrical Engineering, St.Andrae-Woerdern, Austria

Daniel Hedberg, MathCore AB, Linköping, Sweden

Carsten Heinrich, Institut für Luft- und Kältetechnik gGmbH, Dresden, Germany

Olof Johansson, Linköping University, Linköping, Sweden

Christian Kral, arsenal research, Vienna, Austria

Roland Kossel, TLK Thermo GmbH, Braunschweig, Germany

Gerd Kurzbach, ITI GmbH, Dresden, Germany

Christian Kral, arsenal research, Vienna, Austria

Kilian Link, Siemens AB, Erlangen, Germany

José Diaz Lopez, Dynasim AB, Lund, Sweden

Karin Lund, Fachhochschule Ulm, Germany

Håkan Lundvall, Linköping University, Linköping, Sweden

Ludwig Marvan, VA TECH ELIN EBG Elektronik GmbH & Co, Vienna, Austria

Sven Erik Mattsson, Dynasim, Lund, Sweden

Jakob Mauss, Qtronic GmbH, Berlin, Germany

Chuck Newman, Ford Motor Company, Dearborn, MI, U.S.A.

Kaj Nyström, Linköping University, Linköping, Sweden

Hans Olsson, Dynasim, Lund, Sweden

Martin Otter, German Aerospace Center, Oberpfaffenhofen, Germany

Markus Plainer, Arsenal Research, Vienna, Austria

Adrian Pop, Linköping University, Linköping, Sweden

Katrin Prölß, Technical University Hamburg-Harburg, Germany

Christoph Richter, Technical University of Braunschweig, Braunschweig, Germany

Anders Sandholm, Linköping University, Linköping, Sweden

Christian Schweiger, German Aerospace Center, Oberpfaffenhofen, Germany

Michael Tiller, Ford Motor Company/Emmeskay, Dearborn, MI, U.S.A

Hubertus Tummescheit, Modelon AB, Lund, Sweden

Hans-Jürg Wiesmann, ABB Switzerland Ltd.,Corporate Research, Baden, Switzerland


Powered by Plone CMS, the Open Source Content Management System