Optimal Control of Partial Differential Equations in PyTorch Using Automatic Differentiation and Neural Network Surrogates

In this paper, we address the numerical treatment of certain classes of optimal control problems employing differentiable partial differential equation (PDE) solvers. Although this might seem to be a strong limitation and the development of differentiable PDE solvers might seem arduous, for many problems this is not the case. In particular, for linear PDEs, they are equivalent to linear systems. Therefore, it is just sufficient to be able to solve linear systems in an automatic differentiation‐capable library like PyTorch and be able to differentiate through the linear solver. Using open‐source libraries, like torch_sparse_solve, we have easy‐to‐use differentiable direct solvers (here: KLU) at hand, which makes solving linear PDEs straightforward. For nonlinear PDEs, the approach above might be not sufficient, since we do not have an equivalent linear system for the underlying PDE. In this case, we can then use the library torch‐fenics, which enables us to define PDEs using the finite element library FEniCS and then differentiate through this problem in PyTorch. We complement the proposed methodology with various optimal control problems constrained by stationary and instationary PDEs, linear and nonlinear PDEs (from Poisson to fluid–structure interaction), space‐time and time‐stepping formulations, parameter estimation, right‐hand‐side control, initial condition control, and boundary condition control, finite difference and finite element discretizations, and neural network surrogates. All developments of this work are accompanied with the respective source codes published on GitHub.

Authors

Institutions

Publication Details

Journal
ZAMM ‐ Journal of Applied Mathematics and Mechanics / Zeitschrift für Angewandte Mathematik und Mechanik
Published
2026-11-29
DOI
https://doi.org/10.1002/zamm.70651
Citations
4
Primary Topic
Advanced Numerical Methods in Computational Mathematics
Type
article
Field-Weighted Citation Impact
4.47

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Optimal Control of Partial Differential Equations in PyTorch Using Automatic Differentiation and Neural Network Surrogates

Thomas Wick, Alexander Henkes, Denis Khimin, Julian Roth
4 citations
ZAMM ‐ Journal of Applied Mathematics and Mechanics / Zeitschrift für Angewandte Mathematik und Mechanik
Advanced Numerical Methods in Computational Mathematics
4.47
article

Optimal Control of Partial Differential Equations in PyTorch Using Automatic Differentiation and Neural Network Surrogates

Thomas Wick, Alexander Henkes, Denis Khimin, Julian Roth
article en
4 citations

Abstract

In this paper, we address the numerical treatment of certain classes of optimal control problems employing differentiable partial differential equation (PDE) solvers. Although this might seem to be a strong limitation and the development of differentiable PDE solvers might seem arduous, for many problems this is not the case. In particular, for linear PDEs, they are equivalent to linear systems. Therefore, it is just sufficient to be able to solve linear systems in an automatic differentiation‐capable library like PyTorch and be able to differentiate through the linear solver. Using open‐source libraries, like torch_sparse_solve, we have easy‐to‐use differentiable direct solvers (here: KLU) at hand, which makes solving linear PDEs straightforward. For nonlinear PDEs, the approach above might be not sufficient, since we do not have an equivalent linear system for the underlying PDE. In this case, we can then use the library torch‐fenics, which enables us to define PDEs using the finite element library FEniCS and then differentiate through this problem in PyTorch. We complement the proposed methodology with various optimal control problems constrained by stationary and instationary PDEs, linear and nonlinear PDEs (from Poisson to fluid–structure interaction), space‐time and time‐stepping formulations, parameter estimation, right‐hand‐side control, initial condition control, and boundary condition control, finite difference and finite element discretizations, and neural network surrogates. All developments of this work are accompanied with the respective source codes published on GitHub.

ZAMM ‐ Journal of Applied Mathematics and Mechanics / Zeitschrift für Angewandte Mathematik und MechanikVol. 106(12)
Leibniz University Hannover (DE), Centre National de la Recherche Scientifique (FR), Université Paris-Saclay (FR), ETH Zurich (CH), CentraleSupélec (FR), Laboratoire de Mécanique Paris-Saclay (FR)
Deutsche Forschungsgemeinschaft, Eidgenössische Technische Hochschule Zürich, ETH Zürich Foundation
Openalex Percentile: Top 8%
Advanced Numerical Methods in Computational Mathematics
4.47
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon