Previous section-----Next section

2.5.2 Controlling SolveMech

The nonlinear equation solver used by SolveMech can be controlled by setting the values of several options. Many of these options are the same as those used by FindRoot, although SolveMech does not utilize FindRoot.

Options for SolveMech.

The operation of SolveMech can be inspected by the use of two hook functions that are called during the execution of SolveMech. Note that all Mech system variables that can be set by the user have names of the form "$Mech*".

Controls for SolveMech.

Failure to Converge

The default setting for ZeroTest will suffice for many models, but may need to be changed for several reasons.
If the numerical size of the dimensions of the model are very large or small, ZeroTest may need to be changed accordingly. For example, if a typical point in the model is Point[2, {3400, -7800}], it might be necessary to specify ZeroTest -> (Abs[#] < 10^-6 &).
If the model is large (eight or more bodies for 2D, four or more for 3D) solving the linear equations at each iteration begins to suffer from numerical error. Thus, it may be necessary to lower the convergence criteria.
The primary indication that the convergence criteria must be changed is that SolveMech returns a valid solution that is apparently correct, but an error message is generated claiming that convergence has failed after n iterations. If the model fails to converge and returns a solution that is obviously not valid, try to find an inconsistency in the constraint set or consult Chapter 13, Debugging Models.