help to find error in this?
Afficher commentaires plus anciens
function Needle
a=0.01;
Pr=3.0;R=2.0;Nr=10;Ec=0.3;
solinit= bvpinit(linspace(a,40,100),[0 0 0 0 0]);
sol = bvp4c(@Needleode,@Needlebc,solinit);
eta = sol.x;
f = sol.y;
disp(f(2,1))
Cf=8*a^(1/2)*f(3);
disp(Cf)
function dfdeta = Needleode(eta,f)
f1_thetha=f(4)*(R-1)+1;
f2_thetha=eta*(1+4*(f1_thetha)^3/3*Nr);
dfdeta = [ f(2)
f(3)
-(1/(2*eta))*(f(1)*f(3)+2*f(3))
f(5)
-(f(5)+Pr*f(1)*f(5)/2+4*Ec*Pr*eta*(f(3))^2+2*f(5)*(f1_thetha)^3/3*Nr+4*eta*f(5)^2*(R-1)*(f1_thetha)^2/Nr)/f2_thetha
];
function res = Needlebc(f0,finf)
a=0.01;e=0.7;
res = [f0(1)-(a*e/2)
f0(2)-e/2
finf(2)-(1-e)/2
f0(1)-1
finf(1)-0
];
Error which i found is:
Undefined function or variable 'R'.
Error in Needle>Needleode (line 14)
f1_thetha=f(4)*(R-1)+1;
Error in bvparguments (line 105)
testODE = ode(x1,y1,odeExtras{:});
Error in bvp4c (line 130)
bvparguments(solver_name,ode,bc,solinit,options,varargin);
Error in Needle (line 5)
sol = bvp4c(@Needleode,@Needlebc,solinit);
>>
Réponse acceptée
Plus de réponses (1)
Your boundary conditions contradict each other:
f0(1)-(a*e/2)
f0(1)-1
So f(1) at x = 0.01 should be at the same time 0.01*0.7/2 = 0.0035 and 1. That's not possible.
Catégories
En savoir plus sur Boundary Value Problems dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!