Solving an elliptic PDE with a point source

조회 수: 4 (최근 30일)
Alex
Alex 2014년 1월 21일
댓글: Youssef Khmou 2014년 1월 22일
How do I solve the following PDE:
where c is a constant and delta is a point source? The domain is a rectangle and the boundary conditions are that u is zero on the boundary and the second derivative of u normal to the boundary is also zero. How do I cast this equation in terms of the generic MATLAB PDE,
which is solved by u = assempde(b,p,e,t,c,a,f)?
  댓글 수: 3
Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 1월 21일
I think you can follow a procedure similar to that example for the heat equation:
Give me a little more time to try it myself.
Alex
Alex 2014년 1월 21일
편집: Alex 2014년 1월 21일
Hi Bruno, thanks for the response. My equation has no derivative in time, unlike the parabolic PDE. It is similar to the elliptic PDE
but the second term is du/dx, not u.

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

답변 (2개)

Youssef  Khmou
Youssef Khmou 2014년 1월 21일
편집: Youssef Khmou 2014년 1월 21일
Alex, You can find many tutorials on how to use the PDETOOL, however i recommend that you solve the equation by program , later you can verify your example, i tried to write the finite differences method for your equation, try to manipulate it a little a bit :
% PDE
clear;
N=200;
U=zeros(N);
Delta=1;
U(N/2,N/2)=Delta;
c=2;
T=400;
for t=1:T
for x=2:N-1
for y=2:N-1
if U(x,y)==Delta
continue;
else
E=(U(x+1,y)+U(x-1,y)+U(x,y+1)+U(x,y-1));
U(x,y)=((Delta/c)-E-((1/c)*U(x+1,y)))/(-(4+(1/c)));
end
end
end
end
figure, contour(U), shading interp
  댓글 수: 2
Alex
Alex 2014년 1월 22일
Youssef, thank you for the response. Your code steps through time, and at some "large" time (400 in this case) the solution changes very little and we call it steady. However, I need to solve the equation over a range of coefficients, not just c=2 , but c=0:0.01:2 . I'm looking for a way to avoid the time-stepping loop and instead solve the PDE explicitly.
Youssef  Khmou
Youssef Khmou 2014년 1월 22일
Alex , t is considered as the number of iterations necessary for convergence such |U(x,y)t+1|-||U(x,y)t||<tolerance, anyway we wait for an answer using pdetool .
Cordially .

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


Bill Greene
Bill Greene 2014년 1월 22일
Hi,
As you've probably observed, PDE Toolbox doesn't support the du/dx term explicitly. However there is a trick you can try that often works.
First, I suggest you start with this example:
This example shows how to approximate the delta function and use adaptive meshing to refine the mesh around the load.
The trick to dealing with the du/dx term is to move it to the RHS and define the f-coefficient to be a function of ux (aka du/dx).
I made the following changes to the example I mention above:
I added these options to the call to adaptmesh:
'Nonlin', 'on', 'jac', 'full'
Then I made these changes to the circlef function:
Added:
[ux,uy] = pdegrad(p, t, u);
f = -ux;
and changed
if ~isnan(tn)
f(tn) = f(tn) + 1/ar(tn);
end
Bill

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by