The Numerics of VMEC++

summary

The gist

The Variational Moments Equilibrium Code (VMEC) is a computational tool employed in stellarator physics to determine plasma equilibrium…

In short

VMEC++ improves plasma equilibrium calculations for stellarators by refining its numerical methods. It enhances constraint handling via spectral condensation, allows for direct equal-arclength parameterization of flux surfaces, and incorporates analytical derivatives for optimization. This leads to more accurate determination of 3D geometry and magnetic field configurations.

Key concepts

Spectral Condensation
This technique converts a real-space flux surface representation into Fourier coefficients suitable for VMEC. It efficiently uses available finite Fourier coefficients by fitting real-space points well while condensing them into a spectrally condensed Fourier representation, making the process more economical.
Equal-Arclength Parameterization
This method parameterizes flux surfaces using direct equal-arclength parameterization. This is useful for obtaining a unique poloidal angle-like coordinate, especially in asymmetric cases, and it reduces the set of Fourier coefficients needed by assuming $x_{s1}$ equals $y_{c1}$.
Jacobian Matrix Computation
The system computes the Jacobian matrix of the curve fitting problem. This matrix is approximately diagonal, which allows for an efficient calculation of its maximum eigenvalue. This helps understand how small changes in free parameters affect the force balance and stability.
Even-m and Odd-m Decomposition
Metric elements ($g_{\alpha\beta}$) are decomposed into even-$m$ and odd-$m$ contributions when evaluated at half-grid points. This decomposition is more robust than direct evaluation, especially for handling products of odd modes, ensuring a stable calculation of geometric quantities.

Terminology used across episodes

This episode discusses

The paper

The Numerics of VMEC++ · Read on arXiv

Jonathan Schilling

Proxima Fusion

VMEC++ is a Python-friendly, from-scratch reimplementation in C++ of the Variational Moments Equilibrium Code (VMEC), a fixed- and free-boundary ideal-MHD equilibrium solver for stellarators and tokamaks. The first VMEC implementation was written by Steven P. Hirshman and colleagues in the 1980s and 1990s and its latest Fortran incarnation (PARVMEC, https://github.com/ORNL-Fusion/PARVMEC) is widely used in stellarator optimization systems. Our work improves on previous implementations with regard to various critical aspects: special care has been put in providing an idiomatic Python experience, from installation to actual usage; VMEC++ has a zero-crash policy; it supports inputs in the classic INDATA format as well as friendlier JSON files. VMEC++ execution times are typically less than or equal to previous implementations, and time to convergence can be decreased dramatically by leveraging its hot-restart feature: by providing the output of a VMEC++ run as initial state for a subsequent one, VMEC++ is initialized using the previously converged equilibrium. This can dramatically decrease runtimes when running on many similar magnetic configurations as it typically happens in stellarator optimization pipelines. On the flip side, some features of the original Fortran VMEC implementation are not yet available in VMEC++, such as support for non-stellarator-symmetric configurations. This contribution presents the internal numerics of the open-source VMEC++ package publicly for the first time.

Transcript

Introduction to the show: ident: Physics. The day in general physics: instruments, methods and results across the field.

Kai: We're looking at the paper: "The Numerics of VMEC++".

Title and authors: Kai: So we've seen that "The Numerics of VMEC++" is focused on turning a complex equilibrium problem into a solvable numerical framework, specifically focusing on the mechanics of VMEC++.

Mira: The authors are Jonathan Schilling and the team at Proxima Fusion in Munich, and their work centers on making this kind of detailed calculation more efficient.

Lev: It's interesting because they are taking an existing tool and pushing its numerical capabilities to handle more complex, free-boundary problems reliably.

Kai: They aren't just running the code; they are rigorously defining all the mathematical steps, from how they calculate normal derivatives to how the Fourier basis works.

Mira: It’s about providing a detailed roadmap for anyone trying to implement or understand these kinds of plasma equilibrium solvers, which is crucial for validating simulations.

Lev: For someone building real hardware, knowing exactly where the overhead lands in these complex numerical steps matters a lot for performance metrics.

The paper's summary: Kai: In this paper, they summarize how VMEC++ approaches plasma equilibrium by using those Fourier methods to solve the force balance problem iteratively.

Mira: Essentially, they explain the process of computing residual MHD forces in real space, moving them into Fourier space, and then using an accelerated descent method to adjust the flux surface geometry toward force balance.

Lev: They are showing how this whole pipeline is structured so that you can see exactly where the physics meets the numerical discretization.

Kai: They also detail the two modes again: fixed boundary mode for simpler checks versus free boundary mode which allows for plasma shape evolution until force balance is achieved.

Mira: The key implication here is that they are providing a concrete, rigorous way to handle those difficult iterative adjustments in a system where the geometry itself is changing.

Lev: It’s about proving the numerical stability of their approach when you let the boundary move around.

The paper's improvements: Kai: The paper highlights several improvements they've made to the VMEC framework, starting with better constraint handling through spectral condensation.

Mira: That allows for a more economical use of available Fourier coefficients because they fit real space points well while simultaneously condensing them into a spectrally condensed Fourier representation.

Lev: That’s good because it means you don't need an excessive number of high-frequency modes to capture the physics, right?

Kai: Exactly. Then they introduce direct equal-arclength parameterization for flux surfaces, which helps get a unique poloidal angle-like coordinate in asymmetric cases.

Mira: That method reduces the set of Fourier coefficients by one element by assuming x equals y plus that specific condition, so it’s a neat trick for efficiency.

Lev: Reducing the required coefficients by one is tangible overhead savings when you have to compute those large matrices later.

Kai: They also detail computing analytical first and second order derivatives for both the objective function and the constraint, which feed into non-linear optimization algorithms to find better Fourier coefficients.

Mira: And they suggest feeding that optimization routine the value of M minus one, because M can't go lower than one, which guides its path in parameter space more effectively.

Lev: So it’s about making the optimizer smarter by giving it a better understanding of the bounds on its parameters.

Conclusion: Kai: To wrap up, "The Numerics of VMEC++" is about solidifying the implications of using spectral condensation and parameterization tricks to make this equilibrium code more practical.

Mira: They’ve shown a way to handle free boundaries robustly while keeping the computational cost manageable by optimizing how they use Fourier coefficients.

Lev: For me, it means when we move this to real hardware, we need those efficiency gains because the overhead of complex matrix assembly needs to be minimized for actual runs.

Kai: It’s about taking a highly theoretical method and showing exactly how it translates into a usable numerical pipeline for actual plasma geometry determination.

Mira: This paper gives us a solid foundation for understanding how to push these methods further, especially concerning the handling of those tricky geometric details in three dimensions.

Lev: It sets a clear benchmark for what real hardware needs to be able to handle computationally without the solution blows up due to numerical instability.

More episodes

← Home