I am not getting multiple graphs(iterative) when I run the code for a coupled bvp ODE using bvp4c

1 view (last 30 days)
Two ODEs are:
F"=G(G^2+gamma^2)/(G^2+lambda*gamma^2)
G'= 1/3F'^2-2/3(F*F")
subject to: F(xi)=alpha/2, F'(xi)=1 at xi=0 where 'alpha' is a parameter (wall parameter)
F'(xi)= 0 as xi tends to infinity
I should be getting a multiple graphs varying the parameter ' alpha'
The code that I have run is:
function sol= proj
clc;clf;clear;
global lambda gama alp
lambda=0.5;
gama=1;
pp=[0:0.5:1.0];
figure(1)
plot(2,1);
solinit= bvpinit([0:0.01:10],[0,1,0]);
for alp= pp
sol= bvp4c(@projfun,@projbc,solinit);
solinit= sol;
plot(2,1);plot(sol.x,sol.y(2,:))
end
end
function f= projfun(x,y)
global lambda gama
f= [y(2);y(3)*(y(3)^2+gama.^2)/(y(3)^2+lambda*gama.^2);y(2)^2/3-(2*y(1)*y(3)*(y(3)^2+gama.^2))/(3*(y(3)^2+lambda*gama.^2))];
end
function res= projbc(ya,yb)
global alp
res= [ya(1)-alp/2; ya(2)-1.0; yb(2)];
end

Accepted Answer

Torsten
Torsten on 6 Dec 2017
https://de.mathworks.com/help/matlab/ref/hold.html
Best wishes
Torsten.
  21 Comments
Torsten
Torsten on 13 Dec 2017
Yes, it's really alarming how much erroneous results are published under the pressure to "publish or perish".
Best wishes
Torsten.
naygarp
naygarp on 14 Dec 2017
Yes after observing two research papers from well-known publishers, it's heartening to see how such details get missed. Anyway, thanks a lot for guiding me along.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!