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

조회 수: 2 (최근 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에서 Surfaces, Volumes, and Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by