Tokamak Energy launches GSFit: Open-source plasma reconstruction software to advance fusion research

Introducing GSFit, a new open-source code developed to reconstruct the plasma boundary, plasma current, and stored energy in tokamaks. GSFit solves the Grad-Shafranov equation, constrained by experimental measurements, to provide accurate reconstructions of the plasma state.

Understanding the plasma state is critical for fusion research, particularly for calculating parameters like energy confinement time (τE). In the extreme environment of our ST40 tokamak, where core ion temperatures exceed 100 million degrees Kelvin, diagnostics must be placed outside the plasma. GSFit uses data from these diagnostics – especially ST40’s 85 magnetic sensors – to reconstruct the plasma state with high fidelity.

The diagram below shows the locations of ST40’s Mirnov coils (blue) and flux loops (red).

  • Mirnov coils, just a few millimetres in size, measure magnetic fields at specific locations and orientations. They are protected by ceramic dome-shaped armour.
  • Flux loops are much larger (up to 3 metres in diameter) and measure the total magnetic field passing through them.

GSFit is written in Rust for speed and robustness, with a Python interface for flexibility. The code is modular, well-documented, and includes continuous integration and testing. By making GSFit open-source, we aim to build a collaborative community to improve its numerical accuracy and expand its physics capabilities.

Validation

One way we validated GSFit was by simulating ST40 using the forward Grad-Shafranov solver FreeGS, generating synthetic ‘measurements’ at the real locations of our magnetic probes.

The real test, however, is GSFit’s performance with experimental data. Below, we compare GSFit’s reconstructed plasma boundaries with visible camera images of the plasma. These reconstructions used only magnetic sensors; the camera images serve as independent validation.

Left: Plasma limited on the centre post, with some power loading on the upper divertor
Centre: Upper single-null diverted plasma
Right: Vertically displaced plasma, just prior to quenching

GSFit is available now on Tokamak Energy’s GitHub:
https://github.com/tokamak-energy/gsfit

Key Advantages for Users

  • Modern programming languages: Rust (performance) + Python (flexibility)
  • Well-tested: Continuous integration prevents unnoticed errors
  • Open-source: Transparent and verifiable — ideal for scientific reproducibility
  • Fully documented: Includes a user manual and developer guidance
  • Community-driven: We welcome questions, bug reports, and contributions
1280 720 Tim Summer