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 Newm=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')figuresurf(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.
<<
>>
%
Best Answer