HS-1690: Set Up a PhysicsAI Model

Tutorial Level: Advanced Learn how to use PhysicsAI models to optimize displacement and stress in an optimization study.

Before you begin, copy the model files used in this tutorial from <hst.zip>/HS-1690/ to your working directory.
Note: Unzip the project HST_pAI.7z and inspect the contents:
  • Arm_model.tpl is a parameterized template file for modifying the shape.
  • Arm_model.optistruct.node.tpl contains the shape morphing parameters.
  • Arm_model.shp contains the grid coordinates.
  • Arm_displacement_1000.psmdl is a PhysicsAI trained model for predicting displacement.
  • Arm_stress_1000.psmdl is a PhysicsAI trained model for predicting stress.
In this tutorial you will:
  • Open HyperStudy and set up a study.
  • Perform shape morphing on the provided arm model.
  • Use PhysicsAI models to predict stresses and displacements, bypassing the need for an analysis.
  • Run an optimization study to reduce the volume of the arm subject to stress and displacement constraints.

Create Study

In this tutorial, you will open HyperStudy and create a study.

  1. Launch HyperStudy.
  2. Start a new study in the following ways:
    • From the menu bar, click File > New.
    • On the ribbon, click .
  3. In the Label field, enter Arm_pAI_example.
  4. In the Location field, click the icon and navigate to your tutorial working folder.
    Figure 1.
  5. Click OK.

Import Design Variables

In this step, you will import the design variables and set up shape morphing for the Arm model.

  1. In the Define Models tab, click on the Add Model option.
    The Add window opens.
  2. Select Parameterized File and click OK.
    Figure 2.
  3. In the Resource field, click on the button and select the arm_model.tpl file.
    The Editor dialog opens.
  4. Click OK.
  5. In the Solver Input File field, enter arm_model.fem and press Enter.
    Figure 3.
  6. Click the Import Variables button.
  7. From the Model tree, select to open the Test Models tab.
  8. Click the Run Definition button.

Load PhysicsAI Models

In this tutorial you will load PhysicsAI models for use in further studies.

  1. Go to the Define Models step.
  2. Add PhysicsAI models.
    1. Click on Add Model, select PhysicsAI and then click OK.
    2. Click on Add Model again, select PhysicsAI. In the Label field, name it PhysicsAI 2 and then click OK.
    Figure 4.
  3. Add resources for each PhysicsAI model.
    1. In the Resource field of PhysicsAI 1, click and select the Arm_displacement_1000.psmdl model file from the dialog.
    2. In the Resource field of PhysicsAI 2, click and select the Arm_stress_1000.psmdl model file from the dialog.
    Figure 5.
  4. Edit the PhysicsAI model resources.
    1. Click the Model Resources button.
      The Model Resources window opens.
    2. Click Parameterized File 1 > Add Resource > Add Output File.
      The Select File dialog opens.
    3. Select the arm_model.fem file and then click Open.
      The arm_model.fem will now appear as an output file.
    4. Click PhysicsAI 1 (m_2) > Add Resource > Add Link.
    5. Select the arm_model.fem file and then click OK.
      This link ensures that the arm_model.fem file is copied from the m_1 subdirectory to m_2 and made the m_2 component available for operations.
      Figure 6.
    6. Click PhysicsAI 2 (m_3) > Add Resource > Add Link.
    7. Select the arm_model.fem file and then click OK.
    8. Click Close.
  5. Add solver arguments to the PhysicsAI 1 model.
    1. In the Solver Arguments field of PhysicsAI 1, click .
    2. In the Solver Input Arguments field of the 1 row, enter ${basename m_2.file_2}.
      Note: You may need to expand the window to see this row.
    3. Click OK.
    Figure 7.
  6. Add solver arguments to the PhysicsAI 2 model.
    1. In the Solver Arguments field of physicsAI 2, click .
    2. In the Solver Input Arguments field of the 1 row, enter ${basename m_3.file_2}.
    3. Press OK.
  7. Click Import Variables.

Set Up Output Responses

In this tutorial, you will set up output responses for a PhysicsAI model file.

  1. Go to the Test Models step.
  2. Click Run Definition.
    1. Click either Overwrite or Delete at the warning dialog.
  3. Go to the Define Output Responses step.
  4. Add the output responses.
    1. Click Add Output Response.
    2. Rename the response name by entering Volume in the Label field.
    3. In the Expression field for the Volume model, click .
      The Expression Builder dialog opens.
    4. Enter the following equation into the Expression definition area:
      1766144.0825456267+(-22720.940215415507*length_1^1)+
      (104248.83772668922*length_2^1)+( 83112.51602245052*length_3^1)+
      (65618.4765073031*length_4^1)+( 95942.47495949842*length_5^1)+
      (2580.717371096888*radius_1^1)+(-703.4680792932379*radius_2^1)+
      (-2522.1608791274534*radius_3^1)+(-81701.3518739997*height^1)
      Figure 8.
  5. Add the first data source.
    1. In the Data Sources tab, click Add Data Source.
    2. In the File field, click .
      The Data Source Builder dialog opens.
    3. Select the arm_model_pred.h3d file located in \approaches\setup_1-def\run__0001\m_2.
    4. For Tool, select Read Simulation.
    5. For Type, select Displacement (Grids).
    6. For Components, select MAG.
    7. Click OK to close the Data Source Builder dialog.
      Figure 9.
    8. Click OK to close the Expression Builder dialog.
  6. Repeat step 5 to add a second data source with the following details.
    File arm_model_pred.h3d in approaches\setup_1-def\run__0001\m_3
    Type Element Stresses (Elements)
    Components Value (2D& 3D)
    Figure 10.


    Figure 11.
  7. Define output responses.
    1. Switch to the Define Output Responses tab and click on Add Output Response.
    2. Change the label to Max_displacement.
    3. In the Expression field, click on the .
      The Expression Builder dialog opens.
    4. In the Expression definition area, enter max(ds_1) to extract the maximum displacement value from Data Source 1.
    5. Click OK.
    6. Repeat steps 7.a - 7.e to add another Output Response with the following details.
      Label Max_stress
      Expression max(ds_2) to extract the maximum stress value from Data Source 2
      Figure 12.
      Note: If similarity score is available, then it is automatically added as an output response. For more information on when the similarity score is available, please refer to the frequently asked questions in PhysicsAI documentation.
  8. Click Evaluate.
    The setup is complete.

Set Up and Run an Optimization Study

In this tutorial you will set up and run an optimization study using a PhysicsAI model.

  1. Add an Optimization.
    1. In the Study Explorer, right-click and select Add from the context menu.
    2. In the Add dialog, select Optimization.
    3. For Definition from, select Setup and click OK.
  2. Go to the Test Models step.
  3. Click Run Definition.
  4. Go to the Define Output Responses step.
  5. In the Goals field for Volume, set the Type to Minimize.
  6. For Max_displacement, create a Goal defined by an upper bound constraint (<=2).
    Figure 13.
  7. For Max_stress, create a Goal defined by an upper bound constraint (<=200).
Figure 14.
  1. Click Evaluate.
  2. Go to the Optimization > Specifications step.
  3. Accept the default settings and click Apply.
    The setup is complete.
  4. Go to the Optimization > Evaluate step.
  5. Click on the Evaluate Tasks button.
  6. After the evaluation is complete, the results can be reviewed using the Post-Processing task for Optimization 1.