FORGE Optimises Reactor Geometries to improve Exhaust
FORGE is a Python tool for optimising the magnetic geometry of tokamak divertors. Given a GEQDSK equilibrium and a description of the poloidal-field coils, it tunes coil currents using a simulated annealing optimisation algorithm to reshape the magnetic geometry of the divertor region(s) — improving strike-point placement, connection length, and detachment conditions — whilst leaving the core plasma unchanged. In this way, FORGE enables a decoupling of the production of a suitable free-boundary equilibrium that captures the geometry of the core plasma from the design of the divertor geometry, eliminating the need for the repeated usage of a free-boundary solver. FORGE comes with a GUI to help the user setup their optimisation problem in a visual and intuitive way.
FORGE is device-agnostic — whilst the bundled examples use a MAST-U geometry, it can be applied to any tokamak for which you have a GEQDSK equilibrium and a PF coil description. If you are interested in using FORGE, have questions, or would like to contribute to its development, please join the discussion on the FORGE Discord server.
Full documentation is available at https://forgexhaust.readthedocs.io, including:
- Installation — setup instructions
- How It Works — the physics and algorithms behind FORGE
- Getting Started — input formats and a worked example
- GUI — graphical interface
- API Reference — auto-generated module documentation
- Examples — six progressive example scripts on MAST-U
To build the docs locally:
pip install -e ".[docs]"
cd docs
make html
# open build/html/index.htmlgit clone https://github.com/FORGExhaust/FORGE.git
cd forge
pip install .git clone https://github.com/FORGExhaust/FORGE.git
cd forge
pip install -e ".[test,docs,gui]"| Package | Minimum version |
|---|---|
| NumPy | 2.0.0 |
| Matplotlib | 3.7.5 |
| SciPy | 1.11.4 (< 1.18) |
| Shapely | 2.0.1 |
| freeqdsk | 0.4.0 |
Contributions are welcome! If you would like to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "Add my feature") - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request into the dev branch.
Please ensure new code includes appropriate tests, docstrings and updated documentation where relevant.
If you use FORGE in your research, please cite:
@software{forge,
author = {Marsden, Chris},
title = {{FORGE}: {F}ORGE {O}ptimises {R}eactor {G}eometries to improve {E}xhaust},
url = {https://github.com/FORGExhaust/FORGE},
version = {1.1.0},
year = {2026}
}- Chris Marsden — Former Tokamak Energy scientist. Project lead and primary developer.
- Sebastien Shaw — Student at Imperial College London. Performed foundational work during a UKAEA FOSTER summer placement (2025).
- Nathan Welch — SCOPE project lead; guidance on the simulated annealing approach.
FORGE builds on several routines from FreeGS (Ben Dudson et al.), which are used under the terms of the LGPL-3.0 licence. See the individual source files for details.
FORGE was initially developed at Tokamak Energy.
The FORGE GUI is built with Panel and Bokeh:
FORGE is released under the GNU Lesser General Public License v3.0. See LICENSE for the full text.
The bundled MAST-U example data is provided under CC BY-NC-SA 4.0. See the documentation licence page for details.
Note: The MAST-U machine configuration represented by the bundled data corresponds to the MAST-U device as operated during the period 2020–2025. Any subsequent modifications to the machine are not reflected in these data.
