Applied TorchPhysics Tutorials

Here, we explain the library of TorchPhysics along the implementation of different examples.

To start, we consider a heat equation problem of the form

\[\begin{split}\begin{align} \partial_t u(x,t) &= \Delta_x u(x,t) \text{ on } \Omega\times I, \\ u(x, t) &= u_0 \text{ on } \Omega\times \{0\},\\ u(x,t) &= h(t) \text{ at } \partial\Omega_{heater}\times I, \\ \nabla_x u(x, t) \cdot n(x) &= 0 \text{ at } (\partial \Omega \setminus \partial\Omega_{heater}) \times I, \end{align}\end{split}\]

that we will solve with PINNs. This example is a nice starting point for a new user and can be found here. The notebook gives a lot of information about TorchPhysics and even repeats the basic ideas of PINNs.

A next step would be to make the problem more complicated, such that not a single solution should be found, but a whole family of solutions for different functions \(h\). As long as the different \(h\) can be defined through some parameters, the solution operator can still be learned through PINNs. This is explained in this notebook, which is really similar to previous one and highlights the small aspects that have to be changed.

For more complex \(h\) functions, we end up at the DeepONet. DeepONets can also be learned physics informed, which is demonstrated in this tutorial.

Similar examples, with a description of each step, can be found in the two notebooks PINNs for Poisson and DRM for Poisson. The second notebook also uses the Deep Ritz Method instead of PINNs.

More applications can be found on the example page.