Calibration of a Damped Oscillator Using Signals in AMESim

This tutorial allows you to complete a calibration of a single degree-of-freedom system excited with initial kinetic energy.

The equation of motion of free vibration is:

The un-damped and damped eigen-frequency is

The time-dependent displacement function is:


Note:  This tutorial uses AMESim version 2019.2.


Problem Definition

The goal is the identification of the input parameters m, k, D, and Ekin to optimally fit a reference displacement function.

The objective function is the sum of squared errors between the reference and the calculated displacement function values

Task Description

This tutorial demonstrates how to do the following:

  • Generate a solver chain using AMESim

  • Define the input parameters

  • Define the output and reference signals

Preparation

Before you start the tutorial, complete the following tasks:

  1. Download the oscillator_signals_amesim zip file from here , and extract it to your working directory.

  2. Check if the AME environment variable is set to the AMESim install path by running the following command:

    • Windows: echo %AME%

    • Linux: echo $AME

Oscillator Model in AMESim

Model with mass and spring damper element.

Global parameters and mass displacement signal in AMESim.

Tutorial Steps

Creating a New Project

  1. Start optiSLang.

  2. Create a new empty project.

Starting the Solver Wizard

  1. From the Wizards pane, drag the Solver wizard to the Scenery pane and let it drop.

  2. From the solver list, click AMESim.

Selecting the Input File

  1. In the Select input file dialog box, browse to the oscillator_signals_amesim folder and select oscillator_AMESim_2019_2.ame.

  2. Click Open.

Selecting the Input Parameters

  1. In the main pane, select all of the parameters.

  2. Drag them into the Parameter pane to register them.

  3. Click Next.

Defining the Parameter Properties

  1. Do not adjust the values in the Parametrize Inputs table.

  2. Click Next.

Selecting the Output Data File

  1. In the Choose a file to open dialog box, browse to the oscillator_signals_amesim folder and select oscillator_AMESim_2019_2.ame.

  2. Click Open.

Defining the Output Data

  • In the Name list, click MAS002_1 displacement port 1 [m] and drag it into the Responses pane.

Selecting the Reference Data File

  1. To open the reference data file, click the orange folder.

  2. In the Choose a file to open dialog box, browse to the oscillator_signals_amesim folder and select oscillator_reference.txt.

  3. Click Open.

Defining the Reference Signal

  1. From the File format list, ensure Text file auto-parametrization is selected and click OK.

  2. Select Absolute path as the search mode.

  3. In the Name list, click time_displacement and drag it into the Responses pane.

Defining the Signal Functions

  1. Switch to the Variables tab

  2. Click Add variable.

  3. Double-click the ID cell for the new variable, type error_norm, and press Enter.

  4. Right-click the Expression cell of row 3 (error_norm) and select Open Calculator from the context menu.

  5. In the calculator, switch to the Linear Algebra tab.

  6. Click euklidnorm.

  7. In the brackets, type MAS002_1_displacement_port_1__m_ time_displacement.

    In this step, you are extracting the norm of the signal differences as the input for the euklidnorm function.

  8. Click OK.

  9. Drag the error_norm row into the Responses pane to register it as a response.

  10. Select the Instant visualization check box and compare the two signals in the diagram to make sure that there is not a time unit or scaling error.

  11. Click Next.

Defining the Optimization Criteria

  1. To define error_norm as a minimization objective, drag the row from the Responses table to the Objective Minimize icon and let it drop.

    The new criterion is displayed in the Criteria table.

  2. Click Next.

Defining the Solver Process

The wizard provides a suitable batch script for solver execution.

1A Python script is written.
2Old data is deleted to avoid confusion.
3The Python environment within the AMESim installation is used for execution.

Note:  Note: The environment variable INPUT_FILE1 which is used to build MODEL_NAME for the execution script and the Python script is provided automatically through the script. It is the name of the AMESim project file. This particular environment variable is not available when building the system by hand.


  1. If you are using AMESim version 14.2, uncomment line 4.

  2. Click Next.

Creating the Solver Chain Template

  1. Select the Create a template from solver chain check box.

  2. In the Template name field, enter oscillator_AMESim_2019_2

  3. Click Finish.

  4. The template is displayed in the Scenery pane.

Saving and Running the Project

  1. To save the project, click  .

  2. Browse to the location to save the project and type a project name in the File name field.

  3. Click Save.

  4. To run the project, click  .

  5. To review the result, double-click the oscillator_AMESim_2019_2 system and switch to the Result designs tab.

Alternative Setup for Robust Design Optimization Tutorials


Note:  This is an optional procedure.


  1. Right-click the Output files node and select Edit from the context menu.

  2. Define the x_max variable, using a time slot macro .

  3. Define the omega_damped variable, which is not readily present in the AMESim results file.