phyz-rigid
Featherstone articulated rigid-body dynamics for phyz.
The classical O(n) algorithms, operating on
phyz-model's Model and State.
| Function | Computes | Cost |
|---|---|---|
aba |
forward dynamics qdd = f(q, v, τ) |
O(n) |
aba_with_external_forces |
forward dynamics with per-body wrenches | O(n) |
rnea |
inverse dynamics τ = f(q, v, qdd) |
O(n) |
crba |
joint-space mass matrix M(q) |
O(n²) |
forward_kinematics |
body transforms into state.body_xform |
O(n) |
kinetic_energy, potential_energy, total_energy |
conserved quantities | O(n) |
Example
use ;
use ModelBuilder;
use ;
let model = new
.gravity
.dt
.add_revolute_body
.build;
let mut state = model.default_state;
state.q = 0.3;
// Semi-implicit Euler: this crate provides the dynamics, you write the loop.
for _ in 0..500
let e = total_energy;
This crate provides the dynamics, not the time loop — the example above writes
its own integrator. If you want a ready-made stepper, phyz::sim has
Simulator with semi-implicit Euler and RK4 solvers, and
phyz-guardian adds adaptive time-stepping
and conservation monitoring on top of these primitives.
Part of phyz
phyz is an open-source differentiable
multi-physics simulation workspace in pure Rust. Each crate is independent —
adding this one does not pull in the rest.
Licensed under MIT.