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 visualización (últimos 30 días)
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

Respuesta aceptada

madhan ravi
madhan ravi el 25 de Dic. de 2018
Editada: madhan ravi el 25 de Dic. de 2018
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 comentarios
MINATI
MINATI el 25 de Dic. de 2018
Editada: MINATI el 25 de Dic. de 2018
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 el 2 de En. de 2019
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by