Solving second order PDE

조회 수: 23 (최근 30일)
Lotuny Lee
Lotuny Lee 2020년 6월 26일
편집: Lotuny Lee 2020년 6월 27일
Hi, I am trying to solve the following pde with initial condition CA(0,r)=0 and boundary conditions CA(t,0)=F(t) and CA(t,5)=0.
, where D_A and gamma_A are known constants.
I tried using pdepe but was told that left boundary condition would be ignored when m=1 (cylindrical symmetry).
Then I tried discretizing space variable r before using ode15s, but was confused about how to construct the equation exactly.
Can anybody help?
  댓글 수: 2
darova
darova 2020년 6월 27일
Can you please exaplain more about your equation?
Is it
or
Lotuny Lee
Lotuny Lee 2020년 6월 27일
편집: Lotuny Lee 2020년 6월 27일
@darova Hi, it is a reaction-diffusion equation. And I believe the middle part should be .

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

채택된 답변

Bill Greene
Bill Greene 2020년 6월 27일
편집: Bill Greene 2020년 6월 27일
The reason that pdepe imposes a boundary condition of the flux equal zero at the
center is that this is required for the problem to be mathematically well-posed.
Imposing a prescribed temperature at the center would require that the flux go to
infinity there.
An easy way to understand this is to solve the problem with the left end a small distance
from the center and with a fine mesh. I have attached a short script below that shows this.
function matlabAnswers_6_27_2020
r0=1e-6;
x = linspace(r0,1,1000);
tf=1;
t = linspace(0,tf,40);
pdeFunc = @(x,t,u,DuDx) heatpde(x,t,u,DuDx);
icFunc = @(x) heatic(x);
bcFunc = @(xl,ul,xr,ur,t) heatbcDirichlet(xl,ul,xr,ur,t);
m=1;
sol = pdepe(m, pdeFunc,icFunc,bcFunc,x,t);
figure; plot(t, sol(:,end)); grid on; title 'Temperature at outer surface'
figure; plot(t, sol(:,1)); grid on; title 'Temperature at center'
figure; plot(x, sol(end,:)); grid; title 'Temperature at final time'
end
function [c,f,s] = heatpde(x,t,u,DuDx)
c = 1;
f = DuDx;
s = 0;
end
function u0 = heatic(x)
u0 = 0;
end
function [pl,ql,pr,qr] = heatbcDirichlet(xl,ul,xr,ur,t)
pl = ul-1;
ql = 0;
pr = 0;
qr = 1;
end
  댓글 수: 1
Lotuny Lee
Lotuny Lee 2020년 6월 27일
Thanks a lot! This looks like a feasible alternative.

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

추가 답변 (1개)

J. Alex Lee
J. Alex Lee 2020년 6월 27일
I believe that pdepe is available with base matlab.
It appeas to be able to do the space discretization automatically for you if you
  댓글 수: 1
Lotuny Lee
Lotuny Lee 2020년 6월 27일
Thanks for answering, but my issue with pdepe is that my boundary condition would be ignored.

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

카테고리

Help CenterFile Exchange에서 PDE Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by