calculate_LStar¶
- rbinvariantslib.invariants.calculate_LStar(model: MagneticFieldModel, starting_point, mode='normal', starting_mirror_latitude=None, Bm=None, starting_pitch_angle=None, integrand_atol=0.01, integrand_rtol=0.01, num_local_times=16, first_mlt_step=0.39269908169872414, max_mlt_step=1.5707963267948966, major_step=0.05, minor_step=0.01, interval_size_threshold=0.05, rel_error_threshold=0.01, max_iters=300, trace_step_size=None, interp_local_times=True, interp_npoints=1024, verbose=False) CalculateLStarResult¶
Calculate the third adiabatic invariant, L*
Can be run in two modes, ‘normal and ‘equitorial’. The normal mode searches for a drift shell by selecting a field line that matches K at each local time; the equitorial mode matches Bmin at each local time.
- Parameters:
- model
MagneticFieldModel grid and magnetic field, loaded using models module
- starting_pointtuple of floats
Starting point of the field line integration, as (x, y, z) tuple of floats, in units of Re
- mode{‘normal’, ‘equitorial’}, optional
Mode to run drift shell search in. Equitorial mode does special search using Bmin, which is faster. Overrides starting_mirror_latitude, Bm, and starting_pitch_angle.
- starting_mirror_latitudefloat, optional
Latitude in degrees to use for the mirroring point for the local time associated with the starting point to calculate drift shell
- Bmfloat, optional
Magnetic field strength at mirror point used to calculate drift shell
- starting_pitch_anglefloat, optional
Pitch angle at Bmin at starting point to calcualte the drift shell. If set to 90.0, then a special path will be taken through the code where the drift shell is used by searching for isolines of Bmin instead of K
- major_stepfloat, optional
Size of large step (float, units of Re) to find rough location of drift shell radius
- num_local_times‘adaptive’ or int
Number of local times to use. If ‘adaptive’ is passed, uses a Runge-Kutta method.
- minor_stepfloat, optional
Size of small step (float, units of Re) to refine drift shell radius
- interval_size_thresholdfloat, optional
Only used by mode=’bisection’. Bisection threshold before linearly interpolating
- max_itersint, optional
Used by all modes. Maximum iterations before raising exception.
- trace_step_sizefloat, optional
Used by all modes. step size used to trace field lines
- interp_local_timesbool, optional
Interpolate intersection latitudes for local times with cubic splines to allow for less local time calculation
- interp_npointsint, optional
Number of points to usein interplation, only active if interp_local_times=True
- model
- Returns:
- result:
CalculateLStarResult
- result: