Exercise 3: Run Your Simulation with Usersubs

In this exercise, you will run the simulation with the usersubs you implemented in Exercise 2: Add User Subroutines and compare the results to those from your initial test in the Exercise 1 step Run the Model.

Run the Model

In this step you will run the model with implemented usersubs.

  1. On the toolbar, click (Run).
  2. In the Run panel, click the Run MotionSolve file radio button.
  3. Use the (Open) button to browse to the *.xml file save in the step Use DMPSUB to Add Custom Flexbody Damping.
    Figure 1.


  4. Click the Run button.

Use HyperGraph to Plot the Displacement Magnitudes

In this step you will use HyperGraph and the outputs from both simulations to compare the displacement magnitude of the piston.

A correct result from the usersub run will math the results from the initial run.
  1. Click the (Add Page) button.
  2. From the Client Selector drop-down menu, switch the client from MotionView to HyperGraph 2D.
    Figure 2.


  3. Plot the baseline results.
    1. In HyperGraph, click the (Build Plots) icon.
    2. In the panel, use the (Data File browser) to open the baseline_abf file.
    3. Leave the default x variable (Time). For Y Type, select Marker Displacement. For Y Request, leave the default. For Y Component, select DM.
    4. Click Apply.
  4. To plot the usersub results, repeat step 3. For Y Type use REQSUB and for Y Component use RESULT (2).
    Figure 3. Comparison of output results from both model simulations


Use HyperView to Compare Flexbody Stresses

In this step you will use HyperView to compare the stresses and deformations on the flexbody.

The results between the initial simulation and the usersub simulation should be the same.
  1. Click the (Add Page) button.
  2. In the Client Selector drop-down menu, switch the client from HyperGraph 2D to HyperView.
  3. On the Standard toolbar, click the (Load Results) icon.
  4. From your <working directory>, open the baseline_h3d results file.
  5. Click Apply.
  6. Click the (Entity Attributes) button.
  7. In the panel, next to the Display option, click the Off button.
    Note: Make sure that the Auto apply mode check box is checked.
    Figure 4.


  8. In the modeling window, click on the piston head, and both crank components.
    Note: Only the flexbody component should be displayed.
  9. On the Results toolbar, click the (Contour) button.
  10. In the Contour panel, set the Result type to Deformation->Displacement (v) and click on the flexbody in the modeling window.
    Figure 5.


  11. Click Apply.
  12. Next, click the (Tracking Systems) icon.
  13. In the Tracking panel, from the Track drop-down menu click Component. Then click the flexbody in the modeling window.
  14. On the Page Controls toolbar, open the Page Window Layout drop-down menu and click (two window layout).
  15. In the blank modeling window, repeat steps 3 through 13 for the usersub h3d file.
  16. On the Animation toolbar, click the (Start/Pause Animation) button to animate your models.
    Figure 6. Comparison of flexbody deformation in HyperView