Using Jax, demo of the adjoint optimization. The toy case is solving a Laplace equation with a simple central difference.
forward.pydemos the forward solving procedure and it is used to generate the truth solution.adjoint.pydemos the adjoint optimization procedure.plot_T_K.ipynbvisualizes the solution T and the design variables K.K_adj-N10-AbsErr15.npyis 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