How to draw fig.1 with this code

Pr=1;Sc=1;
R=0.1;
xa=0;xb=6;
Lv = [-2.5:0.1:0];
for D=[ 1 1.5 2]
for i=1:length(Lv)
L = Lv(i);
fODE = @(x,y) [y(2); y(3); y(2)^2-y(3)*y(1)-1; y(5); -3*Pr*y(1)*y(5)/(3+4*R); y(7); -Sc*y(1)*y(7)];
BCres= @(ya,yb)[ya(1); ya(2)-L-D*ya(3); ya(4)-1; ya(6)-1; yb(2)-1; yb(4);yb(6)];
xint=linspace(xa,xb,101);
solinit1=bvpinit(xint,[0 1 0 1 0 1 0]);
solinit2=bvpinit(xint,[-1 -1 -1 -1 -1 -1 -1]);
sol1=bvp4c(fODE,BCres,solinit1);
sol2=bvp4c(fODE,BCres,solinit2);
sxint1=deval(sol1,xint);
sxint2=deval(sol2,xint);
Sk1(i,1) = sxint1(3,1);
Sk2(i,1) = sxint2(3,1);
end
figure(1)
plot(Lv,Sk1,'-',Lv,Sk2,'--','Linewidth',1.5);
xlabel('\bf \lambda');
ylabel('\bf C_{f}');
hold on
end

댓글 수: 3

Rik
Rik 2019년 5월 26일
What is your question? Are you successfully implementing the paper, but is your problem with the plotting?
Note that you didn't use hold on, which means the axis is cleared every iteration.
MINATI PATRA
MINATI PATRA 2019년 5월 26일
Actually Fig.1 is not coming properly. I am getting straight lines instead of curves as in Fig.1 Any help
Rik
Rik 2019년 5월 26일
Try to make your question more precise. I'm not going to read 4-5 pages of a pdf. Try to distil the problem to its essence. Have a read here and here. It will greatly improve your chances of getting an answer.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

질문:

2019년 5월 25일

댓글:

Rik
2019년 5월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by