Main Content

solve

Run kinematic analysis for KinematicsSolver object

Description

[outputs,statusFlag,targetFlags,targets] = solve(ks,targets,initialGuesses) solves, or attempts to solve, the kinematic problem posed in the KinematicsSolver object ks. The unknowns are the variables assigned as outputs in ks. Their solution hinges on the initial position constraints of the model and on the position targets of the object. When multiple solutions exist, position guesses bias the solver toward one over the others.

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​'​')

Desired values of the target variables of ks. Specify the values in the order of the variables as shown in the targetVariables table. The values are interpreted in the units listed in the table. If no target variables exist, enter an empty vector. If neither target nor initial guess variables exist, enter an empty vector or omit the argument altogether.

Example: '[0 45 30]'

Data Types: double

Values of the initial guess variables of ks. Specify the values in the order of the variables as shown in the initialGuessVariables table. The values are interpreted in the units listed in that table. If no initial guess variables exist, enter an empty vector or omit the argument altogether.

Example: '[10 25]'

Data Types: double

Output Arguments

collapse all

Computed values of the output variables. The variables show in the order of their ranking in the outputVariables table. They are each in the units listed there.

The solution may not satisfy all position targets or even all model constraints. Check the statusFlag argument for an overview of the issues encountered in the solution.

Data Types: double

Flag with the overall status of the analysis results. A positive flag means that all target variables and model constraints have been satisfied. A negative flag means that one or more have not. See the targetFlags argument to check which of the targets the solver may have missed. See the targets argument to see the actual values reached for each.

  • 1 - All model constraints and target variables are satisfied.

  • 2 - All model constraints and target variables are satisfied, but the mechanism is in a singular configuration.

  • -1 - All model constraints are satisfied, but one or more target variables are not satisfied.

  • -2 - All model constraints are satisfied, but one or more target variables are not satisfied, and the mechanism is in a singular configuration.

  • -3 - The solution is invalid because one or more model constraints cannot be satisfied. The output variables are set to NaN.

  • -4 - The solution is invalid because the mechanism is in a singular configuration. The output variables are set to NaN.

Note

In a singular configuration, the mechanism's motion is restricted and certain velocities cannot be computed. The most common type of kinematic singularity is due to gimbal lock in Bearing Joint, Bushing Joint, or Gimbal Joint. In addition, mechanisms with a Constant Velocity Joint or a belt-cable network may also have kinematic singularities.

Data Types: double

Logical flags with the status of each target variable. A logical 1 indicates that a target has been satisfied. A logical 0 indicates that it has been missed. The flags show in the order given in the targetVariables table of the object. The vector is empty in kinematic problems without target variables.

Data Types: double

Computed values of the target variables of ks. These are the same target variables specified in the input arguments. The variables show in the order of their ranking in the targetVariables table. They are each in the units listed there.

Data Types: double

Version History

Introduced in R2019a