Calibration of a Damped Oscillator Using Signals in Excel

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 Excel

  • Define the input parameters

  • Define the output and reference signals

Preparation

Before you start the tutorial, download the oscillator_signals_excel 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.

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

Selecting the Input File


Note:  Ensure all Excel applications are closed before completing this step.


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

  2. Click Open.

Selecting the Input Parameters

  1. In the main pane, select rows 1, 3, 4, and 5 (D, Ekin, k, and m).

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

Selecting the Responses

  1. In the main pane, select rows 2 and 7 (disp and time).

  2. Right-click the selection and select Use as internal variable from the context menu.

Defining the Output Signal

  1. Switch to the Variables tab

  2. Click Add variable.

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

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

  5. In the calculator, switch to the Signal tab.

  6. Click xydata.

  7. In the brackets, type time,disp.

  8. Click OK.

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

  10. Optionally, select the Instant visualization check box to see if the signal is correct.

Using Macros

  1. Switch to the Excel tab.

  2. Switch to the Execution settings.

  3. Select the Modul1.WriteOutput check box.


    Note:  In some version of Excel, you must activate macros in the Trust Center settings before they can be used. For more details, refer to the documentation provided with your version of Excel.


  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_excel 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. Select Edit > Connect Nodes.

  2. Click the Sending node field and select Text Output from the list.

  3. Click the Receiving node field and select oscillator.xls from the list.

  4. Click and drag Reference from the Sending node output slots list to New slot in the Receiving node input slots list and drop it on top.

  5. Click OK.

    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 4 (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  .