analyses/utils.py
def root_explicit_dynamics(m: biorbd.Model(), q: np.array, qdot: np.array, qddot_joints: np.array):
    """
    Compute the root acceleration from the explicit dynamics

    Parameters
    ----------
    m : biorbd.Model
        biorbd model
    q : np.array
        generalized coordinates
    qdot : np.array
        generalized velocities
    qddot_joints : np.array
        generalized accelerations of the joints
    """
    mass_matrix_nl_effects = m.InverseDynamics(q, qdot, np.hstack((np.zeros((6,)), qddot_joints))).to_array()[:6]
    mass_matrix = m.massMatrix(q).to_array()
    qddot_base = -np.linalg.solve(mass_matrix[:6, :6], np.eye(6)) @ mass_matrix_nl_effects
    return qddot_base

    Compute the root acceleration from the explicit dynamics

    Parameters
    ----------
    m : biorbd.Model
        biorbd model
    q : np.array
        generalized coordinates
    qdot : np.array
        generalized velocities
    qddot_joints : np.array
        generalized accelerations of the joints
    
Compute the root acceleration from the explicit dynamics
Parameters

m : biorbd.Model
biorbd model
q : np.array
generalized coordinates
qdot : np.array
generalized velocities
qddot_joints : np.array
generalized accelerations of the joints
Compute the root acceleration from the explicit dynamics Parameters m : biorbd . Model biorbd model q : np . array generalized coordinates qdot : np . array generalized velocities qddot_joints : np . array generalized accelerations of the joints
def root_explicit_dynamics(m: biorbd.Model(), q: np.array, qdot: np.array, qddot_joints: np.array):
    mass_matrix_nl_effects = m.InverseDynamics(q, qdot, np.hstack((np.zeros((6,)), qddot_joints))).to_array()[:6]
    mass_matrix = m.massMatrix(q).to_array()
    qddot_base = -np.linalg.solve(mass_matrix[:6, :6], np.eye(6)) @ mass_matrix_nl_effects
    return qddot_base
def root_explicit_dynamics ( m : biorbd . Model ( ) , q : np . array , qdot : np . array , qddot_joints : np . array ) : mass_matrix_nl_effects = m . InverseDynamics ( q , qdot , np . hstack ( ( np . zeros ( ( 6 , ) ) , qddot_joints ) ) ) . to_array ( ) [ : 6 ] mass_matrix = m . massMatrix ( q ) . to_array ( ) qddot_base = - np . linalg . solve ( mass_matrix [ : 6 , : 6 ] , np . eye ( 6 ) ) @ mass_matrix_nl_effects return qddot_base
Compute the root acceleration from the explicit dynamics
Parameters
Compute the root acceleration from the explicit dynamics Parameters
"""
    Compute the root acceleration from the explicit dynamics

    Parameters
    ----------
    m : biorbd.Model
        biorbd model
    q : np.array
        generalized coordinates
    qdot : np.array
        generalized velocities
    qddot_joints : np.array
        generalized accelerations of the joints
    """
m
biorbd.Model()
q
np.array
qdot
np.array
qddot_joints
np.array