solve
Description
[
solves, or attempts to solve, the kinematic problem posed in the outputs
,statusFlag
,targetFlags
,targets
] = solve(ks
,targets
,initialGuesses
)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
ks
— Kinematics solver object
KinematicsSolver
object
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'')
targets
— Desired values of target variables
vector of doubles
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
initialGuesses
— Values of initial guess variables
vector of doubles
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
outputs
— Computed values of output variables
vector of doubles
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
statusFlag
— Flag with overall status of solution
scalar
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
targetFlags
— Logical flags with status of each target variable
logical vector
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
targets
— Computed values of target variables
numerical vector
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
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other bat365 country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)