Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
sol2= bvp4c(@bvpexam2, @bcexam2, sol); (How can I plot second solution)
조회 수: 1 (최근 30일)
이전 댓글 표시
using this code for different values of alpha i ploted the first solution. now what changes are required to plot second solution using this code.
''dual solutions''
function Ibrardual
clc
clear all
Nt=0.5; Nb=0.5; Le=2; Pr=1; alpha=-0.2138; s=1; A=1;
%% solution in structure form
%First solution
sol = bvpinit(linspace(0,2,10), [1 0 0 0 0 0 0]);
sol1 = bvp4c(@bvpexam2, @bcexam2, sol);
x1 = sol1.x;
y1=sol.y;
plot(x1,y1(3,:),'b');
hold on
result=(A)^-1/2*y1(3,1) % where Rex^1/2cf=A^-1/2*y1(3)
%% Here I define residual of boundary conditions
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1;
yinf(2); yinf(4);yinf(6)];
end
%% First order ODEs are define here
function ysol = bvpexam2(x,y)
yy1 = -A*(y(1)*y(3)-(y(2))^2)-y(2);
yy2 = -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2);
yy3 = (-Le*A*(y(1)*y(7))-(Nt/Nb)*( -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2)));
ysol = [y(2); y(3); yy1;y(5);yy2;y(7);yy3];
end
end
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!