How to correct set conditions and params of PDE? (2024)

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

  • 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

How to correct set conditions and params of PDE? (2)

satisfies boundary an initial conditions:

How to correct set conditions and params of PDE? (3)

How to correct set conditions and params of PDE? (4)

Automodel general solution of this problem is:

How to correct set conditions and params of PDE? (5)

How to correct set conditions and params of PDE? (6)

where How to correct set conditions and params of PDE? (7) is solution of ODE problem:

How to correct set conditions and params of PDE? (8)

The solutions of this problem for How to correct set conditions and params of PDE? (9) is

How to correct set conditions and params of PDE? (10)

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

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:

How to correct set conditions and params of PDE? (11)

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

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

  • Link

    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

  • Link

    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

  • Link

    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

  • Link

    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'

How to correct set conditions and params of PDE? (16)

How to correct set conditions and params of PDE? (17)

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

  • Link

    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

  • Link

    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

Products

  • MATLAB
  • Partial Differential Equation Toolbox
  • Deep Learning Toolbox

Release

R2023b

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.


How to correct set conditions and params of PDE? (20)

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)

Europe

  • 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

Contact your local office

How to correct set conditions and params of PDE? (2024)
Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6494

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.