Optimal Control of Partial Differential Equations in PyTorch Using Automatic Differentiation and Neural Network Surrogates
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.
// Source
Authors: Denis Khimin, Julian Roth, Alexander Henkes, Thomas Wick
Institutions: Centre National de la Recherche Scientifique, Leibniz University Hannover, ETH Zurich, Université Paris-Saclay, CentraleSupélec, Laboratoire de Mécanique Paris-Saclay