AmesimKnowledge

Introduction

How does it work?

From the main Simcenter Amesim GUI, select Tools > Modelica Editor

Figure 1: Starting the Modelica Editor

This will then open a new window with the Modelica Editor. The main working area is along the right portion of the window. It contains four contextual views which can be selected via the lower tabs:

  • Text: This view shows the Modelica source code and includes features such as syntax highlighting, searching, code folding and type checking

  • Icon: This view shows the Modelica icon associated with this class and includes features such as inserting graphical objects and selecting color palettes. Note that this icon is separate from the Simcenter Amesim icon associated with a Modelica block in a .ame sketch.

  • Diagram: This view shows the graphical assembly of components in the class and includes features such as the Parameter view.

  • Documentation: This view shows the HTML documentation included in the class as well as some supplemental information about parameter declarations and inherited classes.

The first time you launch the Modelica Editor, the library tree is empty. To start using the editor, you can either load your own Modelica models or the standardized libraries we provide in the $ame/Modelica directory:

  • Modelica Standard Library 3.2.3 – MSL 3.2.3

  • Modelica Standard Library 4.0.0 – MSL 4.0.0

  • SimcenterAmesim – Only compatible with the MSL 3.2.3

  • SimcenterAmesim 1.1 – Only compatible with the MSL 4.0.0

Note

There are two types of Modelica library:

  • The structured libraries, in which the root directory contains a node, the file package.mo, and the represented hierarchical structure of the operating system is related to the Modelica structure of the library. To load the structured libraries, you must select the package.mo file.

  • The unstructured libraries represented by one .mo file in which all the Modelica structure is coded.

To load a standardized Modelica library provided with Simcenter Amesim, you can either use the Open button in the toolbar or go to File > Open and select the package.mo file in the root folder of the library you want to load. For example, for the MSL 4.0.0 library, you just have to open the MSL400 folder, and select the package.mo file in the Modelica folder. As mentioned above, the SimcenterAmesim 1.1 library which is our last update of our standardized library is only compatible with the MSL 4.0.0 library. Figure Figure 2 shows a view of the library tree that you should see after loading the MSL 4.0.0 and the SimcenterAmesim 1.1 libraries. You can see that the ModelicaServices and Complex packages are automatically loaded because they are the MSL dependencies for part of the library.

Figure 2: The Modelica Editor

Below the library tree window, there is another Simcenter Amesim models window containing as many Modelica packages as there are .ame packages open. Each .ame package contains the aliases of the Modelica components added to the Simcenter Amesim sketch. For example, if you were working with an unsaved .ame file named unnamed_system that contained two Modelica components with the aliases modelica_icon and modelica_icon_1, respectively, they would appear in the Modelica Editor library tree as shown in the figure below.

Figure 3: Association between Modelica components in a .ame file and their counterparts in the Modelica Editor's library tree

The main viewing portion of the Modelica Editor allows you to view/modify the Modelica source code, the graphical icon, the graphical assembly and the documentation of Modelica classes that are currently loaded. This view will remain empty until a class is selected. You can expand the nodes of the library tree with the triangle buttons to navigate through the libraries to find the Modelica class of interest. Double-clicking on a class (or selecting Open/Open in a new Tab from the contextual menu) will open it in the main view on the right side. For example, the model SimcenterAmesim.Demos.EngineAcyclism.FourCylinder is open in the figure below.

Figure 4: The Modelica Editor opened to an engine demo model

Modelica Editor is used to create, view and modify Modelica definitions. In order to use Modelica models in simulations, you must compile their definitions for the Simcenter Amesim simulation platform. To do so, simply right-click on a model name in the library tree and select Add to active Simcenter Amesim model. Then, the Modelica compiler will automatically add the selected Modelica model to the active Simcenter Amesim model in the main GUI (see below).

Figure 5: Adding engine demo model to active Simcenter Amesim model

Figure 6: The Modelica component in a .ame sketch

Once you have added the Modelica model to the Simcenter Amesim sketch, you can hover your mouse over the icon to get a preview:

Figure 7: Preview of the Modelica model

At this point, you can move to Submodel mode in Simcenter Amesim. The Modelica Compiler will be called to process the Modelica definitions involved. If you wish, you can open the Modelica view from the Edit > Show / Hide > Modelica menu option. This will allow you to see the status of the compilation. If compilation fails, a message appears in this window, inviting you to check the code in the Modelica Editor with the help of the warnings and errors raised by the compiler. The Modelica messages from the compiler are displayed in the Modelica Editor translation log window so that you can fix the issues more easily (see figure Figure 8).

Figure 8: Modelica log after submodel generation

Use the Warning/Errors tab to display errors and warning messages. If you have errors, you can click the hyperlinks raised by the compiler. This opens a new tab containing the dedicated classes in which there is an issue.

When the issues are fixed in the Modelica Editor, you can go back to Simcenter Amesim and right-click the Modelica block to synchronize the model. You can now switch to Simulation mode. This will trigger the compilation of the entire .ame circuit. You should save your .ame file now if you have not already done so. Upon successful compilation, you can run the model of interest, allowing you to easily create plots, and use other post-processing tools in your model (see figure Figure 9).

Figure 9: Modulo plot of engine torque

In the next section, we will describe the individual creation, compilation, and simulation steps in more detail.

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Modelica_Platform/xid1179676 · retrieved 2026-07-17