Hi i am solving bvp4c below is my code getting errors help me out
Show older comments
function Mvrh
global n Re p Pr Ec Nr Tw Nu Cp r w E z1 z2 p1 p2;
infinity =4;
We=1;Cp=0.5;n=2.5;Re=1;Pr=6.2;Ec=0.1;Tw=1;Nr=0.2;r=1.6;E=0.001;
Rav=[0 0.02 0.04];
for i = 1:3
E= Rav(i);
h1=0.0;
lines = {'B-','m-','g-'};
solinit = bvpinit(linspace(0,infinity),[0 E 1 1 0]);
sol = bvp4c(@shootode,@shootbc,solinit);
eta = sol.x;
f = sol.y;
% --------------------------------------------------------------------
figure(3)
plot(eta,f(4,:),lines{i},'linewidth',2.5);
xlabel('\bf \eta');
ylabel('\bf Nu'' (\eta)');
legend('\bf Phi1=Phi2=0','\bf Phi1= 0.04', '\bf Phi2=0 ','\bf Phi1=Phi2= 0.04 ');
hold on
end
% --------------------------------------------------------------------------
function dydx = shootode(eta,f)
%EX5OfE ODE function for Example 5 of the BVP tutorial.
global n p2 p1 z1 z2 Re Pr Nu c Cp r w E ;
dydx = [ f(2)
f(3)
(-1/n((1-p2)*((1-p1)+(z1*3970)/(997.1))+(z2*8933)/(997.1))*Re(f(1)*f(3)-f(2)*f(2)+1)+f(3))
f(7)
(-1/n(Pr((1-p2)*(1-p1+p1(3970*765)/(997.1*4179))+P2(8933*385)/(997.1*4179))/(400+2*0.613-2*p2(0.613-400)*40+2*3-2*p1(3-40))/(400+2*0.613+p2(0.613-400)*40+2*3+p1(3-40))*Re*f(1)*f(5)+f(5)))
];
% --------------------------------------------------------------------------
function res = shootbc(fa,fb)
global E Pr L A Re Nu
res = [ fa(1)
fa(2)-E
fa(4)-1
fb(2)-1
fb(4)
];
Answers (0)
Categories
Find more on Boundary Value Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!