Can it be possible to draw Fig. 4 with Pr (0 to 2) on X-axis and for different values of M=0,1,2 OR plot(Nt,-T0(5)) with M=0,1,2
1 次查看(过去 30 天)
显示 更早的评论
function main
Pr=6.2; fw=0.5; Nb=.5;L=-1; K=.100;Nt=.5;Le=1;R=1; Kc=0.2;
%M=1;
M=input('M=');
xa=0;xb=6;
solinit=bvpinit(linspace(xa,xb,100),[0 1 0 1 0 1 0]);
sol=bvp4c(@ode,@bc,solinit);
xint=linspace(xa,xb,100);
sxint=deval(sol,xint);
function res=bc(ya,yb)
res=[ya(1)-fw; ya(2)-L; ya(4)-1; Nb*ya(7)+Nt*ya(5);yb(2); yb(4); yb(6)];
end
function dydx=ode(x,y)
dydx=[y(2); y(3); y(2)^2+(M+K)*y(2)-y(3)*y(1);
y(5); -(Pr*y(1)*y(5)+Nb*y(5)*y(7)+Nt*y(5)^2)/(1+R);
y(7); (Nt/Nb)*(Pr*y(1)*y(5)+Nb*y(5)*y(7)+Nt*y(5)^2)/(1+R)-Le*y(7)*y(1)+Kc*Le*y(6)];
end
% T0 = deval(sol,0)
% plot(Nt,-T0(5))
plot(xint,sxint([4],:),'--','Linewidth',1); %for f'
title('Fig.4 Variation of Temperature Profile f`(\eta)with M ')
xlabel('\eta');
ylabel('f`(\eta)');
hold on
end
采纳的回答
madhan ravi
2018-12-25
编辑:madhan ravi
2018-12-25
function main
L=-1;
fw=0.5;
Nb=.5;
Nt=.5;
Pr=6.2;
K=.100;
Le=1;
R=1;
Kc=0.2;
for M=0:2
xa=0;xb=6;
solinit=bvpinit(linspace(xa,xb,100),[0 1 0 1 0 1 0]);
sol=bvp4c(@(x,y)ode(x,y,M,Pr,Nb,K,Nt,Le,R,Kc),@(ya,yb)bc(ya,yb,L,fw,Nb,Nt),solinit);
xint=linspace(xa,xb,100);
sxint=deval(sol,xint);
figure
plot(xint,sxint(4,:),'--','Linewidth',1); %for f'
title(['Fig.4 Variation of Temperature Profile f`(\eta)with M = ' ,num2str(M)])
xlabel('\eta');
ylabel('f`(\eta)');
end
end
function res=bc(ya,yb,L,fw,Nb,Nt)
% ^^^^^^^^^^^^^---- parameterization
res=[ya(1)-fw; ya(2)-L; ya(4)-1; Nb*ya(7)+Nt*ya(5);yb(2); yb(4); yb(6)];
end
function dydx=ode(x,y,M,Pr,Nb,K,Nt,Le,R,Kc)
% ^^^^^^^^^^^^^^^^^^^^---- parameterization
dydx=[y(2); y(3); y(2)^2+(M+K)*y(2)-y(3)*y(1);
y(5); -(Pr*y(1)*y(5)+Nb*y(5)*y(7)+Nt*y(5)^2)/(1+R);
y(7); (Nt/Nb)*(Pr*y(1)*y(5)+Nb*y(5)*y(7)+Nt*y(5)^2)/(1+R)-Le*y(7)*y(1)+Kc*Le*y(6)];
end
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!