Forward dynamics: integrate the equations of motion
Source:R/kinetics-forward-dynamics.R
forwardDynamics.RdGiven a limb model, initial state and joint torques, integrates the motion with a fixed-step 4th-order Runge-Kutta scheme.
Arguments
- model
A
planar_limb_model(or any list with aforward_accel(q, qd, tau)andndof).- q0, qd0
Initial joint angles and velocities (length
ndof).- torque
Joint torques:
NULL(free/passive), a length-ndofconstant, ann_steps x ndofmatrix, or a function(t, q, qd) -> torque.- dt
Time step (s).
- n_steps
Number of integration steps.
Value
an fd_result: time, q, qd ((n_steps+1) x ndof), tau, and
energy (total mechanical energy per step).