Main Content

addInitialGuessVariables

Assign kinematic variables from KinematicsSolver object as guesses

Description

addInitialGuessVariables(ks,ids) assigns the kinematic variables, ids, of the KinematicsSolver object, ks, as initial guesses.

The output of the addInitialGuessVariables object function is a table that lists the variables that have been assigned as guesses. Each row lists the details of a variable, such as the ID, joint type, block path, and unit.

You can assign only joint variables as initial guesses. When assigning joint variables, note that:

  • Since R2022a, you cannot specify the frame variables of the KinematicsSolver as initial guesses.

  • You must assign the four joint position variables of a spherical primitive as initial guesses simultaneously.

  • You must assign the three joint velocity variables of a spherical primitive as initial guesses simultaneously.

  • You cannot assign the joint position variable for the azimuth angle of a constant velocity primitive as a guess unless you also assign the corresponding bend angle.

  • You cannot assign the joint velocity variable for the azimuth velocity of a constant velocity primitive as a guess unless you also assign the corresponding bend angle velocity.

The solver uses the guess variables as initial conditions for the search to find a solution that satisfies the targets. When multiple solutions exist, the initial guess variables can help bias the solver to converge on the desired solution. Guess variables are optional but important solver guides in some kinematics problems.

Input Arguments

collapse all

Kinematics solver object, specified as a KinematicsSolver object that is the representation of the Simscape™ Multibody™ model used for kinematic analysis.

Example: ks = simscape.multibody.KinematicsSolver("DoublePendulumExample​'​')

Identifiers of the kinematic variables, specified as either a cell array of characters or string vector. The cell array of character and string vector can be 1-by-N or N-by-1, where N is a positive integer. Use the jointPositionVariables or jointVelocityVariables object function to show the IDs for joint variables. Use the frameVariables object function to show the IDs for frame variables.

Example: "j1.Rz.q", ["j1.Rz.q", "j2.Rz.q"], {'j1.Rz.q'}, or {'j1.Rz.q'; 'j2.Rz.q'};

Version History

Introduced in R2019a