About
The adjoint method is a technique that exploits the constraints imposed by the PDE (via the finite element method) to compute the gradient of an objective function with respect to a large number of design variables both very efficiently and with full mathematical accuracy.
Directly computing ( du/d\rho) would be extremely expensive, but by incorporating the governing FEM equation ( R(u, \rho) = 0 ) through an adjoint variable, the terms involving ( du/d\rho) are eliminated.
As a result, solving just one adjoint equation yields the exact gradient.
The idea of the adjoint method
The total derivative of the objective function is as follows:
\frac{dJ}{d\rho}
=\frac{\partial J}{\partial \rho} + \frac{\partial J}{\partial u} \frac{du}{d\rho}However, the state variable 𝑢 satisfies the PDE (FEM) constraint
R(u,\rho) = 0
Taking the total derivative of this constraint gives:
\frac{\partial R}{\partial u}\frac{du}{d\rho}
+
\frac{\partial R}{\partial \rho}
= 0Now we introduce the adjoint variable \lambda, defined to satisfy the adjoint equation:
\left( \frac{\partial R}{\partial u} \right)^{T} \lambda
=-\left( \frac{\partial J}{\partial u} \right)^{T}With this choice of (\lambda), the terms involving (du/d\rho) cancel out entirely. Thus, the gradient reduces to the adjoint form
\frac{dJ}{d\rho} = \frac{\partial J}{\partial \rho} + \lambda^{T} \frac{\partial R}{\partial \rho}I actually saw explanation of this from a paper, but the explanation above (mostly ChatGPT is much better). Thanks, my teacher.
