meepmeep.numba3d.create_expansion_points

meepmeep.numba3d.create_expansion_points#

meepmeep.numba3d.create_expansion_points(n_ep: int, e: float, quantity: str = 'ea', tres: int = 200)[source]#

Place expansion points along one orbital period and build the time-to-expansion-point table.

An expansion point is a point along the orbit that serves as the center of a local 5th-order Taylor expansion of the planet’s trajectory in time. This function distributes n_ep such expansion centers over a single period and records where the dispatch should switch from one expansion point to the next.

The expansion points are the expansion centers; the boundaries between adjacent expansion points’ regions of validity are a separate concept, returned as change_times.

Parameters:
n_epint

Number of expansion points. Must be odd so that one expansion point lands at the orbit midpoint.

efloat

Orbital eccentricity, used by the 'ea' and 'ta' placement strategies to cluster expansion points near periastron.

quantity{‘mm’, ‘ea’, ‘ta’}, optional

Expansion-point placement strategy: 'mm' spaces expansion points uniformly in mean motion (time), 'ea' in eccentric anomaly (default), 'ta' in true anomaly.

tresint, optional

Resolution of the time-to-expansion-point lookup table (number of bins per period).

Returns:
ep_timesndarray

Times of the expansion points (expansion centers), as fractions of the orbital period in [0, 1].

change_timesndarray

Boundary times at which the time-to-expansion-point dispatch switches from one expansion point to the next, i.e. the edges of each expansion point’s region of validity (one fewer than ep_times).

dtfloat

Width of a single time-to-expansion-point table bin, 1 / tres.

ep_tablendarray of int

Time-to-expansion-point table mapping each of the tres time bins within one folded period to the index of the expansion point that should evaluate it.

Notes

The 'ea' and 'ta' grids are not uniform in their anomaly, and in particular do not reduce to the 'mm' grid at zero eccentricity. The expansion points are spaced 2*pi/n_ep apart in anomaly even though the grid holds only n_ep - 1 distinct expansion points (the last slot is the periodic image of the first), and the midpoint expansion point is pinned at anomaly pi, which is not a multiple of that spacing. The leftover space collects as a 1.5x-wide gap on each side of the midpoint expansion point, whose region of validity is therefore twice as wide as the others’. This is benign for accuracy: the midpoint expansion point sits at apoastron, where the planet moves slowest and the Taylor truncation error is smallest, while the remaining expansion points are spaced tighter than uniform near periastron, where the error budget is actually spent.