필터 지우기
필터 지우기

How to solve a system of parabolic partial differential equations in time and 1 D space

조회 수: 1 (최근 30일)
Hi,
I cannot seem to solve the PDF in the figures below. This is the code I have but it produces the wrong graphs:
function New
m=0;
x=0:0.5:15;
t=1:100:28800;
sol = pdepe(m,@pdefun,@icfun,@bcfun,x,t);
u1=sol(:,:,1);
u2=sol(:,:,2);
surf(x,t,u1)
title('u1(x,t)')
xlabel('Distance x')
ylabel('Time t')
figure
surf(x,t,u2)
title('u2(x,t)')
xlabel('Distance x')
ylabel('Time t')
function [c,f,s]=pdefun(x,t,u,DuDx)
P=1200;
R=0.208;
cv=0.313;
rho=7.5;
v=0.3;
A=70;
mdot=1.2;
k=0.016/1000;
alph=0.5;
rhoG=1600;
cG=0.7;
kG=0.7/1000;
c=[((P*cv/R)/u(1));(rhoG*cG)];
f=[((k*DuDx(1))-((P*cv/R)*(mdot*R/(P*A))));(kG*DuDx(2))];
s=[(u(2)-u(1));(u(1)-u(2))]*alph;
function u0=icfun(x)
u0=[300;300];
function[pl,ql,pr,qr]=bcfun(xl,ul,xr,ur,t)
pl = [ul(1)-773; 0];
ql = [0; 1];
pr = [0; 0];
qr = [1; 1];
I think my boundary conditions are incorrect but I don't know how to fit them.
I would appreciate any help with this problem, thank you in advance.
<<
>>
%

채택된 답변

Torsten
Torsten 2017년 11월 22일
One mistake in your settings:
f = [k*DuDx(1) ; kG*DuDx(2)];
s = [(u(2)-u(1))*alph-cv*mdot/A*DuDx(1);(u(1)-u(2))*alph];
And maybe in your boundary condition for T_A at x=0, you will need a ramp that linearly increases the temperature from 300 K to 773 K in, say, one minute.
Best wishes
Torsten.
  댓글 수: 7
Torsten
Torsten 2017년 11월 22일
편집: Torsten 2017년 11월 22일
Increasing the number of discretization points together with the ramp for a=100 solved the problem:
x = linspace(0,15,3000);
Best wishes
Torsten.
Lucy
Lucy 2017년 11월 22일
Hi Torsten,
Thank you so much for your help. It is now working how I believe it should.
Lucy

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by