Dipole
ElectromagneticFields.Dipole — Module
Dipole magnetic field in (x,y,z) coordinates Based on Xinjie Li, Ruili Zhang, and Jian Liu, Symplectic Runge-Kutta methods for the guiding center dynamics.
The covariant components of the vector potential are given by
\[A (x,y,z) = \frac{B₀}{r^3} \big( y , \, -x , \, 0 \big)^T ,\]
resulting in the magnetic field with covariant components
\[B (x,y,z) = - \frac{B₀}{r^5} \big( 3xz, \, 3yz, \, 2z^2 - x^2 - y^2 \big)^T .\]
Constructing the Field
The only parameter is the field strength $B_0$, which defaults to 1000.0:
using CairoMakie
using ElectromagneticFields
equ = Dipole.init()Dipole Field in (x,y,z) CoordinatesPlotting
The vector potential circles the $z$ axis with a magnitude $B_0 \, \rho / r^3$, where $\rho$ is the distance from the axis and $r$ the distance from the origin. The plot shows its two non-vanishing components in the plane $z = 1$:
plot_equilibrium(equ)