This simulator models a 3U Low Earth Orbit nanosatellite with standard mass m = 4.0 kg and principal inertia tensor I = diag(0.0419, 0.0419, 0.0067) kg·m². Actuators include 3-axis orthogonal reaction wheels (max torque 5 mN·m, max speed 6500 RPM) and 3-axis magnetorquer coils (max dipole 0.2 A·m²).
Attitude is parametrized by unit quaternion q = [q0, q1, q2, q3] satisfying ||q|| = 1. Solved numerically via 4th-order Runge-Kutta (RK4) integration coupled with Euler's rotational equations of motion:
I · dω/dt = τ_ext + τ_mtq - τ_rw - ω × (I·ω + h_rw)
m = -k · dB/dt. Rapidly removes tip-off tumble spin energy post-deployment.s.m = -k · (B × h_rw) / ||B||².Run headless tests locally: node test/test_aocs_physics.mjs. Tests verify 100% convergence across quaternion algebra, B-dot kinetic energy dissipation, and pointing accuracy.