benmoseley / harmonic-oscillator-pinn

Code accompanying my blog post: So, what is a physics-informed neural network?
MIT License
541 stars 150 forks source link

What if we do not have the analytical solution for differential eqn?? #4

Open PrasadK97 opened 1 year ago

PrasadK97 commented 1 year ago

Hello Ben,

For the given differential equation, what if we do not have the analytical solution... Then we do not have those data points (x_data, y_data) by which we have got loss_1, and if we train our model only by physics-based loss "loss_2", we won't get accurate results. In Raissi et. al. paper on PINNs, they have taken the loss_1 term corresponding to the boundary and initial conditions. So can we get an accurate result for the given differential equation(1 SDOF) if we incorporate the two initial conditions given in the question in the loss and not the data points we have taken from the analytical solution of the differential equation?

benmoseley commented 1 year ago

Yes, in the blog post I included multiple data points of the solution, just to make it easy to understand. You can instead just use data points along the boundaries/initial conditions; this will ensure the BC/ICs are obeyed and the solution the PINN learns is unique. In this case you do not need to know the true solution, only the BC/ICs are required.