Exercise 1: Introduction to User Subroutines
In this exercise you will learn about user subroutines and run a model for a single cylinder engine.

The model you will use is of a single cylinder engine that uses a curve, an
output, a force, and a motion entity. The system also uses default damping.
- The curve is read from a CSV file, and gives a force value based on the angular displacement of the connecting rod.
- The output returns the displacement magnitude of the piston.
- The force entity uses the angle of the connecting rod and the curve to apply a variable pressure force to the piston.
- The motion entity applies an angular motion to the Crank_Grnd revolute joint.
- The default damping of the system is 1, however it can be changed in the Bodies panel.
Entity | Usrsub | Description | |
---|---|---|---|
![]() |
Curve | SPLINE_READ | Reads the curve data file. |
![]() |
Request | REQSUB | Outputs the requested values. |
![]() |
Force | GFOSUB | Applies a force on the system. |
![]() |
Motion | MOTSUB | Applies a motion to the system. |
![]() |
Damping | DMPSUB | Defines the damping of a flexbody. |
Run the Model
In this step, you will run the model to obtain the results files to compare with your usrsub results.
-
Click the
(Run) button.
-
From the Run panel, click
(Open File) to browse your <working directory>. Specify the name of the MotionSolve XML file as engine_baseline.xml.
-
Click
to check the model for errors.
- Click the Run button.