Calibration of a Damped Oscillator Using Signals in Ansys Twin Builder

Representative example for Ansys Electronics Desktop (Ansys EDT) Applications

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 undamped 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 Twin Builder

    The representative for all model types offered by Ansys Electronics Desktop

  • Define the input parameters

  • Define the output and reference signals


Note:  This tutorial walks you through a single problem. For more detailed information and best practices, see Ansys EDT in the optiSLang User's Guide.


Preparation

Before you start the tutorial, complete the following tasks:

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

  2. Copy the oscillator.aedt file from the zip file extracted in step 1 to a new workspace folder (recommended).

  3. Launch Twin Builder.

  4. In the Project Manager, right-click Simplorer1 and select Design Properties from the context menu.

  5. Switch to the Local Variables tab.

  6. Verify that the following variables are displayed:

  7. To close the dialog box, click OK.

  8. In the project tree, expand Analysis.

  9. To solve the model, right-click the TR node and select Analyze from the context menu.

  10. In the project tree, expand Results.

  11. Verify that result reports are defined.

    Response collection in optiSLang is based on exported reports.

  12. Close the project and exit Twin Builder.

Best Practice Recommendations for Directory Structures

Flexible file and folder references:

  • Files and folders can be referenced in absolute and relative manner

  • Referenced files may be located relatively nearby or far away

  • optiSLang has many ways to handle referenced paths very flexibly

  • In collaborative environments, far-reaching references are often a necessity (for example, network server drives)

This tutorial however,

  • Comes as a small package with all necessary files

  • Can be considered as self-sufficient encapsulated project

  • Can be revisited later

  • You will soon develop your own suitable best practice

The following image depicts a folder structure you can use as a good starting point.

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.

Completing the Solver Wizard


Important:  Ensure that the oscillator.aedt project is closed before starting this procedure.


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

  2. From the solver list, click Ansys EDT.

  3. In the Select project file dialog, browse to your working directory and select oscillator.aedt.

  4. Click Open.

    The Solver wizard creates a parametric system containing a single Ansys EDT integration node

From here, you can now create a one node setup or a two node system.

The two node system is a best practice procedure offering several advantages that pay off during later work with your process integration setup. This setup is recommended.

Creating a One Node Setup

  1. Double-click the oscillator node to edit it, or right-click the node and select Edit from the context menu.

    The Ansys EDT integration node wants to display properties of the referenced project. This triggers a sequence of actions.

    1. An instance of Electronics Desktop is opened in the background,

    2. Ansys EDT opens the reference project,

    3. Parameters and reports are extracted as part of a first-time inquiry,

    4. The edit dialog stays empty and non-responsive during this process,

    5. Once the reference project inquiry has successfully yielded results, parameter and response listings will appear and the dialog becomes responsive again.

    The same project inquiry sequence is executed again after modifications are made to the reference project. Once any referencing integration node detects a timestamp or other inconsistency between the Ansys EDT file and the stored inquiry results, the inquiry procedure is triggered.

  2. In the Inputs pane, select the displayed parameters and drag them into the Parameter pane to register them.

  3. In the Outputs pane, expand Simplorer1 and XY Plot 1.

  4. Drag Simplorer1.XY Plot to the Responses pane to register it.

  5. To save the changes and close the dialog box, click OK.

  6. To save the project, click  .

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

  8. Click Save.

  9. To run the project, click  .

This is the end of the single node setup process. You can now use this single node project with other oscillator tutorials.

Creating a Two Node System

This setup process creates a two node system following best practice recommendations. This covers:

  1. Two-node setup with a separate output collector node.

  2. Shared parametrization mode.

  3. Achieving updated listings after altering settings.

  4. Tree-view and tabular displays.

  5. How to best rename responses registered from the primary detection listing.

  6. Best directory structure.

Duplicating the Oscillator Node

These steps allow you to gain reset-rerun capability for output collection. Resetting only the output collector node leaves the work directories and the finalized state of the preceding solver node intact. This is possible for single-iteration systems, for example, sensitivity or robustness samplings.

  1. Right-click the oscillator node and select Copy from the context menu.

  2. Right-click the Parametric solver system and select Paste into system from the context menu.

  3. Drag the oscillator (1) node onto the connection line.

  4. Right-click the oscillator (1) node and select Rename from the context menu.

  5. Rename the node as desired. In this example, the node is renamed to oscillator_output.

  6. Double-click the oscillator node or right-click the node and select Edit from the context menu.

  7. Click Show advanced options.

  8. Select the Use as input integration and Use as solver check boxes and clear the Use as output integration check box.

    Setting the file path relative to the project (the OPF file) will also work and make the workspace easily portable, but setting the path relative to the working directory does not work. The first node has to start by cloning the baseline project into its working directory.

  9. To save the changes and close the dialog box, click OK.

  10. Double-click the oscillator_output node or right-click the node and select Edit from the context menu.

  11. From the path list, select Relative to working dir.

    It is a long established optiSLang standard and perspective that input integrations are cloning master files given in a constant location, whereas pure output collection is to happen in ever changing working directories.

  12. Click Show advanced options.

  13. Select the Use as output integration check box and clear the Use as input integration and Use as solver check boxes.

  14. To save the changes and close the dialog box, click OK.

Defining Ansys EDT Integration Settings

  1. Double-click the oscillator node or right-click the node and select Edit from the context menu.

  2. Switch to the Settings tab.

  3. On the Parameters tab, select the following check boxes:

    • Show project parameters

    • Shared Parameters View

    • Include non-omnipresent parameters as shared

    By default, parameter names are prefixed based on the models within the Ansys EDT project. The oscillator project contains only one model and the prefix is unnecessary.

    Shared parametrization is convenient if multiple models within a project are to be kept in sync and/or for creating short parameter names.

  4. Switch to the Execution tab.

  5. Verify that the Ansys EDT executable is ansysedt.exe.

    If it is something different or there is no text in the field, click the ellipses button to the right of the field. Browse to C:\Program Files\AnsysEM\AnsysEM 24.2\Win64 and select the executable file.

  6. From the Run mode list, select Single simulation.

  7. Ensure that the No GUI check box is selected.

  8. Optionally, to force the analysis to wait for a license when running. select the Wait for AEDT license check box.

  9. To save the changes, click Apply.

  10. To force a reference data reload, click Open.

    If the Open button is not active, click  , then close the file browsing dialog box without selecting a file.

    The parameters are reloaded and the parameter names are shortened.

Switching Views (Optional)

You can display inputs and outputs for an integration node in a tabular view or tree view. Both views contain the same information. The tree view works well for mirroring the structure of Ansys EDT projects comprising multiple models.

  1. In the menu bar, select Edit > Settings.

  2. Under Customization, select or clear the Customized integrations use treeview check box.

  3. Click OK.

  4. Save the project and restart optiSLang.

Registering Parameters and Responses

  1. In the oscillator node Inputs pane, select the displayed parameters and drag them into the Parameter pane to register them.

  2. In the Parameter pane, click the parameter names and change them to D, Ekin, k, and m.

    Highlighting selected parameters can show the connection to the new names.

  3. To save the changes and close the dialog box, click OK.

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

  5. In the Outputs pane, expand Simplorer1 and XY Plot 1.

  6. Right-click Simplorer1.XY Plot1 and select Use as internal variable from the context menu.

  7. Switch to the Variables tab.

  8. Select the displayed variable and drag it into the Responses pane to register it as the response signal.

Recommendations for Response Renaming

Avoid renaming in the Responses pane as depicted below. The obvious connection between renamed responses and their origin can be lost.

If the formula expressions for derived quantities are lengthy or otherwise complex, the connection between renamed responses and their origins in the integration node’s response listing and the calculator listing may not be obvious anymore.

Highlighting selected quantities may be the sole way to regain knowledge about the actual connections.

A setup like above is not in the best shape for revealing its logic to somebody viewing it later, it is not at all self-documenting.

From the outputs listing, register relevant objects as an internal variable. The advantage when renaming only in the Variables tab in the definition listing, the Name column provides the connection of the new given name to the original automatically detected name, so it is always documented.

  1. Register chosen listed objects as an internal variable. They are displayed in the Variables tab.

  2. Use the ID column of the table for renaming.

  3. Use the calculator for deriving further quantities of interest by adding variables from the context menu.

  4. Use help variables (remaining unregistered) and the Description column for further enhancing clarity and documentation.

Defining the Design Variables

  1. Double-click the Parametric solver system.

  2. Set the Range numbers as shown in the following image.

  3. Click OK.

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.

    In this example, the Text Output node is used, but you can also use the ETK (extraction toolkit) node. The ETK node has more diverse features and fulfill the output collection task equivalently.

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

  4. To save the changes and close the dialog box, click OK.

    The Text Output node is added to the system.

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

  6. Click  .

  7. Browse to the twin_builder folder and select oscillator_reference.txt.

  8. Click Open.

  9. Select Relative to project as the search mode.

    When referencing a far-away location like a server drive, then the absolute mode is recommendable.

    When working in a self-sufficient project workspace with all ingredients assembled, as shown in the following image, then the relative mode is recommendable and provides seamless portability.

  10. Expand Show advanced options.

  11. Set the Line and Token settings as shown.

  12. In the Variable Name field, type ux_reference.

  13. From the multi-action button, select Use as response.

    The signal is displayed in the Responses pane.

  14. From the multi-action button, select Use as output slot.

    The signal is displayed in the Output slots pane.

  15. Click OK.

Routing the Reference Signal

  1. Hover over the right side of the Text Output node to open the output slots flyout.

  2. Click ux_reference and drag it onto New slot on the input slots flyout (left side) of the oscillator_output node.

Creating Signal Match Scoring

  1. Double-click the oscillator_output node or right-click the node and select Edit from the context menu.

  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.

    Note that the column order in the variables tab is flexible. Columns can be moved by dragging the header fields. The column for formula expressions can be moved to the left in order to have most relevant fields like variable names, expressions, and result values displayed closer together in a more compact area.

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

  7. Click euklidnorm.

  8. In the brackets, type ux_simulation-ux_reference.

    In this step, you are specifying the simulated signal minus the reference signal as the input for the euklidnorm function.

  9. Click OK.

  10. Select the Instant visualization check box and compare the simulated signal with the reference signal on the slot. Also double check the units, you may correct the signal with scaling.

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

  12. Click OK.

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 Parametric solver system and switch to the Result designs tab.

If you encounter problems with the project, see the Troubleshooting section of Ansys EDT in the optiSLang User's Guide.

You can also try different run modes, for example simulation of multiple designs with DSO.