Skip to content

Introduction

Test particle methods are widely used in plasma physics to understand the behavior of individual charged particles in prescribed electromagnetic fields. This approach assumes that the fields are not affected by the particles themselves, which is a valid approximation when the particle density is sufficiently low.

What makes plasmas particularly difficult to analyze is the fact that the densities fall in an intermediate range. Fluids like water are so dense that the motions of individual molecules do not have to be considered. Collisions dominate, and the simple equations of ordinary fluid dynamics suffice. At the other extreme in very low-density devices, only single-particle trajectories need to be considered; collective effects are often unimportant. Plasma behaves sometimes like fluids, and sometimes like a collection of individual particles. The first step in learning how to deal with this schizophrenic personality is to understand how single particles behave in electric and magnetic fields.

Here we assume that the EM fields are prescribed and not affected by the charged particles. References can be found in classic textbooks like Introduction to Plasma Physics and Controlled Fusion by F.F.Chen, and Fundamentals of Plasma Physics by Paul Bellan. For more complete notes corresponding to the derivation online, please check out Single-Particle Motions.

Equations of Motion

The motion of a particle with mass m and charge q in an electric field E and a magnetic field B is governed by the Lorentz force:

dpdt=q(E+v×B)

where p=γmv is the relativistic momentum, and γ=1/1v2/c2 is the Lorentz factor. For non-relativistic cases, γ1 and p=mv.

Figure 1: Illustration of the Lorentz force on a charged particle (Placeholder).

Characteristic Scales

The behavior of a particle is often characterized by its gyroradius (or Larmor radius) ρL and gyrofrequency Ωc:

Ωc=|q|Bm,ρL=vΩc

When the characteristic scale of field variations L is much larger than the Larmor radius (LρL), the particle's motion can be averaged over its gyro-orbit, leading to the Guiding Center Approximation (GCA).

Figure 2: Helical motion of a charged particle in a uniform magnetic field (Placeholder).

Quick Start

To get started with TestParticle.jl, you can trace a simple proton in a uniform magnetic field:

julia
using TestParticle, OrdinaryDiffEq, StaticArrays

# 1. Define Fields
B(x, t) = SA[0, 0, 1e-8]  # Magnetic field (Tesla)
E(x, t) = SA[0, 0, 0]     # Electric field (V/m)

# 2. Define Initial Conditions
x0 = [1.0, 0.0, 0.0]      # Initial position (m)
v0 = [0.0, 1.0, 0.1]      # Initial velocity (m/s)
stateinit = [x0..., v0...]
tspan = (0, 20)           # Time span (s)

# 3. Prepare and Solve
param = prepare(E, B, species=Proton)
prob = ODEProblem(trace!, stateinit, tspan, param)
sol = solve(prob, Vern9())

# 4. Visualize (Requires Makie or Plots)
# using GLMakie
# plot(sol, idxs=(1, 2, 3))

For more complex scenarios and detailed explanations, please refer to the following sections.