Solver parameters¶
dexter.simulate.params
¶
Helper types to pass parameters to the solver.
Classes:
-
SteppingMethod–Sets the solver's stepping method.
-
SolverParams–Container for the solver parameters.
-
IntersectParams–Parameters for the calculation of Poincare maps.
SteppingMethod()
¶
The method used to calculate the next optimal step.
See classmethods for the different stepping methods.
EnergyAdaptiveStep(rel_tol: float = 1e-08, abs_tol: float = 1e-10) -> SteppingMethod
classmethod
¶
Forces the step size to be small enough so that the Energy difference from step to step is under a certain threshold.
Parameters:
ErrorAdaptiveStep(rel_tol: float, abs_tol: float) -> SteppingMethod
classmethod
¶
Classic RK error estimation : Adjust the step size to minimize the local truncation error.
Note that the errors are not normalized, therefore the tolerances must be set according
to the scale of the system’s time derivatives. A good starting point is
rel_tol=1e-17 and abs_tol=1e-19.
Parameters:
SolverParams(method: SteppingMethod | None = None, max_steps: int = 1000000, first_step: float = 0.1, safety_factor: float = 0.9)
¶
Container for the solver parameters.
Parameters:
-
method(SteppingMethod | None, default:None) –The optimal step calculation method.
-
max_steps(int, default:1000000) –The maximum amount of steps a particle can make before terminating its integration.
-
first_step(float, default:0.1) –The initial time step for the RKF45 adaptive step method in Normalized Units. The value is empirical.
-
safety_factor(float, default:0.9) –The safety factor of the solver. Should be less than $1.0$.
Example
IntersectParams(intersection: Intersection, angle: float, turns: int, directionality: Directionality = 'Initial')
¶
Defines all necessary parameters for the Particle.intersect routine.
Parameters:
-
intersection(Intersection) –The surface of section $\Sigma$, defined by an equation $x_i=\alpha$, where $x_i = \theta$ or $\zeta$.
-
angle(float) –The constant that defines the surface of section.
-
turns(int) –The number of intersections to calculate.
-
directionality(Directionality, default:'Initial') –The method with which Poincare intersections are recorded.
Example
Attributes:
-
intersection(Intersection) –The surface of section $\Sigma$, defined by an equation $x_i=\alpha$, where $x_i = \theta$ or $\zeta$.
-
angle(float) –The constant that defines the surface of section.
-
turns(int) –The number of intersections to calculate.
-
directionality(Directionality) –The method with which Poincare intersections are recorded.