Defines the variational-integrator representation of a linkage. Body index zero in a joint descriptor denotes the fixed ground link.
Constructs a dynamic model from a serial linkage and a compatible set of joint variables. Every serial link is treated as a moving rigid body; the proximal joint of the first link is attached to ground.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(serial_linkage), | intent(in) | :: | mechanism |
The serial linkage to convert. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
One joint variable for each link. |
The resulting dynamic model.
Constructs a dynamic model from a parallel or planar linkage. The mechanism's base link remains fixed and all other links become moving maximal-coordinate rigid bodies.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | mechanism |
The parallel linkage to convert. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
The complete, constraint-compatible joint-variable array. |
The resulting dynamic model.
Adds an extensible axial force element to the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the element. |
||
| class(axial_force_element), | intent(in) | :: | element |
The axial element to add. Its body indices must identify two distinct valid bodies or ground. |
Adds a validated linear axial damper to the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the damper. |
||
| type(linear_damper), | intent(in) | :: | element |
The damper to add. Its damping coefficient must be nonnegative. |
Adds a validated linear axial spring to the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the spring. |
||
| type(linear_spring), | intent(in) | :: | element |
The spring to add. Its stiffness and free length must be nonnegative. |
Adds a validated linear torsional damper to the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the damper. |
||
| type(torsional_damper), | intent(in) | :: | element |
The damper to add. Its damping coefficient must be nonnegative. |
Adds an extensible torsional element bound to a revolute joint.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the element. |
||
| class(torsional_force_element), | intent(in) | :: | element |
The torsional element to add. Its one-based joint index must refer to a revolute joint in this model. |
Adds a validated linear torsional spring to the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(inout) | :: | this |
The model that receives the spring. |
||
| type(torsional_spring), | intent(in) | :: | element |
The spring to add. Its stiffness must be nonnegative. |
Evaluates every joint and planar constraint for a supplied state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model whose constraints are evaluated. |
||
| type(variational_state), | intent(in) | :: | state |
The body state at which the constraints are evaluated. |
The constraint residual vector in the model's constraint ordering.
Gets the number of axial force elements in the model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
The number of stored axial elements.
Gets instantaneous lengths, rates, and signed forces for axial elements.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model containing the elements. |
||
| type(variational_state), | intent(in) | :: | state |
The state at which each element is evaluated. |
One result for each axial element, in insertion order.
Gets the number of moving rigid bodies in the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
The number of moving bodies; ground is not included.
Gets the number of scalar constraints in the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
The total number of joint and planar-body constraints.
Gets a copy of the constraint-compatible state used to construct the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
A copy of the model's constraint-compatible initial state.
Gets the number of joints represented by the dynamic model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
The joint count.
Converts one time step's constraint multipliers into the force and moment exerted by every joint on its child link. Multipliers associated with the planar-body constraints or a prescribed-motion constraint are excluded.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
||
| type(variational_state), | intent(in) | :: | state |
The state corresponding to the supplied multipliers. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | multipliers |
The constraint multiplier vector returned by the integrator. |
One world-frame reaction wrench for each joint, in mechanism order.
Gets the number of torsional force elements in the model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model. |
The number of stored torsional elements.
Gets instantaneous angles, twist rates, and torques for torsional elements.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this |
The dynamic linkage model containing the elements. |
||
| type(variational_state), | intent(in) | :: | state |
The state at which each element is evaluated. |
One result for each torsional element, in insertion order.
Integrates the linkage dynamics under an optional uniform world-frame gravitational acceleration and optional constant body loads.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in), | target | :: | this |
The dynamic linkage model to integrate. |
|
| type(variational_integrator), | intent(in) | :: | integrator |
The variational integrator used to advance the model. |
||
| real(kind=real64), | intent(in) | :: | dt |
The time step in seconds. |
||
| integer(kind=int32), | intent(in) | :: | ntime |
The number of time steps to integrate. |
||
| type(variational_state), | intent(in), | optional | :: | initial_state |
An optional starting state; the model's initial state is used when this argument is absent. |
|
| real(kind=real64), | intent(in), | optional, | dimension(3) | :: | gravity |
Optional constant gravitational acceleration in world coordinates. |
| real(kind=real64), | intent(in), | optional, | dimension(:,:) | :: | body_force |
Constant 3-by-nbody world-frame force array. |
| real(kind=real64), | intent(in), | optional, | dimension(:,:) | :: | body_torque |
Constant 3-by-nbody body-frame torque array. |
| integer(kind=int32), | intent(in), | optional | :: | prescribed_body |
The moving body whose absolute planar angle is prescribed. |
|
| procedure(linkage_prescribed_motion), | intent(in), | optional, | pointer | :: | prescribed_motion |
The prescribed absolute planar angle as a function of time. |
| real(kind=real64), | intent(out), | optional, | allocatable, dimension(:,:) | :: | multipliers |
Constraint multipliers for each completed time step. When a motion is prescribed, the last row is the required motor torque. |
| class(*), | intent(inout), | optional, | target | :: | args |
A mechanism for the caller to pass information to/from the user-defined routines (e.g. presribed_motion). |
| type(variational_integrator_info), | intent(out), | optional | :: | info |
Optional convergence diagnostics aggregated over the trajectory. |
The state at the initial time followed by the state after each completed integration step.