TraceConfig

class disco.TraceConfig(t_final, output_freq=None, stopping_conditions=None, t_initial=<Quantity 0. s>, h_initial=<Quantity 1. ms>, rtol=0.01, integrate_backwards=False, iters_max=None, reorder_freq=25)[source]

Bases: object

Configuration for running the tracing code.

Initialize a TraceConfig instance.

Parameters:
t_initial: scalar with time units

Start time of integration

t_final: scalar with time units

end time of integration (set to inf seconds if you want to stop purely based on stopping conditions)

output_freq: int or None

How frequently (in iterations) to store output. Setting this to non-None means memory will accumulate with time.

stopping_conditions: list of callables

List of callables (functions) that return bools. Arguments are y, t, and field_model.

h_initial: scalar with time units

Initial step size in time (leave as positive even if integrating backwards)

rtol: float

Relative tolerance for adaptive integration

integrate_backwards: bool

Set to True to integrate backwards in time

Examples

Integrate between 0 and 10 seconds.

>>> config = disco.TraceConfig(t_final=10 * units.s)

Integrate backwards between 0 and -30 seconds.

>>> from astropy import units
>>> config = disco.TraceConfig(
      t_final=-30 * units.s,
      integrate_backwards=True
    )