deepxde icon indicating copy to clipboard operation
deepxde copied to clipboard

Simulation of boundary conditions and initial condition discontinuities

Open LanPeng-94 opened this issue 2 years ago • 8 comments

Dear Dr.Lu: Recently, I'm having a problem with PINNs simulation and would like to ask for your advice. The problem is described as follows: PDE:u_xx+u_x=u_t BC1:u(0,t)=0 BC2:u(10,t)=m (where m is a constant) IC: u(x,0)=np.piecewise(x, [x != 0, x == 0], [0, m]) (This means that the initial condition will be discontinuous at the point (10,0)) I simulated using PINNs and compared it with the analytical solution, and the results showed that all the loss terms were in the order of 1e-6 accuracy, and the final results are shown in the figure below. It is obvious that the error around the point (10, 0) is significantly higher than the other calculation areas, and the other points can be fitted better. Do you have any method to improve the accuracy of the calculation? 微信图片_20220418161520

LanPeng-94 avatar Apr 18 '22 08:04 LanPeng-94

If IC and BC are not consistent at the corner, then it is difficult, as NN is always a continuous function. You can modify IC and BC to be consistent.

lululxvi avatar Apr 20 '22 15:04 lululxvi

Here I solved a steady-state problem with 4 discontinuous corners with my own code (not DeepXDE). DeepXDE gains loss around the edges for some reason.

image

You can't solve these problems with baseline PINN. A quick fix would be to not train those points. On top of that use importance sampling to increase the points cloud near the area.

Use other PINNs with skip connections that introduce artificial diffusion very similar to Petrov-Galerkin.

praksharma avatar Apr 21 '22 22:04 praksharma

Here I solved a steady-state problem with 4 discontinuous corners with my own code (not DeepXDE). DeepXDE gains loss around the edges for some reason.

image

You can't solve these problems with baseline PINN. A quick fix would be to not train those points. On top of that use importance sampling to increase the points cloud near the area.

Use other PINNs with skip connections that introduce artificial diffusion very similar to Petrov-Galerkin.

Thank you very much for your answer. For this, I tried RAR and adding calculation points in areas with large errors, and these results did not improve my calculation results. For the importance sampling you mentioned, do you mean adding training points in areas with large errors? Do you have similar learning documents, or can you show me the code with your correct results, I am curious how you handle it?

LanPeng-94 avatar Apr 22 '22 07:04 LanPeng-94

Sorry, I can't share the code (we are writing a paper). You can learn more about importance sampling here.

Their code is public but not open source, so we wrote our own version from scratch. Importance sampling is more than just adding training points in areas with large errors.

We are solving a similar 3D problem with discontinuities over the edges of a cuboid instead of just on the corners in 2D. Sorry, I wasn't helpful.

praksharma avatar Apr 22 '22 07:04 praksharma

Thank you very much for your help and I look forward to your paper and available codes.

LanPeng-94 avatar Apr 22 '22 07:04 LanPeng-94

Sorry, I can't share the code (we are writing a paper). You can learn more about importance sampling here.

Their code is public but not open source, so we wrote our own version from scratch. Importance sampling is more than just adding training points in areas with large errors.

We are solving a similar 3D problem with discontinuities over the edges of a cuboid instead of just on the corners in 2D. Sorry, I wasn't helpful.

Hi, Is there an article on PINNs with skip connections?

LanPeng-94 avatar Apr 22 '22 07:04 LanPeng-94

Wang's Learning rate annealing comprises a two transformer layer residual connection.

praksharma avatar Apr 22 '22 07:04 praksharma

Thank you for your answer

LanPeng-94 avatar Apr 22 '22 07:04 LanPeng-94