Project Overview
This project implements and analyzes various numerical integration methods for simulating charged particle trajectories in magnetic fields, with a focus on symplectic integrators that preserve energy and phase-space structure over long-term simulations.
We compare the performance of the Boris method, a specialized velocity-Verlet variant, against higher-order methods like Runge-Kutta 4 and a custom 9-step symmetric multistep method. The simulations include both simplified 2D magnetic fields and realistic tokamak fusion reactor geometries.
Additionally, we implement a guiding center approximation using the Adams-Bashforth-Moulton predictor-corrector method to efficiently simulate long-term particle drift by averaging out fast gyromotion.
š¬ Tokamak Trajectory Animations
Watch charged particles follow characteristic "banana orbits" in the tokamak magnetic field configuration
Multistep Method (9th Order)
Runge-Kutta 4 Method
š¬ Key Physics Concepts
Lorentz Force: Charged particles experience a force \(\mathbf{F} = q(\mathbf{E} + \mathbf{v} \times \mathbf{B})\) perpendicular to their velocity in magnetic fields.
Symplectic Integration: Numerical methods that preserve the Hamiltonian structure and phase-space volume, essential for long-term accuracy.
Banana Orbits: Characteristic helical trajectories in tokamak geometry where particles drift toroidally and poloidally.
Guiding Center Theory: Approximation that separates fast cyclotron motion from slow drift, reducing 6D phase space to 4D.
Energy Conservation: Symplectic methods exhibit bounded energy errors \(O(h^p)\) over exponentially long timescales \(O(h^{-p-2})\).
āļø Implemented Numerical Methods
Boris Method: A 2nd-order symplectic integrator specifically designed for charged particle motion, splitting position and velocity updates.
Runge-Kutta 4: Classical 4th-order explicit method providing high accuracy but lacking symplectic structure.
9-Step Symmetric Multistep: High-order implicit method using analytical Jacobians for \(\sim 10\times\) speedup, preserving energy remarkably well.
ABM4 Guiding Center: Adams-Bashforth-Moulton predictor-corrector for the reduced guiding center equations, enabling \(100\text{-}200\times\) larger timesteps.
šÆ Project Objectives
- Implement Boris, RK4, and multistep integrators from scratch
- Analyze convergence orders and energy conservation
- Compare work-precision diagrams for efficiency
- Simulate realistic tokamak magnetic field geometries
- Implement guiding center approximation with ABM4
- Visualize 3D particle trajectories and banana orbits
š§ Technical Implementation
- Object-oriented architecture with abstract base classes
- Automatic differentiation using autograd for Jacobians
- Analytical Jacobian implementation for performance
- DOP853 reference solutions for error analysis
- Matplotlib 3D animations with gradient trails
- Comprehensive test suite for validation
š Key Results
- Boris method: 2nd order convergence, bounded energy errors
- RK4 method: 4th order convergence, energy drift over time
- Multistep: 4th order convergence, excellent energy conservation
- Guiding center: Exact energy conservation in tokamak (U=0)
- Validation of Hairer-Lubich theorem 3.2 for symmetric methods
- Successful 3D visualization of banana orbit dynamics