HS-1690: Set Up a physicsAI Model

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 window opens. Press OK to close it.
  4. In the Solver Input File field, enter arm_model.fem and press Enter.
    Figure 3.
  5. Click the Import Variables button.
  6. From the Model tree, select to open the Test Models tab.
  7. Click the Run Definition button.

Load physicsAI Models

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

  1. From the Explorer tree, click to open the Define Models task.
  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 physicsAI 1 (m_2) row, click on the in the Resource field and select the Arm_displacement_1000.psmdl model file from the dialog.
    2. In the physicsAI 2 (m_3) row, click on the in the Resource field 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 Open.
      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 Open.
    8. Press Close.
  5. Add solver arguments to the physicsAI 1 model.
    1. In the Solver Arguments field of the physicsAI 1 (m_2) model row, click the icon.
    2. In the Solver Input Arguments field of the 1 row, enter ${basename m_2.file_2}. You may need to expand the window to see this row.
    3. Press OK.
    Figure 7.
  6. Add solver arguments to the physicsAI 2 model.
    1. In the Solver Arguments field of the physicsAI 2 (m_3) model row, click the icon.
    2. In the Solver Input Arguments field of the 1 row, enter ${basename m_3.file_2}.
    3. Press OK.
  7. Click on the Import Variables button.

Set Up Output Responses

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

  1. From the Model tree, click to open the Test Models task.
  2. Click the Run Definition button.
    1. Click either Overwrite or Delete at the warning dialog.
  3. From the Explorer tree, click to open the Define Output Responses task.
  4. Add the output responses.
    1. Click the Add Output Response button.
    2. Rename the response name by changing the Label field to Volume.
    3. In the Expression field for the Volume model, click the icon to open the Expression Builder dialog.
    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. Switch to the Data Sources tab and click Add Data Source.
    2. In the File field, click on the to launch the Data Source Builder.
    3. Select the arm_model_pred.h3d file located in \approaches\setup_1-def\run__0001\m_2.
    4. From the Tool drop down, change the type to Read Simulation.
    5. From the Type drop down, select Displacement.
    6. From the Components drop down, select MAG.
    7. Click OK.
      Figure 9.
  6. Add the second data source.
    1. Add a second data source and repeat Step 5, pointing to arm_model_pred.h3d located in approaches\setup_1-def\run__0001\m_3. Change the Type to Element Stresses and the Components to Value (2D& 3D).
      Figure 10.
  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. Click on the to open the Expression Builder. Type max(ds_1) to extract the maximum displacement value from Data Source 1.
    4. Add another Output Response, changing the label to Max_stress. In the Expression Builder, enter max(ds_2) to extract the maximum stress value from Data Source 2.
      Figure 11.
  8. Click Evaluate. This completes the setup.

Set Up and Run an Optimization Study

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

  1. Right-click inside the Study Explorer tab and click on Add.
  2. In the Add dialog, select Optimization and Setup. Press OK.
    Figure 12.
  3. From the Explorer tree, click on the Test Models task for Optimization 1. Click on Run Definition.
  4. Click on the Define Output Responses task for Optimization 1.
  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. From the Explorer tree, click on the Specifications task for Optimization 1.
  3. Accept the default settings and click Apply. The setup is now complete.
  4. From the Explorer tree, click on the Evaluate task for Optimization 1.
  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.