Skip to content

novaphy.eval_mass_matrix

Return per-articulation generalized mass matrices, or fill a provided output buffer.

def eval_mass_matrix(
    model: Model,
    state: SimState,
    H: np.ndarray | None = None,
    J: object | None = None,
    body_I_s: object | None = None,
    joint_S_s: object | None = None,
    mask: np.ndarray | None = None,
) -> np.ndarray | None

J, body_I_s, and joint_S_s are accepted for Newton-shaped call compatibility and are currently ignored by the NovaPhy binding.

mask, when supplied, contains one selection flag per articulation. With H=None, the function returns a float32 array shaped (articulation_count, rows, cols), or None when the model has no articulations. A supplied output must be a writable C-contiguous float32 array with the exact returned shape; the function fills it and returns that array.

Example

H = novaphy.eval_mass_matrix(model, state)

See Also