Integrator API¶
BiDirectionalInterpolator
¶
Bases: BatchableObject
Dense interpolator with forward and backward coverage from one reference epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t0_jd1
|
Float[Array, ...]
|
Reference epoch in split Julian Date form. |
required |
t0_jd2
|
Float[Array, ...]
|
Reference epoch in split Julian Date form. |
required |
t_min_jd1
|
Float[Array, ...]
|
Lower bound of the covered epoch range, in split Julian Date form. |
required |
t_min_jd2
|
Float[Array, ...]
|
Lower bound of the covered epoch range, in split Julian Date form. |
required |
t_max_jd1
|
Float[Array, ...]
|
Upper bound of the covered epoch range, in split Julian Date form. |
required |
t_max_jd2
|
Float[Array, ...]
|
Upper bound of the covered epoch range, in split Julian Date form. |
required |
sol_fwd
|
Solution
|
Dense forward solution from the reference epoch toward later times. |
required |
sol_bwd
|
Solution
|
Dense backward solution from the reference epoch toward earlier times. |
required |
Notes
The interpolator stores two dense solutions. Evaluation picks sol_fwd for epochs at or after the reference epoch, and sol_bwd for earlier epochs.
shape
property
¶
Batch shape of the interpolator.
is_covered(jd1, jd2, grid=False)
¶
Check whether epochs are inside the covered range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jd1
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
jd2
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
grid
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Bool[Array, ...]
|
Coverage mask for the queried epochs. |
Notes
Vectorize :func:difforb.integrator.integrator._is_covered_scalar.
evaluate(jd1, jd2, grid=False)
¶
Evaluate the interpolated state at the requested epochs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jd1
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
jd2
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
grid
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Float[Array, '... 3'], Float[Array, '... 3']]
|
Interpolated Cartesian position and velocity in |
Notes
Vectorize :func:difforb.integrator.integrator._evaluate_scalar.
__call__(jd1, jd2, grid=False)
¶
Evaluate the interpolated state at the requested epochs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jd1
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
jd2
|
Float[Array, ...]
|
Query epochs in split Julian Date form. |
required |
grid
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Float[Array, '... 3'], Float[Array, '... 3']]
|
Interpolated Cartesian position and velocity in |
Notes
This is a thin alias of :evaluate.
NumericalIntegrator(method='IAS15', tol=1e-09, max_steps=4096, *, rtol=None, atol=None, initial_step=1e-06, ias15_adaptive_mode=2, ias15_safety_factor=0.25, ias15_min_step=0.0)
¶
Bases: Module
Numerical propagator for orbit integration.
This wrapper provides a compact user-facing API around the underlying diffrax solvers and the custom IAS15
implementation. It builds the solver object, the step-size controller, and return the bidirectional dense-output integrator
:class:BiDirectionalInterpolator.
Notes
The current implementation always enables dense output and uses forward-mode differentiation internally. These behaviors are part of the runtime contract of :meth:__call__ and are therefore not exposed as constructor options.
Create a numerical integrator with method-specific adaptive controls.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
(IAS15, DOPRI8, DOPRI5)
|
Integration method name. The value is case-insensitive and is normalized to upper case internally.
|
"IAS15"
|
tol
|
float or None
|
Compatibility shorthand tolerance. For
For |
1e-9
|
max_steps
|
int
|
Maximum number of adaptive steps allowed in each forward or backward solve. |
4096
|
rtol
|
float or None
|
Relative tolerance for If both |
None
|
atol
|
float or None
|
Absolute tolerance used by the adaptive step controller. For For |
None
|
initial_step
|
float
|
Absolute value of the initial trial step size, in days. The propagator always starts the forward solve with |
1e-6
|
ias15_adaptive_mode
|
(1, 2)
|
Adaptive step-size formula used by
This option is only valid when |
1
|
ias15_safety_factor
|
float
|
Acceptance threshold and growth limiter for the IAS15 adaptive controller. Larger values make the controller more conservative. This option is only valid when |
0.25
|
ias15_min_step
|
float
|
Lower bound for the next proposed IAS15 step size, in days. Use |
0.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
Raised when the integration method is unknown, when tolerance combinations are incomplete or incompatible with the selected method, or when a numeric option violates its valid range. |
Notes
Method-specific options are validated eagerly during construction. In particular, IAS15-only options are rejected for non-IAS15 methods instead of being silently ignored.
__call__(force_model, y0, t0_jd1, t0_jd2, t_start_jd1, t_start_jd2, t_end_jd1, t_end_jd2, grid=False)
¶
Integrate the orbit and build dense interpolators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_model
|
ForceModel
|
Force model or batch of force models used by the ODE right-hand side. |
required |
y0
|
Float[ArrayLike, '... 6']
|
Initial Cartesian state or batch of states at the reference epoch, with position first and velocity second. |
required |
t0_jd1
|
Float[ArrayLike, ...]
|
Reference epoch or batch of reference epochs in split Julian Date form. |
required |
t0_jd2
|
Float[ArrayLike, ...]
|
Reference epoch or batch of reference epochs in split Julian Date form. |
required |
t_start_jd1
|
Float[ArrayLike, ...]
|
One end of the covered interval, in split Julian Date form. |
required |
t_start_jd2
|
Float[ArrayLike, ...]
|
One end of the covered interval, in split Julian Date form. |
required |
t_end_jd1
|
Float[ArrayLike, ...]
|
The other end of the covered interval, in split Julian Date form. |
required |
t_end_jd2
|
Float[ArrayLike, ...]
|
The other end of the covered interval, in split Julian Date form. |
required |
grid
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
BiDirectionalInterpolator
|
Dense interpolator or batch of interpolators for the requested propagation spans. |
Notes
The returned interpolator covers the full closed interval between t_start and t_end, even when the reference epoch lies inside that interval. Forward propagation covers epochs at or after t0. Backward propagation covers epochs before t0.