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:
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 MATLAB
Define the input parameters
Define the output and reference signals
Before you start the tutorial, download the oscillator_signals_matlab zip file from here , and extract it to your working directory.
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 Parameters and Response
- Editing the Parameter Properties
- Completing the Solver Wizard
- Saving the Project
- Defining the Reference Signal
- Routing the Reference Signal
- Defining the Signal Functions
- Creating the Solver Chain Template
Start optiSLang.
Create a new empty project.
This tutorial provides instructions for manually connecting input and output slots. To display the slots in the node flyouts, from the menu bar select
> > .
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_matlab folder and select oscillator.m.
Click
.
From the Detect assignments drop-down list, select .
In the MATLAB table, select rows D, Ekin, k, and m and drag them to the Parameter pane.
In the MATLAB table, select row 23 (Simulation) and drag it to the Responses pane.
Click
.
Double-click the range numbers for row 1 (D).
Change the lower bound to
0.01
and the upper bound to0.05
.Double-click the range numbers for row 2 (Ekin).
Change the lower bound to
10
and the upper bound to100
.Double-click the range numbers for row 3 (k).
Change the lower bound to
10
and the upper bound to50
.Double-click the range numbers for row 4 (m).
Change the lower bound to
0.1
and the upper bound to5
.Click
.Do not adjust or add to the currently displayed values for parameters, responses, and criteria.
Click
.
Leave the Create a template from solver chain check box clear. You will create a solver chain template in a later step.
Click
.The solver chain is displayed in the Scenery pane.
To save the project, click .
Browse to the location to save the project and type a project name in the File name field.
Click
.
In the Modules pane, expand Process chain elements and Output nodes.
Drag the Text Output node into the solver chain.
Clear the Receive design from parent system check box.
Double-click the Text Output node or right-click the node and select from the context menu.
To open the reference data file, click the orange folder.
In the Choose a file to open dialog box, browse to the oscillator_signals_matlab folder and select oscillator_reference.txt.
Click
.Highlight the text in line 1 (Reference).
Right-click the selection and select
> from the context menu.Highlight the first number in line 4 (0.00000)
Right-click the selection and select
> from the context menu.Select
as the search mode.Expand Show advanced options.
Set the number of tokens to
Max: 2
.Click
.The signal is displayed in the Responses pane.
Click the arrow next to Use as response and select from the menu.
The signal is displayed in the Output slots pane.
Click
.
Hover over the right side of the Text Output node.
Click Reference and drag it onto New slot on the left side of the oscillator node.
A connection between the Text Output and the oscillator node is created.
Double-click the oscillator node.
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 2 (error_norm) and select from the context menu.
In the calculator, switch to the Linear Algebra tab.
Click
.In the brackets, type
Simulation-Reference
.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.
Click
.