Showing results for 
Search instead for 
Did you mean: 

Creating Transient Input Data from Excel

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

When creating Simulation models, it is often required to validate the performance of the model in transient. This requires imposing boundary conditions to the model and comparing the results with the available test data.


Setting up a model to perform these tests can be time consuming and introduce errors which can have a detrimental effect on the evaluation of the model suitability but can also cause problems with both traceability and reusability.


Luckily LMS Imagine.Lab Amesim has a high level of scripting capability to help support some of the more tedious tasks.


LMS Amesim has scripting interfaces with Python, MATLAB, Scilab and VBA. More detail on these interfaces can be found in the help documentation. For this piece I would like to use the Amesim Python API to demonstrate how time based test data can be easily imported from Excel and integrated into an LMS Amesim model.


We will use a simple model for the example. The model itself is unimportant, it's just to show use-case.

 Figure 1: Test LMS Amesim model, msd.ameFigure 1: Test LMS Amesim model, msd.ame

We have an Excel sheet containing the required input step pattern and output displacement and velocity profile to be compared to

 Figure 2: Input Excel sheet data and structureFigure 2: Input Excel sheet data and structure

The basic process is as follows

  1. Import the Excel file into Python
    1. Identify the variable names to be imported
    2. Create a list representing the time vector
    3. Create a list of lists representing the input data
  1. Use the LMS Amesim scripting API (amesim) to create a XY table data file that can be used with SIGFXA01
  2. Use the LMS Amesim circuit API (ame_apy) to build an LMS Amesim model a containing a BUS structure with all signals accessible from their variable name
  3. Finally we will integrate the model created in 3, with the model to be tested and connect the variables to be compared using the BUS get (SIGBUSGET01) components

Figure 3: Process flowFigure 3: Process flow

The resulting model will look like this. The required variables can be accessed on the BUS for comparison with the Simulation model results

Figure 4: Validation LMS Amesim model msd_final.ameFigure 4: Validation LMS Amesim model msd_final.ame 

Running the demo 

  1. Open msd.ame in LMS Amesim 15.0.1
  2. Start the Python interpreter from LMS Amesim – this ensures working from the correct directory
  3. Execute the Python script - >> execfile(‘’)

Figure 5: Python outputFigure 5: Python output

  1. Open the generated test.ame model in data folder
  2. Copy the model to msd.ame
  3. In parameter mode, update the location of the created data file in the dynamic table
    Warning: Open the file once from LMS Amesim and re-save (this is needed to ensure format is correct)
  4. Connect the BUS as required

Figure 6: Table parameter updateFigure 6: Table parameter update


Good luck, I hope it is useful!