# Code that controls nuclear fusion: What programming language is used? | David Kirtley

Source: https://www.youtube.com/watch?v=Yuiv4aK3qKg
Recap page: https://rapidrecap.app/video/Yuiv4aK3qKg
Generated: 2025-11-21T05:33:55.096+00:00

---
## Quick Overview

The code controlling nuclear fusion experiments, particularly those involving pulsed magnetic fields like those used by Helion, is primarily written in Fortran, with some supporting code in Python and Java, because Fortran remains the fastest language for the necessary high-speed numerical and plasma physics simulations required to manage the system's rapid firing sequences.

**Key Points:**
- The primary programming language used for controlling the fusion systems, especially for high-speed calculations, is Fortran, which predates modern high-level languages.
- Fortran is still widely used in fields like computational physics and aerospace engineering due to its speed in numerical computing.
- The systems require extremely fast control—operations occur on the microsecond to millisecond scale—which necessitates low-level programming like Fortran or assembly language.
- Modern simulations, particularly for magnetohydrodynamics (MHD) and plasma behavior, are often performed using advanced tools built upon these older languages.
- Helion's pulsed systems achieve magnetic fields greater than 100 Tesla for microseconds, contrasting with steady-state systems operating around 20 Tesla continuously.
- The density (n), temperature (T), and confinement time (tau) product (n*T*tau) must exceed a break-even point, as defined by the Lawson Criterion, for fusion to be viable.
- The experimental approach involves pre-programming sequences for electrical switches and monitoring diagnostics via fiber optics due to the extreme speed of the pulses.

![Screenshot at 01:38: A slide defining Fortran as a programming language designed for fast, efficient numerical and scientific computing, created by IBM in 1957, highlighting its continued relevance in computational physics.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-01-38.png)

**Context:** This discussion, featuring David Kirtley on the Lex Fridman Podcast, centers on the computational and programming challenges involved in controlling advanced nuclear fusion devices, specifically those employing high-current pulsed magnetic fields like those used by Helion. The conversation contrasts the speed requirements of pulsed systems with steady-state systems and explains why older, highly optimized languages remain critical for achieving the necessary real-time control and simulation accuracy for fusion reactions.

## Detailed Analysis

The guest explains that the core code controlling fusion systems, particularly those involving rapid, pulsed magnetic fields, relies heavily on Fortran due to its efficiency in high-speed numerical computation. This is necessary because system operations occur on microsecond to millisecond timescales, far too fast for human response or slower, modern languages to manage effectively. While newer languages like Python and Java are used for ancillary tasks, the critical control sequences for pulses are often written in Fortran or even assembly language. The discussion touches upon the Lawson Criterion ($n \cdot T \cdot \tau > \text{Breakeven Point}$), emphasizing that maximizing the product of plasma density ($n$), temperature ($T$), and confinement time ($\tau$) is key. In pulsed systems, researchers achieve extremely high magnetic fields (over 100 Tesla) for very short durations (microseconds to milliseconds), contrasting with steady-state systems that maintain lower fields (around 20 Tesla) continuously. The management of these pulses requires pre-programming complex sequences for electrical switches and using fiber optics for diagnostics, as the speed of the events is too fast for human intervention. Furthermore, the simulation of these plasma dynamics, including magnetohydrodynamics (MHD) and particle behavior, utilizes advanced computational tools, often built upon Fortran, to predict system performance accurately before physical tests are run.

### Programming Languages for Fusion Control

- Fortran is the primary language due to its speed in numerical and scientific computing
- Python and Java are used for supporting roles
- Assembly language is used for the lowest level control.

### Fusion Performance Metrics (Lawson Criterion)

- Fusion viability requires maximizing the product of density (n), temperature (T), and confinement time (tau) to exceed a break-even point
- Higher T and n lead to more fusion, but confinement time (tau) is the critical variable in pulsed systems.

### Pulsed vs. Steady-State Systems

- Pulsed systems achieve extreme magnetic fields (>100 Tesla) for microseconds, while steady-state systems target moderate, sustained fields (~20 Tesla)
- Pulsed systems allow for very high magnetic pressures for short durations.

### Simulation and Diagnostics

- Advanced numerical simulations (like MHD) are crucial for designing the system and predicting performance before testing
- Diagnostics rely on fiber optics because electrical signals are too slow to monitor the rapid pulse events in real-time.

![Screenshot at 00:14: Animation showing the interior of a fusion device with purple plasma being contained, illustrating the environment being controlled.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-00-14.png)
![Screenshot at 00:23: Schematic diagram of a fusion device showing magnetic field lines containing a toroidal \(donut-shaped\) plasma in purple.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-00-23.png)
![Screenshot at 01:38: Text slide defining Fortran as a programming language designed for fast, efficient numerical and scientific computing, created in 1957.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-01-38.png)
![Screenshot at 03:21: Close-up animation of plasma being compressed within a reactor chamber, representing the high-pressure environment achieved.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-03-21.png)
![Screenshot at 03:50: Image sourced from Helion showing an array of white components connected by red and black wiring, representing the large number of electrical switches needed for pulse control.](https://ss.rapidrecap.app/screens/Yuiv4aK3qKg/00-03-50.png)
