simulation of program in matlab
이전 댓글 표시
답변 (2개)
Use MATLAB's "pdepe".
M2_eq = 1;
D2_ov = 1e-2;
m=2;
x = linspace(0,1,100);
t = linspace(0,2,10);
u = pdepe(m,@(x,t,u,DuDx)eqn1(x,t,u,DuDx,D2_ov),@initail1,@(xl,ul,xr,ur,t)bc1(xl,ul,xr,ur,t,M2_eq),x,t);
surf(x,t,u)
function [c,f,s] = eqn1(x,t,u,DuDx,D2_ov)
c = 1;
f = D2_ov*DuDx;
s = 0;
end
%-----------------------------------------------------------------
function [pl,ql,pr,qr] = bc1(xl,ul,xr,ur,t,M2_eq)
pl=0;
ql=1;
pr=ur-M2_eq;
qr=0;
end
%-----------------------------------------------------------
function value=initail1(x)
value=0;
end
%------------------------------------------------------
카테고리
도움말 센터 및 File Exchange에서 PDE Solvers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
