Creating Inner and Outer Models for Context Behavior

You can create an inner model that is applied to outer models.

An inner model is used to create a global context for a logical model, provided that:

  • the inner model is stored in a Context behavior (inserted in a logical component)
  • the outer models are stored in Dymola behaviors (inserted in the logical subcomponents)
  • the inner and outer models share the same name.

There must be at least one corresponding inner model for an outer model reference.

Note that from the Modelica Standard Library, you can also use predefined:

  • inner models: for example, the World component from Modelica.Mechanics.Multibody.
  • outer models: all the components contained in Modelica.Mechanics.Multibody (except World) are outer models.


Before you begin: You can define an inner type to any model in a library representation or in a logical behavior.

However, for the purpose of this scenario, you must insert a Context behavior in a logical component in the Functional & Logical Design app.

  1. Activate the Context model.
  2. From the Behavior Authoring section of the action bar, click New Modelica Class .
  3. Enter a name for you model, Global for example.

    Warning: The same name must be used for the inner model and for the associated outer models.

  4. Select Model as the class type.
  5. Click OK to finish your creation and exit the New Class dialog box.
  6. Instantiate your new Global model in the Context behavior.
  7. Select the model from the Component Browser or from the diagram layer.
    The context toolbar appears.
  8. Select Edit Parameters from the context toolbar.
    The Component Parameters Edition dialog box appears.
  9. From the Attributes tab, in the Dynamic Typing area, select Inner.

    Tip: To create an outer model, select the Outer option from the Dynamic Typing area.

  10. Click OK to validate your parameters modification and close the Component Parameters Edition dialog box.
    The Global model is now an inner behavior.