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

3 次查看(过去 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
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
  4 个评论
MINATI
MINATI 2018-12-25
编辑:MINATI 2018-12-25
Actually M and Pr variation happens simultaneously with given data.
Thank you again
************
it's not likely to keep adding question one by one in each comment ... (please read how to parameterize a function
It is not as that you thought but still unsolved
MINATI
MINATI 2019-1-2
Dear
In X-axis variation should come as Pr=0 to 2 and parallaly variation for M=0, 1, 2 to draw fig. 4
I am still unable to draw

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by