JuliaCon 2026

Optimal Control of a Field Generator using JuMP.jl and IPOPT.jl
2026-08-14 , Room 3

Dynamic magnetic field generation is essential for numerous applications but grows power-intensive with system scale. Non-linear current-to-field relationships in soft iron core designs complicate the inverse current problem. This work formulates power-efficient control as a nonlinear program with algebraic constraints on field and gradient strength, solved using JuMP.jl and IPOPT.jl. Spherical harmonic expansions provide the polynomial field representation for efficient optimization on consumer hardware.


This talk details the implementation of a constrained nonlinear optimization framework for controlling soft iron core magnetic field generators. Unlike linear air-core systems, these generators exhibit complex current-to-field relationships, necessitating robust nonlinear programming techniques.

The control objective of minimizing power consumption subject to dynamic field constraints is formulated as a nonlinear algebraic problem within JuMP.jl. Key technical aspects include:
- Symbolic-Numeric Representation: Magnetic fields are represented using truncated spherical harmonic expansions (implemented via SphericalHarmonicExpansions.jl and DynamicPolynomials.jl), providing polynomial field representations that satisfy the quasi-static Maxwell equations.
- Nonlinear Constraint Algebra: Strict feasibility is enforced through hardware constraints, algebraic constraints on the magnetic field vector (polynomial inequalities), as well as constraints on the smallest singular value of the field Jacobian (ensuring gradient strength for spatial encoding), registered as user-defined nonlinear functions in JuMP.
- Interior Point Solution: IPOPT.jl solves the resulting Karush-Kuhn-Tucker (KKT) system, leveraging barrier methods to handle the bound and inequality constraints inherent to hardware current limits.

Although neural networks (Flux.jl) provide the forward model surrogate for field coefficient prediction, the focus remains on the algebraic structure of the optimization problem and the numerical methods employed to solve it. The framework demonstrates how Julia’s algebraic modeling ecosystem enables real-time optimal control, achieving precise field generation with minimal power consumption.

See also:

PhD student in the group of Tobias Knopp for Biomedical Imaging at the University Medical Center Hamburg-Eppendorf and the Hamburg University of Technology.