Global Relations Editor

Navigation:  Editor > Global Relations Editor >

Global Relations Editor

Previous pageReturn to chapter overviewNext page

The Global Relations Editor is used to restrict the scope of global parameters and variables. You can find the Global Relations Editor at the lower left of the Editor by selecting the Globals tab.

1.In the Editor, go to the Model Hierarchy at the left and select the submodel, you want to add global parameters or variables for.
2.Select the Globals tab at the lower left of the Editor.

GlobalsTab

Select the Globals tab, put your mouse pointer on top and click Edit Global Relations.

3.Put your mouse pointer in the middle of the tab. From the right mouse menu select Edit Global Relations.

This will open the Global Relations Editor. You can use this editor to enter parameters, variables and equations.

GlobalRelationsEditor

Use the Global Relations Editor to enter parameters, variables and equations.

You can enter parameters, variables and equations here just like in the Equations Editor. The parameters and variables will only be useful if they are used in submodels lower in the hierarchy as globals.

Example

The best way to describe the use of the Global Relations Editor is by an example model. You can find this model in the 20-sim demonstration library (Demo\Tips And Tricks\Global Parameters and Variables for submodels.emx). This model shows two mass-spring-dampers with shared parameters and variables.

1.In the Editor, go to the Model Hierarchy at the left and select the submodel MassSpringDamper1.
2.Select the Globals tab at the lower left of the Editor.
3.Put your mouse pointer in the middle of the tab. From the right mouse menu select Edit Global Relations.
 

Now you will see the Global Relations Editor, as shown in the previous figure. Three parameters are defined: f, m and b. The parameter m is use in the submodel Mass lower in the hierarchy. The variable k is used in the submodel Spring lower in the hierarchy. The parameter d is use in the submodel Damper lower in the hierarchy.

4.Now open the Parameters Editor.

ParametersEditorScope

Parameters that are shared can be set at the top model.

You will see that it contains the parameters f, m and b at the level of the model MassSpringDamper1. This allows us to duplicate this model and use a second mass-spring-damper model with different parameters.