Some examples of using PINN to solve PDEs numerically.
PINN official implementation: https://github.com/maziarraissi/PINNs
SA-PINN official implementation: https://github.com/levimcclenny/SA-PINNs
Update:
Poisson 1D with boundary condition:
$$\left{ \begin{array}{l} -u^{''}(x) = f(x) \quad \textrm{for } \, x \in [-1, 1] \newline u(-1) = u(1) = 0 \end{array} \right.$$
where $f(x) = \pi^2 \sin(\pi x)$.
The exact solution is: $u(x) = \sin(\pi x)$
PINN solution and the exact solution:
Poisson 2D with boundary condition:
$$ \left{ \begin{array}{l} -\Delta u(x, y) = f(x, y) \quad \textrm{for } \, (x, y) \in \Omega = [-1, 1] \times [-1, 1] \newline u|_{\partial \Omega} = 0 \end{array} \right. $$
where $f(x, y) = 2\pi^2 \sin(\pi x)\sin(\pi y)$.
The exact solution is: $u(x, y) = \sin(\pi x) \sin(\pi y)$
PINN solution:
The exact solution:
(Example from Juan Diego Toscano's Leaning PIML in Python, example 4: diffusion equation)
Diffusion equation with initial condition and boundary conditions:
$$ \left{ \begin{array}{l} ut = u{xx} - e^{-t}(\sin(\pi x) - \pi^2\sin(\pi x)) \quad x \in [-1, 1], t\in [0, 1] \newline u(x, 0) = \sin(\pi x) \newline u(-1, t) = u(1, t) = 0 \end{array} \right. $$
The exact solution is: $u(x, t) = e^{-t}\sin(\pi x)$.
PINN solution v.s. the exact solution:
Poisson 1D (Inverse Problem) with boundary condition:
PDE: $$\left{\begin{array}{l} -\lambda u^{''}(x) = f(x) \quad x \in (-1, 1) \ u(-1) = u(1) = 0 \end{array}\right.$$
where $f(x) = \pi^2 \sin(\pi x)$.
Exact solution(for generating training set) is: $u(x) = \sin(\pi x)$.
We're going to train a DNN to approximate $\lambda$. (The exact result is $\lambda = 1$)
PINN solution:
I learned how to use PINN to solve burgers equation from omniscientoctopus' code. Much of my code is same as omniscientoctopus' code, but I add some comments and my ideas in my code.
Here's omniscientoctopus' GitHub repo: https://github.com/omniscientoctopus/Physics-Informed-Neural-Networks
The data I used is also from omniscientoctopus' GitHub repo.
Burgers equation: $$\left{ \begin{array}{l} u_t + uux = \nu u{xx} \quad x \in [-1, 1], t \in [0, 1] \newline u(x, 0) = u_0(x) \newline u(-1, t) = u(1, t) = 0 \end{array} \right.$$
where $u_0(x) = -\sin(\pi x)$, $\nu = \frac{0.01}{\pi}$
PINN results:
SA-PINN results:
(Example from https://youtu.be/UTC6cccEEnM?t=267)
Allen-Cahn equation for two-phase microstructrue evolution:
$$\left{\begin{array}{l}ut - 0.00001u{xx} + 5u^3 - 5u = 0 \quad x\in[-1,1], t \in [0,1] \newline u(x, 0) = x^2 \cos(\pi x) \newline u(-1, t) = u(1, t) \newline u_x(-1, t) = u_x(1, t) \end{array} \right.$$
SA-PINN results: