4 Mechanical Models II

4.1 Simulation control properties

Both RootModel and MechModel contain properties that control the simulation behavior. One of the most important of these is maxStepSize. By default, simulation proceeds using the maxStepSize value defined for the root model. A MechModel (or any other type of Model) contained in the root model’s models list may also request a smaller step size by specifying a smaller value for its own maxStepSize property. For all models, the maxStepSize may be set and queried using

  void setMaxStepSize (double maxh);
  double getMaxStepSize();

Another important simulation property is integrator in MechModel, which determines the type of integrator used for the physics simulation. The value type of this property is the enumerated type MechSystemSolver.Integrator, for which the following values are currently defined:


First order forward Euler integrator. Unstable for stiff systems.


First order symplectic Euler integrator, more energy conserving that forward Euler. Unstable for stiff systems.


Fourth order Runge-Kutta integrator, quite accurate but also unstable for stiff systems.


First order backward order integrator. Generally stable for stiff systems.


Second order trapezoidal integrator. Generally stable for stiff systems, but slightly less so thanConstrainedBackwardEuler.

The term “Unstable for stiff systems” means that the integrator is likely to go unstable in the presence of “stiff” systems, which typically include systems containing finite element models, unless the simulation step size is set to an extremely small value. The default value for integrator is ConstrainedBackwardEuler.

Stiff systems tend to arise in models containing interconnected deformable elements, for which the step size should not exceed the propagation time across the smallest element, an effect known as the Courant-Friedrichs-Lewy (CFL) condition. Larger stiffness and damping values decrease the propagation time and hence the allowable step size.

Another MechModel simulation property is stabilization, which controls the stabilization method used to correct drift from position constraints and correct interpenetrations due to collisions. The value type of this property value is the enumerated type MechSystemSolver.PosStabilization, which presently has two values:


Uses only a diagonal mass matrix for the MLCP that is solved to determine the position corrections. This is the default method.


Uses a stiffness-corrected mass matrix for the MLCP that is solved to determine the position corrections. Slower than GlobalMass, but more likely to produce stable results, particularly for problems involving FEM collisions.