Implementations

Navigation:  Editor > Using Models >

Implementations

Previous pageReturn to chapter overviewNext page

A model may have various implementations. It means that you can combine several versions of a submodel and store them in one block. If you drag and drop a submodel with implementations, 20-sim will ask which one to use.

Using Implementation

A fine example of a model with various implementations is the model MachineDynamics.emx from the Examples\1D mechanics library. This example model has several submodels with implementations:

 

SpringDampers: frameflex and motorflex
SignalGenerator-Sweep: sweep

 

You can see this in the Model browser at the left of the Editor. The models with implementations have show the implementation that is currently selected between brackets.

Implementations

The selected implementation is shown between brackets in the Model Browser.

 

You can change the implementation:

1.Select the submodel.
2.From the right mouse menu choose Edit Implementation and select the implementation that you want to change.
3.Make the changes that you want in the submodel.
4.Store the submodel using the Save Submodel command of the File menu.

Inserting Submodels with Implementations

When you drag and drop a model with implementation into the Graphical Editor you will be asked which implementation to use. In the Model browser, the chosen implementation is shown between brackets (Default and ZeroMean in the picture above). If you hover the mouse above a submodel with an implementation, you also see the chosen implementation between brackets.

Building Submodels with Implementations

You can make submodels with implementations yourself:

1.Select a submodel.
2.From the right mouse menu choose Edit Implementation and Add New.
3.Enter the name of the implementation and click OK.
4.Store the submodel using the Save Submodel command of the File menu.

Changing Implementations

If you change one of the implementations, the other implementations will not be affected. This may sometimes be annoying. You can circumvent this by:

Updating the Interfaces

1.Select a submodel with an implementation.
2.From the right mouse menu choose Edit Implementation and Update Interfaces.

This will make the interfaces of all implementations equal to the current one.

Updating the Icons

3.Select a submodel with an implementation.
4.From the right mouse menu choose Edit Implementation and Update Icons.

This will make the icons of all implementations equal to the current one.