initial guess for bvp4c
Show older comments
rsco=0.0024 %Reference SC resistance at h0 mmHg/(μl/min)
rje = 2.08 %mmHg/(μl/min)
rd=0.694 %mmHg/(μl/min)
beta=rje/rsco
x=0:0.01:1; %μm
pac=15 %mmHg
pev=9 %mmHg
fi=rje/rd
%""you must provide an initial guess for the solution ?? here there is the
%problem everything else seems to be correct""
%--> suggestion from Matlab A: crude mesh of five points and a constant
%guess that satisfies the boundary conditions are good enough to get
%convergence on the interval
infinity = 1;
maxinfinity = 2;
solinit = bvpinit(linspace(0,infinity,2),[25 0 0]); %don't know how to manage it
sol = bvp4c(@fsode,@fsbc,solinit);
function dfdeta = fsode(y) %Function
dfdeta = [y(2)
(4/beta)*((y(1))^(1/4)-1)];
end
function res = fsbc(y0,y1) %Boundaries Conditions
res = [y0(2)
-((4*fi)/beta)*(y1(1)^(1/4)-1+pac-pev)];
end
this is my code I don't know why Matlab gives me this type of error
Error using case_1>fsode
Too many input arguments.
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 case_1 (line 26)
sol = bvp4c(@fsode,@fsbc,solinit);
can anyone help? thank you
1 Comment
MOSLI KARIM
on 9 Feb 2023
- I have corre
- I have corrected your code
function bvp_6
global fi beta pac pev rsco rje rd
rsco=0.0024; %Reference SC resistance at h0 mmHg/(μl/min)
rje = 2.08; %mmHg/(μl/min)
rd=0.694 ;%mmHg/(μl/min)
beta=1;
x=0:0.01:1; %μm
pac=15; %mmHg
pev=9 ;%mmHg
fi=rje/rd ;
%""you must provide an initial guess for the solution ?? here there is the
%problem everything else seems to be correct""
%--> suggestion from Matlab A: crude mesh of five points and a constant
%guess that satisfies the boundary conditions are good enough to get
%convergence on the interval
infinity = 1;
maxinfinity = 2;
solinit = bvpinit(linspace(0,infinity,2),[25 0 ]); %don't know how to manage it
sol = bvp4c(@fct,@BC ,solinit)
figure(1)
hold on
plot(sol.x,sol.y)
function dfdeta = fct(x,y) %Function
dfdeta = [y(2);
(4/beta)*((y(1))^(1/4)-1)];
end
function res = BC(ya,yb) %Boundaries Conditions
% global fi beta pac pev
res = [ya(2)
-((4*fi)/beta)*(yb(1)^(1/4)-1+pac-pev)];
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Boundary Value Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!