desc.particles.VacuumGuidingCenterTrajectory
- class desc.particles.VacuumGuidingCenterTrajectory(frame)Source
Guiding center trajectories in vacuum, conserving energy and mu.
Solves the following ODEs,
d𝐑/dt = v∥ 𝐛 + (m / q B²) ⋅ (v∥² + 1/2 v⊥²) ( 𝐛 × ∇B )
dv∥/dt = − (v⊥² / 2B) ( 𝐛 ⋅ ∇B )
where 𝐁 is the magnetic field vector at position 𝐑, B is the magnitude of the magnetic field and 𝐛 is the unit magnetic field 𝐁/B.
- Parameters:
frame ({"lab", "flux"}) –
Which coordinate frame is used for tracing particles. ‘lab’ corresponds to {R, phi, Z} coordinates, ‘flux’ corresponds to {rho, theta, zeta} coordinates. Frame must be compatible with the source of the field, i.e. if tracing in an Equilibrium, set frame=”flux” or if tracing in a MagneticField, choose “lab”.
Although particles can be traced in “lab” frame using an Equilibrium, it is not recommended, since it requires coodinate mapping at each step of the integration. Thus, it is not implemented. For that case, we recommend converting the final output to “lab” frame after the integration is done using Equilibrium.map_coordinates method.
If anytime during the integration, the particle’s rho coordinate becomes smaller than 1e-6, the magnetic field is computed at rho = 1e-6 to avoid numerical issues with the rho = 0. Note that particle position doesn’t have discontinuity due to this, only the magnetic field is computed at a different point.
Methods
contr(t0, t1, **kwargs)Needed by diffrax.
is_vf_expensive(t0, t1, y, args)Specifies whether evaluating the vector field is "expensive", in the specific sense that it is cheaper to evaluate vf_prod twice than vf once.
prod(vf, control)Needed by diffrax.
vf(t, x, args)RHS of guiding center trajectories without collisions or slowing down.
vf_prod(t, y, args, control)The composition of [diffrax.AbstractTerm.vf][] and [diffrax.AbstractTerm.prod][].
Attributes
Coordinate frame of the model.