Teaching

PHYS 633-001: Advanced Electromagnetism 1

West Virginia University — Spring 2026

Sole course instructor

Selected visualizations

  1. Charged sphere with a missing polar cap
  2. Solving the Laplace equation numerically
  3. Drift in a magnetic-field gradient
  4. Magnetic mirror

1. Charged sphere with a missing polar cap

(Gaussian/CGS units)

This problem explores the transition between a continuous and a discontinuous solution for the electrostatic field. It is well known that there is a jump in the electric field at the surface of a uniformly charged sphere. (And this jump is proportional to the surface charge density.) But what if we remove a polar cap $\theta \le \alpha$ from a uniformly charged thin spherical shell? As we move from the outside to the inside through the resulting "crater", the field is continuous, because there is no longer any charged surface to generate a discontinuity. As the cap gets smaller, the field remains continuous. But how is the discontinuity restored when the cap is finally closed? This transition can be visualized by representing the potential as the full-shell potential minus that of the cap, expanded in Legendre polynomials with closed-form coefficients $f_\ell = [P_{\ell-1}(\cos\alpha) - P_{\ell+1}(\cos\alpha)]/(2\ell+1)$. The field follows by differentiating the series term by term.

All four animations shrink the opening from $\alpha = 45^\circ$ to $1.8^\circ$. The field inside weakens and the shell approaches the complete sphere, while the field energy concentrates near the rim of the hole. On the symmetry axis the potential and $E_z$ have closed forms. The dashed curves show the complete shell, with $E_z$ jumping by $4\pi\sigma$ at the surface. With the cap removed, the jump at the north pole is replaced by a smooth peak that sharpens as the hole closes.

Equipotentials (blue) and field lines (red)

Field energy density $|\mathbf{E}|^2/8\pi$ on a logarithmic scale

Potential on the symmetry axis

Field component $E_z$ on the symmetry axis

2. Solving the Laplace equation numerically

In one homework problem, students solved the Laplace equation on the unit square with a set of boundary conditions that leads to a closed-form analytical solution. They solved it numerically and compared the result to the exact solution. One of the simplest numerical methods for the Laplace equation is the so-called 5-point stencil on a regular grid. It starts with arbitrary values on the interior grid nodes and the boundary-condition values on the boundary nodes. Then, the next approximation at a node is obtained as the mean of the values at the four closest nodes. This process is repeated multiple times until a satisfactory convergence is reached. There are two versions of this method: (i) Gauss–Seidel, in which each updated value is used immediately for the next update, and (ii) Jacobi, in which only the previous values are used until the entire grid has been updated.

Details. Boundary conditions: The potential equals 1 on two sides and grows linearly from 0 to 1 along the other two. Exact solution: $\Phi = x + y - xy$. Initial approximation: $\Phi = 0$ inside.

The movies follow the two schemes on an $81 \times 81$ grid for 2,000 iterations, with the iteration count growing logarithmically. The boundary values seep inward slowly. Gauss–Seidel converges about twice as fast as Jacobi: after 2,000 iterations its error is 0.03, against 0.13 for Jacobi.

Jacobi iteration

Gauss–Seidel iteration

3. Drift in a magnetic-field gradient

(SI units)

In a uniform magnetic field, a charged particle moves along a circle looping around the field lines. If the field strength varies across the orbit, the circle no longer closes. The particle turns more sharply where the field is stronger, and its guiding center drifts perpendicular to both the field and its gradient. This is the gradient drift (or $\nabla B$ drift). In the animations, the trajectories are integrated numerically from Newton's second law with the Lorentz force, assuming the field $\mathbf{B} = (B_0 + \alpha x)\,\hat{\mathbf{z}}$, which points along the $z$-axis while its strength grows along the perpendicular $x$-axis. Both panels share the same axes. The drift velocity $v_\mathrm{d} = m v_\perp^2 \alpha / 2qB_0^2$ is proportional to the gradient, so the second particle drifts three times as fast.

Weaker gradient

Gradient three times stronger

4. Magnetic mirror

A magnetic mirror is a region where the field lines converge. Here the field is axisymmetric and five times stronger at the center than far away. The type of a particle's motion is determined by its pitch angle $\theta$, i.e., the angle between the particle's velocity and the local magnetic field. A particle with a large pitch angle trades its motion along the field for gyration and is reflected. A particle with a small pitch angle, inside the loss cone $\sin^2\theta < B_\mathrm{min}/B_\mathrm{max}$, passes through. The same physics traps particles in the Earth's radiation belts.

Large pitch angle: the particle is reflected

Small pitch angle: the particle passes through