boundary conditions for pdepe

조회 수: 4 (최근 30일)
yogan sganzerla
yogan sganzerla 2017년 6월 24일
답변: Torsten 2017년 6월 26일
Hello, My using pdepe to solve a problem. I have a square and the right side the temperature is 10ºC and in the left side the temperature is 0ºC. In the time Zero, e.g T(x,0) the temperature in the body is 5 degrees.
I know that I can solve this problem easily using hands, but I would like to show for my students how they can use these tools to solve it.
I am using pdepe and I just want to know how to setup the @pdex1bc. What are my coefficients "pl","ql","pr","ql" in the function?
Thanks
  댓글 수: 1
Joshua
Joshua 2017년 6월 24일
I will admit that I do not have experience using pdepe, but based on my experience with function handles and reading the documentation, "pl","ql","pr","ql" are all boundary conditions (bcs) of the pde that you define using your custom function @pdex1bc. From what I understand, in the code below, you can define "pl","ql","pr","ql" however you want in @pdex1bc based on your problem. If the left side of your square is x=xl=0 and the right side is x=xl=length, pl and ql would correspond to bcs at x=xl=0, and pr and qr would correspond to bcs at x=xr=length. I assume one of those would include the constant temperatures on each side, but without seeing your equation I am not sure. In the example code below they gave, they define the bcs based on xl,ul,xr,ur,t from the problem.
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = ul;
ql = 0;
pr = pi * exp(-t);
qr = 1;
Not sure if that was helpful at all. I only have experience using ode45 which is much simpler.

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

답변 (1개)

Torsten
Torsten 2017년 6월 26일
pl = ul;
ql = 0.0;
pr = ur-10;
qr = 0.0;
Best wishes
Torsten.

카테고리

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