| context phys: Phys | phys.system(string) -> System | Create a new physics world with contact mode "nsc" (non-smooth complementarity) or "smc" (smooth penalty contact). |
| Phys | phys.assert_close(float, float, float) -> void | phys.print(string) -> void | phys.version() -> string | Assert |actual - expected| <= tol (exiting 3 on failure), print a line, or return the host version string. |
| System | s.gravity(float, float, float) -> System | s.timestep(float) -> System | Set world gravity vector in m/s2 (default 0, 0, -9.81) and fixed integration time step dt in seconds. |
| System | s.integrator(string) -> System | s.solver(string, int) -> System | Select time integrator (euler, trapezoidal, hht, newmark) and solver (psor, pjacobi, pminres, bb, apgd, minres, sparse_lu, sparse_qr) with max iterations. |
| System | s.newton(int, float, float) -> System | s.hht_alpha(float) -> System | Configure implicit integrator Newton iterations and relative/absolute tolerances, or HHT numerical damping alpha (in [-1/3, 0]; requires integrator("hht") first). |
| System | s.bounce_speed(float) -> System | s.collision_margins(float, float) -> System | Set minimum approach speed (m/s, default 0.15) for restitution and NSC collision envelope/margin in meters (default 0.03, 0.01). |
| System | s.material(string, float, float) -> System | s.stiffness(string, float, float) -> System | Define a named contact material with friction and restitution, and set SMC Young's modulus (Pa) and Poisson ratio. |
| System | s.ground(string) -> Body | s.floor(string, string) -> Body | Create a fixed non-colliding ground anchor or a fixed 200x200x2 m collision floor slab with top face at z = 0 using the named material. |
| System | s.box(string, float, float, float, float) -> Body | s.sphere(string, float, float) -> Body | s.cylinder(string, float, float, float) -> Body | Create a rigid box (sx, sy, sz, density), sphere (radius, density), or local-y-axis cylinder (radius, height, density). |
| System | s.revolute(string, Body, Body, float, float, float, float, float, float) | s.prismatic(...) | s.cylindrical(...) -> Joint | Connect bodies A and B with a hinge, sliding guide, or cylindrical joint at world point (px, py, pz) along world axis (ax, ay, az). |
| System | s.universal(string, Body, Body, float, float, float, float, float, float, float, float, float) -> Joint | Create a Cardan universal joint at (px, py, pz) with perpendicular cross axes (ax, ay, az) in A and (bx, by, bz) in B. |
| System | s.gear(string, Body, Body, float, float, float, float) -> Joint | Couple shafts of A and B along world axis (ax, ay, az) with transmission ratio (B turns at -ratio * A). |
| System | s.lock(string, Body, Body, float, float, float) | s.spherical(string, Body, Body, float, float, float) -> Joint | Weld bodies A and B together or connect them with a ball-and-socket joint at world point (px, py, pz). |
| System | s.distance(string, Body, Body, float, float, float, float, float, float) -> Joint | Constrain the distance between world anchor point (ax, ay, az) on A and (bx, by, bz) on B. |
| System | s.spring(string, Body, Body, float, float, float) | s.spring_at(string, Body, Body, float, float, float, float, float, float, float, float, float) -> Joint | Attach a linear spring-damper (k, c, rest_length) between body centers or between world anchor points on A and B. |
| System | s.motor_speed(string, Body, Body, float, float, float, float, float, float, string) | s.motor_angle(...) | s.motor_torque(...) -> Joint | Drive rotation of B relative to A about (px, py, pz) and axis (ax, ay, az) using a time expression expr(t). |
| System | s.motor_position(string, Body, Body, float, float, float, float, float, float, string) | s.motor_linear_speed(...) | s.motor_force(...) -> Joint | Drive linear translation of B relative to A along axis (ax, ay, az) through (px, py, pz) using expr(t). |
| System | s.record(string, string) -> System | s.record_every(int) -> System | s.save_csv(string) -> System | Register comma-separated columns for a named body or joint, subsample every n-th step, and write the logged CSV file. |
| System | s.step() -> System | s.run(float) -> System | s.time() -> float | s.energy() -> float | s.contacts() -> int | Advance one step or until t_end, or query current simulation time, total mechanical energy (kinetic + gravity + springs), or active contact count. |