Physics informed Neural Network - Periodic Boundary condition

조회 수: 16 (최근 30일)
Sankarganesh P
Sankarganesh P 2024년 11월 25일
댓글: Sankarganesh P 2024년 12월 3일
Dear Matlab Community Members,
I am working on implementing physics-informed neural networks (PINNs) in MATLAB to solve the Allen-Cahn equation with periodic boundary conditions. The equation is as follows:
Ut=alpha*Uxx+5U-5U^3; with Periodic BCs U(X=L1,t)=U(X=L2,t) and dU/dx(X=L1,t)=dU/dx(X=L2,t) and Ics T(X,t=0)=x.*x.*cos(pi*x);where alpha=0.001;
I have written a PINN-based MATLAB code to solve this, but the predicted results are not matching the target results. I suspect there might be issues with either the implementation of the periodic boundary conditions, the loss function, or the numerical settings.
I have attached my code for reference. If anyone has experience with PINNs or solving PDEs with periodic boundary conditions in MATLAB, I would greatly appreciate your help in identifying and fixing the issue.
Thank you for your time and support!
Best regards,
Shankar

답변 (1개)

Ayush
Ayush 2024년 11월 29일
I understand you are facing issues with the output of your MATLAB code.
Your MATLAB code for implementing a Physics-Informed Neural Network (PINN) to solve the Allen-Cahn equation looks mostly well-structured. However, there are a few aspects that could be contributing to the discrepancy between your predicted and target results. Let me offer suggestions for improvement:
  1. Ensure periodic boundary conditions are handled correctly for both 𝑈 and its derivative. In the loss function, enforce both U(x=L1,t)=U(x=L2,t) and dU/dx(x=L1,t)=dU/dx(x=L2,t) properly. You might need a small penalty term for BC violations.
  2. Check if the time step dt and space step dx satisfy the CFL condition for stability. You might need to reduce “dt” or increase “numInternalCollocationPoints” to improve accuracy.
  3. LBFGS might not be ideal for PINNs. Try using the "Adam optimizer", which is often more effective for training neural networks in this context. You can read more about "Adam optimizer" here: https://www.mathworks.com/matlabcentral/fileexchange/127843-understanding-the-adam-optimization-algorithm
By addressing these points, you should improve your model's accuracy and training stability.
Hope it helps!
  댓글 수: 1
Sankarganesh P
Sankarganesh P 2024년 12월 3일
Thank you for the detailed feedback and suggestions. I appreciate the insights, especially regarding the boundary conditions and optimizer choice.I'll make these changes and see how they affect the results..!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by