Canonical RHS excerpt from the registered callable used for this benchmark cell. Expand it to verify the state equations; it is not a standalone runnable fixture.
Show canonical RHS excerpt
def _sigmoid(x: float | np.ndarray) -> float | np.ndarray:
return 1.0 / (1.0 + np.exp(-np.clip(x, -500.0, 500.0)))
def rhs(t, y):
d = np.empty(16)
rx, ry, rz = y[0], y[1], y[2]
rvx, rvy, rvz = y[3], y[4], y[5]
fx, fy, fz = y[6], y[7], y[8]
fvx, fvy, fvz = y[9], y[10], y[11]
J1, J2 = y[12], y[13]
ds1, ds2 = y[14], y[15]
# real target: coordinated turn (CT) model
d[0] = rvx
d[1] = rvy
d[2] = rvz
d[3] = -omega_real * rvy
d[4] = omega_real * rvx
d[5] = 0.0
# false target: CT with different turn rate
d[6] = fvx
d[7] = fvy
d[8] = fvz
d[9] = -omega_false * fvy
d[10] = omega_false * fvx
d[11] = 0.0
# jammer state 1 — periodic drive
d[12] = -J1 * inv_tau_j1 + A_j * _sigmoid(_K_SIG * np.sin(two_pi_fj * t))
# jammer state 2 — adapts when discrimination is high
d[13] = -J2 * inv_tau_j2 + J1 * (1.0 - _sigmoid(_K_SIG * (ds1 - 0.5)))
# discrimination score 1 — compares real vs false distance to expected
exp_x = x0_exp + vx0_exp * t
exp_y = y0_exp + vy0_exp * t
exp_z = z0_exp + vz0_exp * t
dist_real = np.sqrt(
(rx - exp_x) ** 2 + (ry - exp_y) ** 2 + (rz - exp_z) ** 2 + 1e-10
)
dist_false = np.sqrt(
(fx - exp_x) ** 2 + (fy - exp_y) ** 2 + (fz - exp_z) ** 2 + 1e-10
)
d[14] = (_sigmoid(_K_SIG * (dist_real - dist_false)) - ds1) * inv_tau_disc
# discrimination score 2 — based on jammer power
d[15] = (_sigmoid(_K_SIG * (J1 - J_disc_thresh)) - ds2) * inv_tau_disc2
return d- Parameters
- A_j = 10
- J_disc_thresh = 5
- _K_SIG = 50
- inv_tau_disc = 3.33333333333
- inv_tau_disc2 = 5
- inv_tau_j1 = 10
- inv_tau_j2 = 5
- omega_false = 0.03
- omega_real = 0.05
- two_pi_fj = 31.4159265359
- vx0_exp = -200
- vy0_exp = 0
- vz0_exp = 0
- x0_exp = 5000
- y0_exp = 2000
- z0_exp = 1000
- Initial condition
- y(0) = [5000, 2000, 1000, -200, 0, 0, …] [shape=(16,), min=-200, max=5100]
- Horizon
- t ∈ [0, 45]
Canonical RHS excerpt captured from the same registered callable used for the published benchmark. Frozen closure values are summarized below; helper imports and solver settings are intentionally omitted.