Here’s a student-friendly walk-through of the Adjoint-State Method—one of the workhorses for efficiently computing gradients in PDE- or physics-constrained optimization.
1. What is the Adjoint-State Method?
When you want to minimize a cost (or misfit)
J(m) = J(u(m), m)
subject to a PDE constraint
A(m) u = f,
direct differentiation dJ/dm naïvely requires ∂u/∂m, which is as expensive as solving the PDE for each parameter direction.
The Adjoint-State Method gets around this by introducing an auxiliary “adjoint” variable p so that you only need:
1 forward PDE solve (to get u)
1 adjoint PDE solve (to get p)
→ then you assemble ∇J in one cheap pass.
2. The Big Idea (Lagrangian)
Form the Lagrangian
L(u, m, p) = J(u, m) + ⟨p, A(m) u − f⟩
Here p (the adjoint state) acts as a Lagrange multiplier enforcing the PDE.
We then impose stationarity of L with respect to u, m, and p:
- ∂L/∂p = 0 ⇒ PDE (forward problem): A(m) u = f
- ∂L/∂u = 0 ⇒ Adjoint problem: A(m)ᵀ p = −∂J/∂u
- ∂L/∂m = ∇J(m) ⇒ Gradient formula (no ∂u/∂m needed)
3. A Simple 1D Example
Forward PDE (steady diffusion):
−d/dx [k(x; m) du/dx] = s(x), u(0)=u(1)=0
Cost function (fit to data u_obs):
J(u, m) = ½ ∫₀¹ (u(x) − u_obs(x))² dx
Step A: Solve forward
Solve for u(x) given m ⇒ u(x; m).
Step B: Form the adjoint RHS
∂J/∂u = u − u_obs
⇒ adjoint PDE
−d/dx [k(x; m) dp/dx] = −(u−u_obs), p(0)=p(1)=0
Step C: Solve adjoint
Solve for p(x).
Step D: Compute gradient ∇J
Differentiate L wrt m:
∇J = ∂J/∂m + ⟨p, ∂A/∂m u⟩
In this diffusion example:
∂A/∂m enters through k(x; m), so
(∇J)(x) = −dp/dx · du/dx · ∂k/∂m (plus any direct ∂J/∂m if present).
4. Why It’s Awesome
- Cost is constant (independent of #parameters): 1 forward + 1 adjoint solve.
- Scales to millions of unknowns (common in geophysics, fluid dynamics, machine learning).
- Direct analogue of “back-propagation” in neural nets (reverse mode AD).
5. Key Takeaways
- Introduce adjoint p to avoid computing ∂u/∂m explicitly.
- Stationarity ∂L/∂u = 0 gives the adjoint PDE.
- Stationarity ∂L/∂m yields the gradient you need for any optimizer (e.g., L-BFGS, SGD).
🎓 Feel free to ask if you’d like more detail on any step, a fully worked-out finite-element example, or code snippets in MATLAB/Python!