flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
torque_gate Namespace Reference

Functions

 qmul (a, b)
 
 rotmat (q)
 
 make_sim (w0, tau, dt)
 
 run (s, dt, nsteps)
 
 reference (w0_world, q0, tau, T)
 
 gate_a ()
 
 gate_b ()
 
 gate_c ()
 

Variables

 I = np.array([0.40, 0.65, 0.90])
 
float INV_I = 1.0 / I
 
 a
 
 b
 
 c
 

Detailed Description

R2 gate: dem's external-TORQUE entry point (set_external_torques).

Two claims, both at OMP_NUM_THREADS=1 (dem's multithreaded step is nondeterministic -- ยง6.0b).
One free body, no gravity, no contacts, no walls: the predictor's rotational update is the whole
physics, so a miss is the torque term and nothing else.

  A. PRINCIPAL AXIS -- EXACT. A constant world torque about a principal axis of a body whose
     angular velocity is already along that axis keeps w x (I w) identically zero, so the discrete
     update degenerates to w_{n+1} = w_n + (tau/I) dt and the trajectory is the closed form
     w(t) = tau t / I with NO time-stepping error at all. Anything but round-off here is a wiring
     bug (wrong inertia component, body/world frame confusion, torque dropped).

  B. NON-PRINCIPAL AXIS -- vs a scipy reference. A constant WORLD torque about a tilted axis on a
     body with three distinct principal moments: the body frame tumbles under it, so tau_body(t)
     is time dependent and the trajectory is genuinely Euler's equations. Reference: solve_ivp
     (DOP853, rtol/atol 1e-12) on the SAME system in dem's own convention --
         q = (x,y,z,w), R(q) maps BODY -> WORLD,  dq/dt = 0.5 (0, w_world) (x) q
         dw_b/dt = invI (R^T tau_world - w_b x I w_b)
     dem's integrator is semi-implicit Euler, so the claim is a dt-CONVERGENCE ladder (first
     order), taken at COARSE dt where truncation dominates -- below dt ~ 1e-3 the float32 state
     floor (gate A) is already larger than the truncation error and the ladder inverts, which is
     itself reported.

  C. Angular-momentum bookkeeping, free: dL_world/dt = tau_world exactly in the continuum, so
     |L(t) - L(0) - tau t| is a second, convention-independent read of the same error.

Function Documentation

◆ qmul()

torque_gate.qmul (   a,
  b 
)

Definition at line 40 of file torque_gate.py.

Referenced by reference().

◆ rotmat()

torque_gate.rotmat (   q)

Definition at line 49 of file torque_gate.py.

Referenced by gate_c(), and reference().

◆ make_sim()

torque_gate.make_sim (   w0,
  tau,
  dt 
)
One free unit-mass body with the principal inertia I, spinning at w0 under world torque.

Definition at line 57 of file torque_gate.py.

Referenced by gate_a(), gate_b(), and gate_c().

◆ run()

torque_gate.run (   s,
  dt,
  nsteps 
)

Definition at line 71 of file torque_gate.py.

Referenced by gate_a(), gate_b(), and gate_c().

◆ reference()

torque_gate.reference (   w0_world,
  q0,
  tau,
  T 
)

Definition at line 79 of file torque_gate.py.

References qmul(), and rotmat().

Referenced by gate_b().

◆ gate_a()

torque_gate.gate_a ( )

Definition at line 97 of file torque_gate.py.

References make_sim(), and run().

◆ gate_b()

torque_gate.gate_b ( )

Definition at line 126 of file torque_gate.py.

References make_sim(), reference(), and run().

◆ gate_c()

torque_gate.gate_c ( )

Definition at line 163 of file torque_gate.py.

References make_sim(), rotmat(), and run().

Variable Documentation

◆ I

torque_gate.I = np.array([0.40, 0.65, 0.90])

Definition at line 36 of file torque_gate.py.

◆ INV_I

float torque_gate.INV_I = 1.0 / I

Definition at line 37 of file torque_gate.py.

◆ a

torque_gate.a

Definition at line 183 of file torque_gate.py.

◆ b

torque_gate.b

Definition at line 183 of file torque_gate.py.

◆ c

torque_gate.c

Definition at line 183 of file torque_gate.py.