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 a copy of a joint descriptor in the model's joint ordering.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(linkage_dynamic_model), | intent(in) | :: | this | |||
| integer(kind=int32), | intent(in) | :: | index |
The one-based joint index, not a moving-body index. |
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 returned simulation points, including the initial point. |
||
| 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 one-based moving body whose absolute world-z planar angle is prescribed (legacy input). Only planar models support this selector. Mutually exclusive with prescribed_joint. |
|
| procedure(linkage_prescribed_motion), | intent(in), | optional, | pointer | :: | prescribed_motion |
The scalar motion callback. Supply exactly one of prescribed_body or prescribed_joint with this associated procedure pointer. |
| real(kind=real64), | intent(out), | optional, | allocatable, dimension(:,:) | :: | multipliers |
Constraint multipliers for each returned simulation point, with the final column computed by a noncommitting look-ahead step. When motion is prescribed, the last row is the required actuator torque (angular input) or axial force (prismatic input), positive in the direction of increasing prescribed coordinate. Joint reactions exclude it. |
| 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. |
|
| integer(kind=int32), | intent(in), | optional | :: | prescribed_joint |
The one-based revolute or prismatic joint in model joint order (serial: proximal joint of link i; parallel: mechanism joint order). Supported for planar and spatial models. Revolute input is the child joint frame's rotation relative to the parent about its positive z-axis, in radians. Prismatic input is the child attachment origin's signed separation from the parent along the parent's positive joint z-axis, in model length units. Zero is defined by coincident joint frames, not by the initial configuration. The initial coordinate must match the callback at initial time; initial velocities should match its time derivative. Angular residuals are wrapped modulo 2*pi; use time steps resolving less than pi radians of joint rotation. Constraints are built internally. |
The state at the initial time followed by the state after each completed integration step.