AmesimKnowledge

Advanced examples > Post-processing integrated features > Working with multiple data sets

Using post processing and cross results

cross result

post processing

With a cross result variable, you can observe the change in value of a variable as it evolves during a batch run. After running a set of simulations, you may want to follow a particular variable at a given time according to the results generated. We will illustrate this using the QuarterCar demo. We will observe the maximum negative body displacement according to body mass.

Open the QuarterCar demo if it is not currently open.

Step 1: Set the parameters as follows

Submodel Title Value
MECMAS21 mass [kg] 400
inclination [degree] -90
SPR000A spring rate [N/m] 15000
MECMAS21 mass [kg] 50
inclination [degree] -90
SPR000A spring rate [N/m] 200000
STEP0 value after step [null] 0.1
step time [s] 1

Step 2: Set up the batch parameters

Procedure

  1. In Parameter mode, use Configure > Study Parameters to open the Study Manager.

  2. Select the Body Mass component and drag the Mass parameter into the Input parameters list.

  3. Go to the Studies tab and select the User-defined data sets setup method and configure the following sets:

  4. Switch to Simulation mode, and set the run parameters as follows:

Final time: 5 seconds

Print interval: 0.01

Run type: Batch

Simulation mode: Stabilizing + Dynamic

Step 3: Perform a run, plot the Body displacement and convert it to a batch plot

Figure 63: Batch plot

We can now start creating our post-processing variables and our cross variables.

Step 4: Create a post-processing variable

We will create a post-processing variable to give the maximum negative displacement of the body mass. To do this, we look for the first minimum occurring after t=1.15s.

Procedure

Create the following post processing variable in the Post processing tab: locMin(lefttrunc(x1@Body_Mass, 1.15))

Note

Body_Mass is the alias set for the Body Mass in this example. If the Body Mass in your circuit has a different alias, adjust the variable accordingly.

Step 5: Create the cross variables

We will create two cross variables, the first is for inspecting the mass parameter value, the second for inspecting the max negative displacement variable.

Procedure

  1. Open the Cross result tab if not already present (Edit > Show/Hide > Cross result).You will create the following cross variables: Cross_Var1 and Cross_Var2:

  2. Drag the mass parameter to the Cross result tab and edit it as follows:

  3. Right-click in the Cross result tab and select Add.

The Y-Axis selection window opens.

  1. Locate A1 in the list and double-click it.

A new line is added to the Cross result tab.

  1. Edit it as follows:

Name is the unique name for a variable in the system.

Title is a free text area for the variable title.

X-axis is a regular expression used to select the results to inspect.

Y-axis is the base variable to follow.

Note X-axis selection: for a cross variable, the X-axis is the name of a list of results. The result name is the string that comes after the second "." (period). For example:

system_name_.results.1: Here the result name is 1.

system_name_.results.bak: Here the result name is bak.

system_name_.results: Here the result name is not set.

You can select the results file you require using regular expressions. By default, the X-axis field is set to *, meaning all results are selected. In our example, we are only interested in the batch runs, that is to say QuarterCar_.results.1 to QuarterCar_.results.6.

  1. Edit the X-axis fields using the following regular expression X-axis = [1-6]:

Step 6: Plot the Cross_var of mass and Cross_Var of max negative displacement

Procedure

  1. Drag the Cross_var of mass onto the sketch area to plot it. This produces a bar chart.

  2. Convert the bar chart to a 2D discrete line chart:

  3. Drag the Cross_Var of max negative displacement onto the new plot and again, convert it to a line chart.

  4. Right-click the Y axis and select Separate.

The plot is displayed on separate axes: Figure 64: Plot with separate axes

Results

We can see the mass and the maximum negative displacement against the simulation runs 1 to 6.

You can see the maximum negative displacement of the body against the value of the mass by doing an X-Y plot:

Figure 65: Converting to XY plot

Figure 66: An XY plot

As expected, it is linear.

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