The Modelica platform in detail > Creating Modelica models
Creating a new Modelica model
The main idea here is that you will create your Modelica model in a .mo file first, then send it over to Simcenter Amesim for translation afterwards. The first step in creating a new Modelica model with this workflow is to create the Modelica library. You will do so by creating a new Modelica package to store your library in, then add a new model to it. To begin, open the Modelica Editor’s New class dialog via the button or the Ctrl+N keyboard shortcut. The dialog is described in more detail in the Modelica Editor manual. For this step, fill in the dialog as shown in Figure 12 . Note that we have chosen to keep Structured class unchecked. This means that our Modelica package will all be stored in the same .mo file instead of within a hierarchical folder structure. Because our library will not be complex or contain many subpackages, storing it all in one file makes the most sense.
Figure 10: Using the new class dialog to create a root level Modelica package
After you click OK, a new root level class will appear in the Modelica Editor’s library tree (see Figure 19). Note that it has a * mark preceding the class name to indicate that this class contains unsaved modifications. Click the Save button and the dialog will prompt you to store this Modelica model as a .mo file. Select the desired folder and file name. It is recommended that you use the default file name proposed, since Modelica conventions typically match the file name and root level package name for stand-alone packages.
Figure 11: Library tree for the newly created MyLibrary package
You have now created a Modelica package on disk and can add some content to that library. Create a new model class within the library by right-clicking on MyLibrary within the library tree and selecting New…. This will bring up the New class dialog again, which you can fill out as shown in Figure 12 .
Figure 12: Using the new class dialog to create a model within the MyLibrary package
At this point, the new IntegratorModel class should be active in the main view (right side of the Modelica Editor). Switch to Text view and type in the code shown in the figure below. Note that the class name (IntegratorModel) and description (Simple integrator model) on line 1 as well as the closing end IntegratorModel on line 9 were pre-filled when the class was created through the New Class dialog. You only need to add the contents of the model on lines 2 through 8.
Figure 13: Text view of the IntegratorModel class
Your Modelica library now contains a valid model that can be compiled and simulated, as will be described in the Translating Modelica models section.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Modelica_Platform/xid1196312 · retrieved 2026-07-17