27 views (last 30 days)
Show older comments
Alex Milns on 26 May 2024 at 16:04
-
-
Link
Direct link to this question
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde
Commented: Alex Milns on 26 May 2024 at 19:24
Open in MATLAB Online
Dear members of community! I have a important problem with PDE Toolbox initialization coeffs and conditions.
I try to solve heat equation and compare exact solution and PINN solution looks like . But, first I should correct create mesh and for obtain solution (numerical solution).
Problem formulation:
Consider the next mathematical problem: heat equation with initial and boundary conditions - modes with exacerbation. Let we have specific auomdel heat equation
satisfies boundary an initial conditions:
Automodel general solution of this problem is:
where is solution of ODE problem:
The solutions of this problem for is
Matlab code:
Create the PDE model and include the geometry.
model = createpde;
R1 = [3,4,0,1,1,0,0,0,10,10]';
g = decsg(R1);
geometryFromEdges(model,g);
pdegplot(model,EdgeLabels="on")
axis equal
grid on
Define constants of PDE and initial and boundary equations:
k0 = 1; % Adjust as necessary
sigma = 2; % Adjust as necessary
A0 = 2; % Adjust as necessary
T = 0.5; % Adjust as necessary
n = 2; % Adjust as necessary
% Initial conditions
setInitialConditions(model,0);
% Boundary conditions
applyBoundaryCondition(model, 'dirichlet', 'Edge', 1, 'u', @(region,state) A0 * (T - state.time)^n);
% PDE coefficients
specifyCoefficients(model, 'm', 0, 'd', 1, 'c', @(region, state) k0 * state.u.^sigma, 'a', 0, 'f', 0);
% Generate mesh
generateMesh(model, 'Hmax', 0.1);
Try to obatin numerical solution:
% Solve the PDE
tlist = linspace(0, T, 50);
result = solvepde(model, tlist);
u = result.NodalSolution;
I understand, that obtainded numerical solution is not correct, and training PINN using this meshes and PDE coeffs non coorrect step os obtain solution:
Is not correct solution.
My problem:
How to correct set intial and boundary conditions, and create geometric dash for solve this PDE?
6 Comments Show 4 older commentsHide 4 older comments
Show 4 older commentsHide 4 older comments
Torsten on 26 May 2024 at 17:00
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172251
You can't solve PDEs over infinite domains in x and t with the PDE toolbox.
Alex Milns on 26 May 2024 at 17:15
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172266
If consider infinity, for example, 10e3, can I use this toolbox? I understand that an infinite region cannot be specified in this case
Torsten on 26 May 2024 at 17:28
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172276
Edited: Torsten on 26 May 2024 at 17:28
In principle, you only have a boundary condition at x = 0. Further, the boundary conditions at t=-oo and the boundary condition at x = 0 are not compatible for n > 0 since A0*(t-T)^n should converge to 0 as t->-Inf.
The PDE toolbox expects a closed bounded region where you can define a boundary condition on each of its edges. Can you fulfill this requirement for your problem ? I don't see how.
Alex Milns on 26 May 2024 at 18:08
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172306
1) I'm sorry, I just realized that n should be negative (for example n = -1.25)
2) The only thing in this case to which I can reduce this problem is to make the second boundary condition similar and consider a certain region, not at infinity, but with a fractional dimension of sigma -- then this will also be a self-similar regime, although in the analytical solution then in In this case, a minus sign will appear in front of the 'x'
Torsten on 26 May 2024 at 19:01
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172341
1) So you have a pole at t = T ?
2) I don't understand it.
Why do you want to force the PDE Toolbox to solve a problem you already know the solution of ?
Alex Milns on 26 May 2024 at 19:24
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/2122771-how-to-correct-set-conditions-and-params-of-pde#comment_3172356
I want to compare PINN solution and numerical, it is posibble, if I correctly define mesh (domain) and obtain numnerical solution, close to exact...
This problem was not formulated by me, and in this automodel behaviour there is no condition at t = T!
Perhaps, PINN not be able to solve this problem and PDE toolbox not work in this case (
Sign in to comment.
Sign in to answer this question.
Answers (0)
Sign in to answer this question.
See Also
Categories
Mathematics and OptimizationPartial Differential Equation ToolboxGeometry and Mesh
Find more on Geometry and Mesh in Help Center and File Exchange
Tags
- pde
- pinn
- neural network
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
Contact your local office