Calibration of a Damped Oscillator Using Signals in MATLAB

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:

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 MATLAB

  • Define the input parameters

  • Define the output and reference signals

Preparation

Before you start the tutorial, download the oscillator_signals_matlab zip file from here , and extract it to your working directory.

Tutorial Steps

Creating a New Project

  1. Start optiSLang.

  2. Create a new empty project.

  3. This tutorial provides instructions for manually connecting input and output slots. To display the slots in the node flyouts, from the menu bar select View > Slot flyout view mode > Full.

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 MATLAB.

Selecting the Input File

  1. In the Select input file dialog box, browse to the oscillator_signals_matlab folder and select oscillator.m.

  2. Click Open.

Selecting the Parameters and Response

  1. From the Detect assignments drop-down list, select Test run.

  2. In the MATLAB table, select rows D, Ekin, k, and m and drag them to the Parameter pane.

  3. In the MATLAB table, select row 23 (Simulation) and drag it to the Responses pane.

  4. Click Next.

Editing the Parameter Properties

  1. Double-click the range numbers for row 1 (D).

  2. Change the lower bound to 0.01 and the upper bound to 0.05.

  3. Double-click the range numbers for row 2 (Ekin).

  4. Change the lower bound to 10 and the upper bound to 100.

  5. Double-click the range numbers for row 3 (k).

  6. Change the lower bound to 10 and the upper bound to 50.

  7. Double-click the range numbers for row 4 (m).

  8. Change the lower bound to 0.1 and the upper bound to 5.

  9. Click Next.

  10. Do not adjust or add to the currently displayed values for parameters, responses, and criteria.

  11. Click Next.

Completing the Solver Wizard

  1. Leave the Create a template from solver chain check box clear. You will create a solver chain template in a later step.

  2. Click Finish.

  3. The solver chain is displayed in the Scenery pane.

Saving 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.

Defining the Reference Signal

  1. In the Modules pane, expand Process chain elements and Output nodes.

  2. Drag the Text Output node into the solver chain.

  3. Clear the Receive design from parent system check box.

  4. Double-click the Text Output node or right-click the node and select Edit from the context menu.

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

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

  7. Click Open.

  8. Highlight the text in line 1 (Reference).

  9. Right-click the selection and select define marker > use "Reference" as marker from the context menu.

  10. Highlight the first number in line 4 (0.00000)

  11. Right-click the selection and select define location > from marker "Reference" repeated from the context menu.

  12. Select Absolute path as the search mode.

  13. Expand Show advanced options.

  14. Set the number of tokens to Max: 2.

  15. Click Use as response.

    The signal is displayed in the Responses pane.

  16. Click the arrow next to Use as response and select Use as output slot from the menu.

    The signal is displayed in the Output slots pane.

  17. Click OK.

Routing the Reference Signal

  1. Hover over the right side of the Text Output node.

  2. 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.

Defining the Signal Functions

  1. Double-click the oscillator node.

  2. Switch to the Variables tab

  3. Click Add variable.

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

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

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

  7. Click euklidnorm.

  8. 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.

  9. Click OK.

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

  11. Click OK.

Creating the Solver Chain Template

  1. Right-click the oscillator system and select Create > Create template from system from the context menu.

  2. Select the Templates folder and click OK.

  3. To save the project, click  .