gtsimulation.functions#

Functions

CalcGuidingCenter(coo, V, H, T, pitch_deg, M, Z)

Calculate the guiding center of a charged-particle trajectory.

CalcLarmorRadii(Hm, T, pitchd, M, Z)

Calculate Larmor radii of charged particles.

CalcPitchAngles(H, V)

Calculate pitch angles of velocity vectors relative to the magnetic field.

GetLastPoints(RetArr_i, s)

gtsimulation.functions.CalcGuidingCenter(coo: ndarray, V: ndarray, H: ndarray, T: float, pitch_deg: float, M: float, Z: int) → ndarray[source]#

Calculate the guiding center of a charged-particle trajectory.

Parameters:
coonumpy.ndarray

Particle coordinates in m. Shape (N, 3).

Vnumpy.ndarray

Particle velocity vectors in m/s. Shape (N, 3).

Hnumpy.ndarray

Magnetic field vectors in nT. Shape (N, 3).

Tfloat

Kinetic energy in MeV.

pitch_degfloat

Pitch angle in degrees.

Mfloat

Particle mass in MeV/c².

Zint

Particle charge number.

Returns:
numpy.ndarray

Guiding-center coordinates in m.

gtsimulation.functions.CalcLarmorRadii(Hm: ndarray, T: float, pitchd: float, M: float, Z: int) → ndarray[source]#

Calculate Larmor radii of charged particles.

Parameters:
Hmnumpy.ndarray

Magnetic induction magnitude in T. Shape (N,).

Tfloat

Kinetic energy in MeV.

pitchdfloat

Pitch angle in degrees.

Mfloat

Particle mass in MeV/c².

Zint

Particle charge number.

Returns:
numpy.ndarray

Larmor radius in m. Shape (N,).

Notes

The momentum and Larmor radius are calculated as

p = np.sqrt((T + M)**2 - M**2)

r = p * sin(pitch) / (q * B)

gtsimulation.functions.CalcPitchAngles(H: ndarray, V: ndarray) → ndarray[source]#

Calculate pitch angles of velocity vectors relative to the magnetic field.

Parameters:
Hnumpy.ndarray

Magnetic field vectors in nT. Shape (3,) or (N, 3).

Vnumpy.ndarray

Velocity vectors in m/s. Shape (3,) or (N, 3).

Returns:
numpy.ndarray

Pitch angles in degrees. Shape () or (N,).

gtsimulation.functions.GetLastPoints(RetArr_i, s)[source]#