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_epsuch 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_ep
int Number of expansion points. Must be odd so that one expansion point lands at the orbit midpoint.
- e
float 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.- tres
int, optional Resolution of the time-to-expansion-point lookup table (number of bins per period).
- n_ep
- Returns:
- ep_times
ndarray Times of the expansion points (expansion centers), as fractions of the orbital period in
[0, 1].- change_times
ndarray 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).- dt
float Width of a single time-to-expansion-point table bin,
1 / tres.- ep_table
ndarrayofint Time-to-expansion-point table mapping each of the
trestime bins within one folded period to the index of the expansion point that should evaluate it.
- ep_times
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 spaced2*pi/n_epapart in anomaly even though the grid holds onlyn_ep - 1distinct 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.