maziarraissi / PINNs

Physics Informed Deep Learning: Data-driven Solutions and Discovery of Nonlinear Partial Differential Equations
https://maziarraissi.github.io/PINNs
MIT License
3.45k stars 1.21k forks source link

How to solve equations with a second or higher order derivative in time, like the wave equation? #33

Open adsmendesdaniel opened 3 years ago

adsmendesdaniel commented 3 years ago

I'm a physicist and I'm working with PINNs and other similar algorithms for the last three years to numerically solve differential equations.

Some of these differential equations of my interest have high order derivatives in time, like the wave equation, that have a second order derivative in time. Looking forward to solve this type of equations, I developed a method/algorithm based on Raissi's scripts that can solve some equations with specific boundary conditions. But, my method have some problems and cant solve all the equations I want, it is, also, computationally expensive.

So, I'm here to ask you: Did you manage to solve differential equation with high order derivatives in time? What method did use? How did you implement this and what changes did you make in Raissi's scripts?

nish-ant commented 3 years ago

You can refer fractional PINN for higher order time derivatives.

FMagnani commented 3 years ago

In the paper "Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations" to which this repository refers, it is said that:

In this work, we consider parametrized and nonlinear partial differential equations of the general form u t + N [ u ; λ] = 0 , x ∈ Ω, t ∈ [ 0 , T ] where u ( t , x ) denotes the latent (hidden) solution, N [ · ; λ] is a nonlinear operator parametrized by λ , and Ω is a subset of R^D

Thus it's not considered the case with higher time derivatives. Nevertheless, I guess that some trials can be done. The discrete time approach employs the Runge Kutta method that's tailored to a form like the one shown above, so I would forget it. Let's focus on the continuous time approach, i.e. the one employed in the example with the Schrodinger equation. The only adaptation I would do to the script by Raissi would be the definition of the part of the loss computed in the collocation points (the N_f points extracted from the interior of the spatio-temporal domine). In the Raissi's repo, in the file main/continuous_time_inference (Schrodinger)/Schrodinger.py, at line 148 it's defined net_f_uv. I would change its content computing a higher time derivative and substituting f_u, f_v with the residual that you need.
I actually do not know if that's a good approach since I'm totally not an expert, but I hope my opinion will help you somehow.