2D Diffusion problem with multi-region domain in Deep Learning Toolbox
Show older comments
I have seen one lecture on this in mathworks website ( https://mathworks.com/videos/physics-informed-machine-learning-with-matlab-1747332177157.html ), where you have solved the 2D heat equation with a domain as a single region domain, and one other reference is (https://in.mathworks.com/help/pde/ug/solve-poisson-equation-on-unit-disk-using-pinn.html)
But what if we have a multi-region domain, with different region-specific coefficients, ICs, etc. (Please see attached problem pdf); so using FEM MATLAB PDE toolbox, we will have a solution as shown in the attached figure (please see);
Can someone please help me to develop the pdetoolbox+PINNs-based code to solve such a problem?
5 Comments
Gobinda Debnath
on 28 Mar 2026 at 6:50
Kindly help, or please consider updating the Deep Learning Toolbox documentation with more examples.
I'm only a user of the MATLAB software, not a MATLAB employee. Forgive me if my answer sounded harsh.
The reason is: I'm not a fan of "artificial" approaches to solve problems where well-established methods exist. In my opinion, the main reason to propagate such methods is to produce publications - well knowing about their limitations and drawbacks.
On the other hand, I must admit that I don't have deeper knowledge about the state-of-the-art of PINN and advantages of PINN over FEM methods that could already be demonstrated for "real" applications.
Thus at least one constructive comment to your question: I'd try to use a single region and define the diffusion coefficient "c" by a user-defined function that depends on the spatial position (x,y) in the domain. This would mainly concern substituting "pdeCoeffs.c" here in the loss-function:
% Compute gradients of U and Laplacian of U.
gradU = dlgradient(sum(U,"all"),XY,EnableHigherDerivatives=true);
Laplacian = 0;
for i=1:dim
gradU2 = dlgradient(sum(pdeCoeffs.c.*gradU(i,:),"all"), ...
XY,EnableHigherDerivatives=true);
Laplacian = gradU2(i,:)+Laplacian;
end
A comparison of the PDE-solutions for the single-domain and multi-domain computation would also be helpful.
Answers (0)
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!