About Modelica Classes

Modelica is the language used to define dynamic behaviors. In the Modelica language, the basic structuring element is called a class.

Classes appear in the main Package Browser, under a behavior library or a functional or logical behavior.

Classes can also appear in additional browsers, for more information about the alternatives see About Tools for Managing Classes.

This page discusses:

Class Types

A class is given a predefined type.

  • Package: such class is used to structure the hierarchy of a behavior library or functional or logical behavior
  • Model: such class is used to contain components
  • Component: such class defines the parameters and variables of the behavior
  • Connector: such class allows linking components together
  • Function
  • Record
  • Block
  • Type: defining a class of type Type without extends means defining an enumeration type

Class Storage

A class is inserted in a behavior representation (either behavior library or functional or logical behavior). However, they can be stored in another behavior representation (within the database).

Class Instantiation

Classes are instantiated to create components and connectors. They appear in the Component Browser.

Protected Class

Protected classes cannot be accessed from outside its parent package.

To protect a class, you must edit its attributes and check the Properties option.

Note: You can select if protected classes should be displayed in the Package Browser or not, by activating the preference Hide protected classes from Me > Preferences > App Preferences > 3D Modeling > Systems Modeling and Execution > Dymola Behavior Modeling , the Editor tab.