AmesimKnowledge

The Simulation Scripting environment in detail

Basic functions

Model parameters

The Simulation Scripting facility provides functions that make it possible to get or set the values of most of the parameters in Simcenter Amesim.

These functions allow you to handle:

  • The parameters of a generic object (submodels or supercomponents)

  • The parameters of a customized object (submodels or supercomponents)

  • The global parameters of a Simcenter Amesim model

Note

The Simulation Scripting facility uses functions of reading and writing specific files of Simcenter Amesim. These files are only used for simulation and have no impact on the Graphical User Interface. In other words, any changes made to parameter values are not seen when the model is opened in Simcenter Amesim.

Another way to access parameters is using unique identifiers. Each parameter is uniquely represented by a data path in the form: identifier@component_name[.component_name[...]]

This unique identifier appears in the Name column of the Contextual parameters view window, and can be copied directly from that location. For a parameter, right-click on the parameter concerned and select Copy parameter path:

Figure 2: Copy Parameter Path

Simulation

The Simulation Scripting module provides a function that makes it possible to execute a simulation of a Simcenter Amesim model. This function is named amerunsingle. The arguments of the function allow you to set the run parameters of the simulation. In these runs parameters, you can set:

  • the start time

  • the final time

  • the print interval

  • the solver (variable step or fixed step)

Temporal analysis

The Simulation Scripting facility provides functions that make it possible to retrieve the results of a completed simulation of a Simcenter Amesim model.

Warning

The Simulation Scripting facility uses functions of reading and writing specific files of Simcenter Amesim. These files are only used for simulation and have no impact on the Graphical User Interface. This means that the results files might not be synchronized with the parameter values of the GUI if they are changed through the Simulation Scripting facility.

To access the variable results when a simulation is complete, you need to call ameloadvarst providing a list of variable name (SUBMODELNAME_INSTANCE variable_title [unit]).

Another way to access variables is using ameloadvarstui that uses unique identifiers. Each variable is uniquely represented by a data path in the form: identifier@component_name[.component_name[...]]

This unique identifier appears in the Name column of the Contextual variables view window, and can be copied directly from that location. To obtain a variables unique identifier, right-click on the variable concerned and select Copy variable path:

Figure 3: Copy variable path

Two functions allow you also to handle the model initialization by setting the initial values of the state variables of a Simcenter Amesim model to the final values of a previous run.

Variables can be plotted directly from the scripting environment. One function makes it possible to open a variable browser window with two menus: Variables and Plot. The first menu can be used to browse the variables by physical quantities. When a physical quantity is chosen in this menu, all relevant variables are displayed in the variable list. Selecting a variable and choosing a command in the Plot menu creates a figure window with the selected variable plotted in full size or in a subplot:

Batch analysis

The Simulation Scripting facility provides functions to handle batch simulations of a Simcenter Amesim model. The main arguments of the functions are the batch numbers of interest. These functions allow to set your batch parameters, run the batchs and retrieve the results of the simulation runs.

Data exchange

The Simulation Scripting facility provides functions that make it possible to exchange data by exporting Simcenter Amesim data to files or importing files within Simcenter Amesim. These data can be:

  • Basic look-up tables

  • Response surface model

  • Space state matrix for linear modeling

  • Transfer function for linear modeling

Note

Some of these functions are not available for the Visual Basic Application scripting language.

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