Using Jax, demo of the adjoint optimization. The toy case is solving a Laplace equation with a simple central difference.
forward.py
demos the forward solving procedure and it is used to generate the truth solution.adjoint.py
demos the adjoint optimization procedure.plot_T_K.ipynb
visualizes the solution T and the design variables K.K_adj-N10-AbsErr15.npy
is the K distribution generated by the adjoint optimization at the no. 100 iteration with the absolute error 15. ForK_adj-N10-AbsErr300.npy
, the absolution error is 300 at the no. 10 iteration.
The auto differentiation is employed by using Jax.
Reference: Inverting PDEs with adjoints by JoelCFD