Previous section-----Next section

9.1.2 Solving for One Parameter

The coupled system building and solving functions.

Mech's SetCouple and SolveCouple functions are now used to adjust the length of the drive bar bar2. In the four-bar's current configuration, the X coordinate of point 3 on the center bar is 0.898 at T = 0.1. The following example uses a coupled system to find the length of the drive bar that causes the X coordinate of point 3 to be equal to 0.8 at T = 0.1.

Here is the current X coordinate of point 3 on the center bar.

SetCouple basically adds a degree of freedom to the mechanism model by allowing a parameter to become a dependent variable, and also adds an equation to constrain the new degree of freedom. The following command essentially says "adjust the value of bar2 such that the X coordinate of point 3 on the center bar is equal to 0.8 at the current default time T = 0.1."
The current default initial guesses obtained from LastSolve[] are used as the initial guesses for the CoupleSystem, unless otherwise specified. The current value of the parameter bar2 is used for its initial guess.

This builds the CoupleSystem object.

SetCouple returns a CoupleSystem object that is solved with SolveCouple. The CoupleSystem object contains a new set of constraint equations that include all of the constraints in the current model, plus one. The list of rules returned by SolveCouple is of the same form as the rules returned by SolveMech.

This solves the CoupleSystem object and finds a new value of bar2.

The new value of the parameters bar2 is added to the current parameters list.

This shows that the desired condition is satisfied.

Options for SolveCouple.

Without building a new CoupleSystem object, cpsys can be re-solved at a new value of time by using the InitialCondition option. Note that the InitialCondition option expects a setting of the form Time -> t, not T -> t.

The CoupleSystem is solved again with a new value of time.

The contents of the current parameters list are updated.