Modelica 3.1 Specification Released
The Modelica language 3.1 specification was released on May 27, 2009 (picture 1 and picture 2).
The specification text is
available in the documents
page or directly here
in pdf format.
From "Appendix D" of the 3.1 specification
Main Changes in Modelica 3.1
The following backward compatible extensions have been introduced with Modelica 3.1:
- Overloading of operators like "+" or "*" to allow convenient usage of user-defined data structures like complex numbers, polynomials, transfer functions. Usually, only scalar operations for one data type need to be overloaded. All other needed operations, like operations between different data types or on arrays of the new data type, can be automatically constructed by the tool.
- Stream connector concept to ensure efficient and reliable simulation of fluid systems.
- Partitioning models in parts and mapping these parts to execution environments. This allows convenient definition of, e.g., Model-in-the-Loop, Software-in-the-Loop, Hardware-in-the-Loop Simulation, from the same "logical" system, by inheriting from the logical system and setting configuration options.
- Arrays in buses (expandable connector) are much better supported. Furthermore, variables declared in an expandable connector need not to be referenced in the model and are then not available in the simulation model.
- The order of classes stored in separate files can be given.
- A restriction of balanced models was removed, so that modifiers to connector and record instances can be used and are considered for the equation count. This allows, e.g., a much easier implementation of the support connector of the Modelica.Mechanics.Rotational/Translational libraries.
- A tool that uses missingInnerMessage to give information may also automatically use the corresponding inner-component.
- URIs can be used for links in html-documentation and for the Bitmap annotation (such as: "modelica://Modelica.Mechanics/C.jpg" for image "C.jpg" that is stored in the directory of package Modelica.Mechanics). This allows to store resources in a package on persistent storage and to reference resources via package and resource names.
- Annotation "connectorSizing" to automatically enlarge a vector of connectors and connect to a free element of this vector when a connection line is drawn. This allows to improve the user convenience, especially for state machine and fluid models.
- Annotation "inverse" to define inverses of functions. This allows a tool to solve non-linear algebraic loops by using the user-provided inverse function.
- Annotations "versionDate", "versionBuild", "dateModified", "revisionId" to improve version handling. For example, this allows handling of maintenance (bug-fix) releases and gives a library developer the possibility to state that a particular "build" is needed for a used library.
The following defects have been fixed in the Modelica specification:
- Modifier with subscripts were previously allowed, but not clearly defined, not implemented in many tools, and not used in libraries. They were thus removed.
- Modelica keywords updated.
-
Clarification: Exponentiation
and array range operator are non-associative
(x^y^z or a:b:c:d:e:f are not allowed; parentheses are required) - Clarification: Restrictions on combining base classes.
- Clarification: Execution of an algorithm.
- The default type for arrays sent to external functions has been clarified.
- The "iconTransformation" defaults to the (diagram) "transformation", as was originally the intention.
- The Connection set section was rewritten:
- Connection set is clearly defined including examples.
- The handling of connections involving outer components was rewritten to ensure that models that seem to have the same connection structure generate the same equations from the connect statements. Previously a connection between an outer component and an outside connector would move the connection upwards. The implication of this movement was unclear: if it turned the connector into an inside connector (as was likely the intention) it would prohibit default-connection of this normal connector leading to counter-intuitive results; and otherwise it would have no impact.
- Example of using fields was corrected.
- Example with MatrixGain was corrected.
- Ambiguous annotations after external-declarations were corrected (as already used).
- The reinit-operator can be used multiple times in one algorithm, and the semantics clarified.
- Made clearer that acyclic parameters also hold for one parameter equation.
- Changed in the text "attributes" to "prefix", if a prefix is meant.
The following changes in Modelica 3.1 are not backwards compatible:
- A class-level annotation can only be placed before the end-statement. This is uncritical because tools can easily fix incorrect models (ignore this new rule when reading a model and use this rule when storing the model).
- New Modelica keywords "stream" and "operator", a new built-in package "Subtask" and new-built-in operators "inStream" and "actualStream" have been introduced. In rare cases this might give name clashes in existing models.
- Modifiers on declared variables in expandable connectors are no longer allowed. This should be uncritical, because expandable connectors are usually used for signal buses where the signal is communicated to the bus from a block with a connect statement.