Model
Open a model🔗
A model definition is the most generic type of definition in Modelica.
Open a model to display it in the model canvas.
- A model opened from a workspace can be edited.
- A model opened from a library needs to be duplicated or extended in order to be edited.
- Open a library or a workspace.
- Double-click on model.
- The model opens in the canvas.
Modelon Impact displays the name of the open model in the browser tab. This helps to identify open models across multiple tabs.
Create a new model🔗
Create an empty model from Library browser.
-
Create a new class with the
button at the top right of the Workspace panel on the left side of the browser.
-
Give the new class a name and specify the class type Model.
-
Select the package where you would like to store the model.
Create an empty model from the start page.
- Create a new model by double clicking on the empty model on the start page.
Create a new package🔗
A package is a directory used to structure up components and models and other Modelica entities.
-
Create a new class with the
button at the top right of the Workspace panel on the left side of the browser.
-
Give the new class a name and specify the class type Package.
-
Select the package where you would like to store the package.
Alternative
- Right click on the required package in the library browser.
- Use the context menu selection New Package to insert a package into an existing package.
Create a class🔗
-
Create a new class with the
button at the top right of the Workspace panel on the left side of the browser.
-
Give the new class a name and specify the class type listed below:
- Model A class or sytem of equations that has an undefined input and output
- Package A grouping of classes (models, records, etc.)
- Block A class or model that has defined inputs and outputs
- Record Typically a class that contains constants or other parameter values, it is not allowed to have equations
- Connector A class used to define a connector
- Expandable Connector A class used to define an expandable connector
- Function A class used to define a function
- Type A class used to define a type
- Select the package where you would like to store the class.
Instantiate🔗
An instance of a class is created when component or model is placed into the Model Canvas.
-
Add components to a model by dragging components from the library browser into the model canvas. Click with left mouse button and drop a component in the Model Canvas.
-
Any change in a component will be added as a modifier. These changes will not impact the class from where the model is instantiated.
Duplicate🔗
To duplicate a model is to copy it and make a library model editable.
- Right-click on a model in a library or workspace.
- Choose duplicate.
- Set appropriate name and save into defined workspace.
- Any changes to the model, over-writes the previous model.
- To keep track of changes and model versions, duplicate the model, apply a name showing the revision before applying changes.
This action must be followed by saving it into the workspace. The model now belongs the user and can be edited.
When duplicating a model
When duplicating a model, the new model will only keep a cached FMU if it is duplicated into a structured library not a library saved as a single .mo file.
Extend🔗
Extending a model establishes an inheritance to the parent model.
- Right-click on a model in a library or workspace.
- Choose extend.
- Set appropriate name and save into defined workspace.
- Any changes to the original model are inherited by the extended model.
- To keep track of changes and model versions, duplicate the model, apply a name showing the revision before applying changes.
Extending a model means that changes to the parent model will automatically be inherited by the extended model.
Note
It is not possible to extend multiple classes. It can be done in the code editor but not when creating a model.
Redeclare a component🔗
Replacing a component with a compatible component is referred to as redeclaring the component model. Components that can be redeclared are said to be replaceable. They are shown with dashed line borders as seen below.
A component can be redeclared by either:
-
Drag a class from the library browser and drop it on the class that you would like to redeclare.
-
Select the desired component from a drop-down list of choices in the Model browser in the details panel.
-
Any parameters that have been modified in the model canvas will be retained in the redeclaration unless the new class does not have an exact match for that parameter.
-
A component can be redeclared only if the model is copied (duplicated) into a workspace.
Inspect component🔗
Inspect components opens the component in the context of the surrounding system model. Parameters applied to the component are reflected in the view.
-
Select a component.
-
Right-click on it and choose Inspect component or Inpsect component in new tab from the pop-up menu.
-
When inspecting components inside a model, a hierarchical path is shown with clickable links at the top of the canvas view.
Scale and rotate components🔗
A components in the canvas can be moved or rotated.
-
Select a component in the Model Canvas.
-
A dotted square box will be shown around the component with a handle that has two arrows on it.
-
Use the handle to rotate the components.
-
To scale the component, drag any one of the small open boxes on the perimeter outline of the component.
-
Use Keyboard shortcuts to effectively work with the components.
Connect components🔗
Components in the model canvas are connected to each other to replicate the actual system diagram.
-
Drag a connection line from one element connector to another.
-
Compatible connectors are highlighted when dragging the connector.
-
Holding Shift while making a connection brings up a dialog showing possible more advanced configurations. This is useful when connecting to hierarchical or expandable connectors.
-
Shape of the connection-line is altered by dragging at either the straight portion or the corner points of the connection line.
Rename components🔗
All components are given a default name when dragged to a canvas. The default name is the name of the class in the package or library it is taken from. The second time the same class is brought into the canvas, a number will be appended to it (e.g. Integrator, Integrator2, ... ,Integrator6).
- Select a component in the model canvas and change the name in the Control panel as shown below.
Rename components
-
Confirm the name by pressing ENTER.
-
The default parameters of the component model may be changed once it is placed into the model canvas.
Edit model parameters🔗
Library models in the global libraries are not editable. To be able to edit a model from a library, it needs to be duplicated, that is, copied to a workspace package.
Parameter components determines the size and characteristics of the components.
-
When a model is opened, the top-level model parameters and variables are shown in the model browser. Component parameters are shown by selecting the component on the model canvas. If multiple components are selected, only parameters and variables found in all of the selected components will be shown.
-
Change the value of a parameter by entering the desired value into the corresponding input box and press ENTER.
-
A model or component has to be in the workspace to allow editing.
-
The parameter must be free to be edited (i.e. not be locked by a final attribute).
Note
Matrices and vectors are shown as a table if they have 3 columns or less. Boolean parameters are shown as check boxes.
Edit top level parameters🔗
Top level parameters can be edited by directly right-clicking the variable from the Variable Browser and select Edit Variable.
This will open the Edit Variable dialog box, through which the required modifications can be made.
Import data from Excel in parameters🔗
Impact supports direct insertion of data from Excel when in modeling mode of the model.
This is a simple way to parameterize vectors or matrices by given data via the input field of parameters ands variables in the Properties panel.
- Open a spreadsheet in Excel (CSV or XLSX), which contains your numerical data
- Select the area that represents the matrix (2d table) or vector (row)
- Copy
- Paste it into the empty input field
Impact will automatically convert the clipboard data into Modelica-compliant code.
This functionality supports: vectors [:]
(rows), 2D matrices [:,:]
(tables) or scalar values (single cell content).
Thereby the size
of each dimension is not limited, but note, pasting very large amounts of data affects performance.
Copy Excel data, paste into model parameter
Note
- The copy of a column of data will be transformed into a matrix of dimension
[:,1]
- The copy of a row of data will be transformed into a vector of dimension
[:]
- If you only copy the content of a single cell, then the content can be pasted anywhere (even in the code editor)
The current version of Impact has the following restrictions:
- Make sure that the source data contains a *dot as decimal separator and *commas as thousands separator
- Make sure that all cell data in the source have the same data type (
Real
orInteger
(subset of Real)). Do not mix, as it is not allowed in Modelica - All cells within a selection must contain data (empty cells would break the Modelica array)
- Make sure not to copy table headers or similar items
- Pasting
Strings
,Booleans
, or mathematical expressions likex+4
is not supported
Attributes🔗
The attributes for a particular variable or parameter are accessed using the button.
The attributes can be used in stickies and marked as favorites just like any other parameter or variable.
Edit source code🔗
Modelica source code can be edited for models in your workspace by toggling the Code view.
Modelon Impact uses Modelica as modeling language. When building or modifying a model, the information will be stored as Modelica code. This code can be reviewed and edited in the source code viewer.
- Toggle between Code and Diagram view via the drop-down menu in upper toolbar.
- Components placed on the canvas cannot be edited. Users must open the class specifying the component on the canvas first using Open class.
Note
Editing the source code can affect the model in ways that are not easily fixed through the Modelon Impact UI.
Start from a template🔗
Templates in libraries allows the user to start building the model from a pre-defined, connected, workable structure.
-
Identify the relevant template in the library folder.
-
Right-click and extend the template. A new window will pop up.
-
Write the name for the model to be built. Click on extend to open the model.
-
Double click on each component to open up the window on the right to define type of component and set parameters.
-
If a template is opened and not extended, the various components will be locked for any changes.
Create a model from templates🔗
A template of a model lets the user choose the specific component to place into a defined model.
- Create a templates.json file.
templates-json file format graphic
Variable definitions
Keyword | Description |
---|---|
className | Defines the path of the model to be considered as a template |
displayName | Defines the default name of the template |
category | Defines the category of the template |
mode | Defines the mode of creating the model by extending/duplicating |
The file must be placed in Resources > WAMS directory of the required workspace under Users > Impact.
Modelon Impact on-premise🔗
- Sample path to place the file is
<storage>/impact/workspaces/Temp/model_libraries/editable/Workspace/Resources/WAMS
, where<storage>
is the persistent volume/storage used for Impact
Modelon Impact Desktop🔗
-
Sample path to place the file is
C:\Users\Dell\impact\workspaces\Temp\model_libraries\editable\Workspace\Resources\WAMS
-
A model can be created from the template by clicking
button at the top right of the Workspace panel on the left side of the browser.
Create model from template graphic
- Give the required name and package and click Create.
Create favorite parameters & variables🔗
Marking parameters or variables as favorites makes it possible to quickly find them using the filter options.
- Click the
icon next to the desired variable (shown when hovering) under the Properties tab in the details panel.
- Enable the Favorites filter by clicking
in the Properties tab. Clicking on the Favorites button diplays the favorite parameters and variables marked by an orange dot.
Favorites dialog
Save experiments set-up back to model🔗
Saving an experiment setup back to the model modifies the underlying modelica code of the model to reflect the selected experiment. This function allows improving model fidelity after running experiments.
- Create experiment to test parameters.
- Click on details panel.
- Go to Experimentation section.
- Right click on experiment to expose Apply to model. This means the experiment will be applied to corresponding component parameters. The command Apply to model works for Dynamic state.
- Apply to new model duplicates the model and applies the experiment. This maintains the original model. The command alters the Modelica code that defines the model.
Filtering parameters or variables🔗
To find specific parameters or variables in large models, the content of the model browser can be filtered.
The first way to filter is to click on a desired component on the model canvas. Only the parameters and variables associated with the selected components appear in the model browser.
In order to filter further, click on the button. This allows several types of filtering as detailed below.
Filter using Categories🔗
The top row buttons are all additive, meaning each category can be enabled and disabled individually. By default, parameters and results are enabled. The components button will enable sub components of the model to be shown in the model browser without the need to select them in the model canvas. The bottom row is subtractive meaning that each will filter out only that specific category, e.g. clicking Favorites will show only variables marked as favorites.
Filter using Categories
Filter using Free text🔗
The free text filter can be used to filter out variables or components by name. Text filtering allows the use of the wildcard *
and ?
to replace respectively any chain of or single character. For example, filtering *y.?
might provide summary.p
and y.t
but not summary.Y_fuel
(as the ?
wildcard only replaces a single character).
Note
The filter icon changes its color whenever filtering is active.
Filter using Types🔗
The button next to the free text filter expands the type filter selector.
This allows you to filter on a specific type, such as Angle to show only variables of that type.
Filter using Types
Filtering simulation outputs🔗
It is possible to specify Modelon Impact to only store a filtered set of variables during simulation. The result file could thus be reduced in size only to the relevant variables. Output filtering is an experiment specific option:
- Switch to the
Experiment
mode. - Select an experiment or create a new experiment.
- Click on
Outputs
- Click on
+ New filter
- Filter by either:
Text
: similar to filtering parameters or variables using free textView
: if you have views created in this model, you can filter so that only the variables relevant to this view are stored.
- Add more filters if desired. These are additive.
Filter simulation outputs