idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.77k stars 1.05k forks source link

Automatic gradient computation for PDE-constrained inverse optimization #23888

Open zachmprince opened 1 year ago

zachmprince commented 1 year ago

Reason

It is often cumbersome and difficult to derive the gradient for PDE-constrained inverse optimization. It involves developing an adjoint of the forward problem and derivatives with respect to the optimization parameters. Even simple problems incur non-trivial derivation of the adjoint. However, there are numerical ways to perform the gradient evaluation based on the Jacobian of the forward problem and derivatives of the residual. So I believe it is possible with the capabilities of the framework to automatically compute the gradient for the forward problem.

Design

There are four aspects of computing the gradient based on adjoint evaluation:

  1. Jacobian transpose: The adjoint linear system is simply the transpose of the linearized forward problem (transpose of the Jacobian)
  2. Misfit source: The source of the adjoint problem is the derivative of the objective function with respect to the simulation DoFs (usually takes the form of DiracKernels).
  3. Backward timestepping: For transient problems, the adjoint operator entails backward time stepping with the state of the forward problem at every time step.
  4. Adjoint inner product: The gradient is evaluated by taking the inner product of the adjoint solution and the derivative of the forward residual with respect to the optimization parameters.

Impact

Much simpler gradient computation on the user side.

lindsayad commented 1 year ago

This reminded me of https://github.com/idaholab/moose/issues/20063

zachmprince commented 1 year ago

This reminded me of #20063

Yep! That issue is related to 4. in the design list.