Fusion Magnetic Field Simulation
A Python simulation of tokamak-like magnetic fields — built while studying electromagnetism to see how fusion reactors contain high-pressure plasma.

Magnetic field magnitude (Tesla) of a tokamak-like nuclear fusion setup rendered with the simulation
Role
Solo — simulation & visualization
Team
Individual
Status
Completed
Timeline
Fall 2025
- ▹Modeled magnetic field strength for multiple fusion coil setups
- ▹Visualized |B| (Tesla) heatmaps of a tokamak-like geometry
- ▹Built while learning B-fields in an electromagnetism course
Motivation
In electromagnetism I was learning about B-fields and how charges and currents shape them. Fusion stuck with me — specifically how a reactor keeps plasma confined at extreme pressure with magnetic fields alone.
I wanted something more concrete than textbook sketches, so I wrote a small simulation to plot the field from tokamak-style coil arrangements.
Approach
The sim is in Python with NumPy for the field math and Matplotlib for heatmaps of magnetic field magnitude (|B| in Tesla).
I set up multiple fusion geometries, placed coil cross-sections in the plane, and rendered the resulting field strength so the confinement pattern is visible — bright peaks at the coils, weaker regions between them.
Results
The plots show a tokamak-like layout: concentric rings of coil sections and a continuous |B| field between them. The color scale runs from dark blue (near zero) up through white at the strongest points on the coils (~0.8 T in the example above).
What I Practiced
- Translating EM concepts into code
- Discrete field sampling over a 2D grid
- Scientific visualization with Matplotlib
- Relating coil geometry to plasma-confinement intuition
Questions about this project? Email Caleb.