function mainPr=1;K=1;L=-1;S=0.1;n=input('n=');a=linspace(0,6,100);G=linspace(0,7,100);solinit=bvpinit(a,G,[0 1 0 1 0 0 1]);sol=bvp4c(@ode,@bc,solinit);xint=a;sxint=deval(sol,xint);function res=bc(ya,yb,G)res=[ya(1)-S; ya(2)-L; ya(4)+n*ya(3); ya(6)-1; yb(2)-1; yb(4); yb(6);]; end function dydx=ode(x,y,G) dydx=[y(2); y(3);(y(2)^2-1-y(1)*y(3)-K*y(5)-G*(1-y(2)))/(1+K);y(5);2*(y(2)*y(4)-y(1)*y(5)+K*(2*y(4)+y(3)))/(2+K);y(7);-Pr*y(1)*y(7)]; endplot(xint,sxint([2],:),'Linewidth',2); %for f'
xlabel('\eta'); ylabel('f^\prime');hold onend
ERROR occurs as:
n=0
Error using bvparguments (line 108)
Error in calling BVP4C(ODEFUN,BCFUN,SOLINIT):
The derivative function ODEFUN should return a column vector of length 100.
Error in bvp4c (line 130)
bvparguments(solver_name,ode,bc,solinit,options,varargin);
Error in (line 7)
sol=bvp4c(@ode,@bc,solinit);
Best Answer