meepmeep.numba3d.true_anomaly_od

meepmeep.numba3d.true_anomaly_od#

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

True anomaly and its orbital-parameter derivatives.

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

Computed from the geometric angle between the planet position vector and the eccentricity vector \((e_x, e_y, e_z)\), with the mean anomaly (computed exactly from the periastron anchor) resolving the two branches of \(\arccos\).

Parameters:
tfloat or ndarray

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

tpafloat

Periastron time anchoring the expansion-point grid (see _pos_osd()).

pfloat

Orbital period [days].

ex, ey, ezfloat

Components of the eccentricity vector. (-1, 0, 0) is the sentinel produced by eccentricity_vector() for near-circular orbits and triggers the closed-form fast path.

wfloat

Argument of periastron [radians]. Kept for signature parity with the base function; currently unused inside this routine because the eccentricity vector is passed explicitly.

dt, ep_table, ep_times, coeffs, dcoeffs

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

Returns:
ffloat or ndarray

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

dfndarray

Gradient w.r.t. (tc, p, a, i, e, w, lan). Shape (7,) for a scalar t, (N, 7) for an array t. The ex, ey, ez, w inputs are treated as known constants - they are functions of the orbital parameters but the dependency is captured implicitly through the geometric chain rule on the position vector.

Notes

At the singular configurations edp = +/-1 (edp = cosine of the angle between position and eccentricity vector) the analytic gradient diverges and is replaced by zero. The circular-orbit fast path uses the mean-anomaly identity \(f = 2\pi(t - t_\mathrm{pa}) / p\).