Modelica 3.2 Specification Released
From "Appendix E" of the 3.2 specification
Main Changes in Modelica 3.2
The following backward compatible extensions have been introduced with Modelica 3.2:
- Homotopy function for making it easier to solve initialization problems ("homotopy(actual, simple)" defines the actual and a simplified version of an expression. The solution might be obtained by first solving the model with the "simple" expression and then continuously transforming it to the "actual" expression. Benchmarks demonstrate that steady-state initialization becomes much more reliable, even without accurate initial guesses).
- Functions as formal inputs to functions (e.g. to pass an integrand function to a quadrature function).
- Overloaded operators have been refined:
- A new specialized class
operator recordis introduced with specialized typing rules (the type is identified by the class name; all other Modelica classes have a structural type system where the type is only defined by the public elements). Overloaded operators can only be defined inside an
operator record. This change fixes a flaw in Modelica 3.1, since the look-up of overloaded operators is performed by the record class name.
- Inheritance of an
operator recordis allowed if defined via a short class definition. This removes a restriction of operator overloading in Modelica 3.1, e.g., to define derived classes with units for the record elements, like deriving ComplexVoltage from Complex.
- New overloaded element ‘0’ in order that operator record classes can be used as flow variables in connectors.
- A new specialized class
- Unicode support in description strings, strings in annotations and in comments in order to improve Modelica, e.g., for Arabian, Asian or Indian users. Modelica files are UTF-8 encoded, and can start with the UTF-8 encoded byte order mark (0xef 0xbb 0xbf) to indicate that it may contain UTF-8 characters; this is treated as white-space in the grammar.
- Constants can once again be modified unless declared final, as this is already used in packages.
- Global name lookup has been introduced by starting a Modelica name with a "."
- New C-functions ModelicaVFormatMessage and ModelicaVFormatError, to simplify message formatting in external functions.
- Additional annotations allowing:
- Inclusion of C-header and object library files in packages and referencing them with URIs (new annotations IncludeDirectory, LibraryDirectory, and standardized platform names like win32; resolves ticket #297).
- Images in parameter dialogs (new annotation groupImage).
- Start and fixed attributes for variables in parameter dialogs (new annotation showStartAttribute).
- Access control for packages to protect intellectual property (new annotations Protection, and License).
The following changes in Modelica 3.2 are not backwards compatible to Modelica 3.1:
- The new built-in operator name
homotopy. In rare cases this might give name clashes in existing models.
- Records with overloaded operations must be declared as
operator recordinstead of as
record. This is uncritical because tools that already support operator overloading will support the Modelica 3.1 form still for some time.