meepmeep.numba3d.true_anomaly_o

Contents

meepmeep.numba3d.true_anomaly_o#

meepmeep.numba3d.true_anomaly_o(t, tpa, p, ex, ey, ez, w, dt, ep_table, ep_times, coeffs)[source]#

True anomaly at an array of times.

Accepts a scalar time t or a 1-D array of times and dispatches to the scalar (_true_anomaly_os()) or vector (true_anomaly_ov()) kernel at compile time (inside @njit) or at call time (pure Python).

Computed from the angle between the planet position vector and the eccentricity vector \((e_x, e_y, e_z)\). The mean anomaly, computed exactly from the periastron anchor, disambiguates the two branches of \(\arccos\) (the sign of \(\mathbf{r}\cdot\mathbf{v}\) would do the same in exact arithmetic, but it is of order e and is unreliable against the Taylor truncation noise for near-circular orbits).

Parameters:
tfloat or ndarray

Time(s) at which to evaluate the true anomaly.

tpafloat

Periastron time.

pfloat

Orbital period [days].

ex, ey, ezfloat

Components of the eccentricity vector pointing from the focus toward periastron. (-1, 0, 0) is the sentinel that eccentricity_vector() returns for near-circular orbits and triggers the fast path.

wfloat

Argument of periastron [radians]. Kept for signature parity with the gradient variant (true_anomaly_od); currently unused because the eccentricity vector is passed explicitly and the circular-orbit fast path needs only tpa and p.

dt, ep_table, ep_times, coeffs

Multi-expansion-point dispatch arrays from solve3d_orbit() / create_expansion_points().

Returns:
ffloat or ndarray

True anomaly at each input time [radians], in \([0, 2\pi)\). Arrays of shape (N,) for an array t.

Notes

The circular-orbit fast path skips the geometric chain to avoid division by a near-zero \(|\mathbf{e}|\). utils.eccentricity_vector emits the (-1, 0, 0) sentinel when e < 1e-5, and the test here matches that sentinel. On the fast path the true anomaly equals the mean anomaly, \(f = 2\pi(t - t_\mathrm{pa})/p\) - the same closed form used by the gradient variant true_anomaly_od, so the two stay in exact agreement for circular orbits.