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.
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
This tutorial demonstrates how to do the following:
Generate a solver chain using AMESim
Define the input parameters
Define the output and reference signals
Before you start the tutorial, complete the following tasks:
Download the oscillator_signals_amesim zip file from here , and extract it to your working directory.
Check if the AME environment variable is set to the AMESim install path by running the following command:
Windows:
echo %AME%
Linux:
echo $AME
Model with mass and spring damper element.
Global parameters and mass displacement signal in AMESim.
To set up and run the tutorial, perform the following steps:
- Creating a New Project
- Starting the Solver Wizard
- Selecting the Input File
- Selecting the Input Parameters
- Defining the Parameter Properties
- Selecting the Output Data File
- Defining the Output Data
- Selecting the Reference Data File
- Defining the Reference Signal
- Defining the Signal Functions
- Defining the Optimization Criteria
- Defining the Solver Process
- Creating the Solver Chain Template
- Saving and Running the Project
From the Wizards pane, drag the Solver wizard to the Scenery pane and let it drop.
From the solver list, click
.
In the Select input file dialog box, browse to the oscillator_signals_amesim folder and select oscillator_AMESim_2019_2.ame.
Click
.
In the main pane, select all of the parameters.
Drag them into the Parameter pane to register them.
Click
In the Choose a file to open dialog box, browse to the oscillator_signals_amesim folder and select oscillator_AMESim_2019_2.ame.
Click
.
In the Name list, click MAS002_1 displacement port 1 [m] and drag it into the Responses pane.
To open the reference data file, click the orange folder.
In the Choose a file to open dialog box, browse to the oscillator_signals_amesim folder and select oscillator_reference.txt.
Click
.
From the File format list, ensure is selected and click .
Select
as the search mode.In the Name list, click time_displacement and drag it into the Responses pane.
Switch to the Variables tab
Click
.Double-click the ID cell for the new variable, type
error_norm
, and press Enter.Right-click the Expression cell of row 3 (error_norm) and select from the context menu.
In the calculator, switch to the Linear Algebra tab.
Click
.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.
Click
.Drag the error_norm row into the Responses pane to register it as a response.
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.
Click
.
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.
Click
.
The wizard provides a suitable batch script for solver execution.
1 | A Python script is written. |
2 | Old data is deleted to avoid confusion. |
3 | The 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.
If you are using AMESim version 14.2, uncomment line 4.
Click
.
Select the Create a template from solver chain check box.
In the Template name field, enter
oscillator_AMESim_2019_2
Click
.The template is displayed in the Scenery pane.
Note: This is an optional procedure.
Right-click the Output files node and select from the context menu.
Define the x_max variable, using a time slot macro .
Define the omega_damped variable, which is not readily present in the AMESim results file.