Importing and using FMU > Simple examples
Import of an FMU for Model Exchange
The test case RC.fmu provided in the tutorial/FMU subdirectory of Simcenter Amesim is an FMU for Model Exchange of a very simple linear first-order R-C electrical system. Its circuit schematics and equations are represented in the figure below.
The supplied voltage u is an input of the model whereas the voltage y across the capacitor is an output. There are two parameters called R and C associated to the corresponding elements of the circuit. The model has only one state variable called q, which is the electrical charge in the capacitor. There is also one internal variable called i, the current flowing through the circuit.
Step One
It is easier to place the FMU in the directory where the associated Simcenter Amesim import submodel is to be created (e.g. here: C:\imported).
Procedure
Pull-down the Interfaces > FMU import assistant... command.
This opens the first step of the FMU Import Assistant FMU Import Assistant – choosing the FMU to import (see below): Figure 14: The FMU Import Assistant
Click the … button next to the FMU field to select the RC.fmu file (see below):
Figure 15: Selecting the FMU to be imported
In the Submodel storage directory submodel storage directory field, enter the path to the directory where the import submodel is to be created, e.g. C:\imported. Uncheck the Submodel name checkbox to let the assistant automatically choose a name for the submodel (see below), and click the Next button.
Figure 16: The first step of the import assistant
Step Two
The second step of the FMU Import Assistant deals with the import settings import settings (see below):
Figure 17: The second step of the import assistant
At this step, the compiler used to build the submodel has to be chosen according to the compiler selected in Simcenter Amesim to build the model which uses the import submodel. The two compilers have to be chosen consistently.
You can safely ignore the “Preferred simulation type” radio button, since it is only relevant to mixed-type FMUs, i.e. FMUs that have both the Model Exchange and Co-simulation interfaces.
Click the Generate button to proceed to the next step of the assistant.
Step Three
This is the last step of the assistant (see below).
Figure 18: The last step of the import assistant
At this step, a new Simcenter Amesim library node is created in the current directory, containing an import submodel called MEIMPRC (made of a SPE description file and a C source file) which is automatically compiled using the AMEcc_RELEASE script.
The library contains an icon called RC which was automatically created by the Import Tool. This is a default icon for the FMU component, having one input signal-type variable (the supplied voltage u), and one output signal-type variable (the voltage y).
A subdirectory with the same name as the FMU (here RC) is also created in the current directory, containing the unpacked FMU zip-file.
After clicking the Finish button, the path to the new library node is automatically added to the Category Path List of Simcenter Amesim.
Step Four
A test Simcenter Amesim model is created in Sketch mode by dropping two instances of this icon on the sketch, and providing signal sources as input to the two components, as shown in the figure below.
Figure 19: Sketch of the first Simcenter Amesim test model with two instances of the RC icon
Note
Once dropped onto the sketch, the FMU import icon being seen as a user Simcenter Amesim component, it may be wrapped into a supercomponent. This can be done to customize the icon
As of this step, the documentation extracted from the FMU can be displayed in Help by right-clicking one of the two icons and choosing Help… (see below).
Figure 20: Import submodel documentation displayed in the Help
Step Five
In Submodel mode, the MEIMPRC submodel is associated with the two icons, as shown in the figure below.
Figure 21: Submodel dialog box showing the import submodel
Step Six
In Parameter mode (see below), the parameters of the two instances are displayed and their value can be changed. You will notice that two additional parameters called startq and startu are available. These parameters correspond to the start values of the variables q and u, as defined in the XML Model Description file. To ensure correct initialization, you must make sure that the start values of all FMU input variables are coherent with the inputs that will be sent to the FMU. In this example, u is the only input, and 1 V for startu is appropriate.
Two other parameters are also automatically added to the submodel:
enablelogging is an enumeration taking the values yes or no. If set to yes, the logging messages from the FMU are reported in the simulation log window.
fmuLocation is the path to the unpacked FMU. It is the path to the directory in which the Import Tool previously extracted the content of the FMU.
Results
Figure 22: Setting the common parameters of the two instances
Step Seven
The transient simulation is then started, and the result variables are available in the variable list shown in the figure below, and can be plotted.
Figure 23: Variable list dialog box showing available result variables
In addition to the four variables declared by the FMU Model Description, a variable called x0 is automatically introduced: it represents the (only) state variable of the original model. Although this is an alias of the q variable declared in the Model Description, the FMI for Model Exchange 1.0 specification defines anonymous state variables which are only known by their value reference. This is why the Import Tool automatically generates as many state variables (in the Simcenter Amesim submodel meaning) as the number of continuous states declared in the XML Model Description file.
Figure 24: Plot of the input and the output variables of the two submodel instances
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Functional_Mockup_Interface/Import_of_an_FMU_for_Model_Exchange · retrieved 2026-07-17