Failure in initial objective function evaluation. FSOLVE cannot continue.
Afficher commentaires plus anciens
Hi all,
I'm trying to solve a non linear, parametric system of equations.
Here my myfun_driver.m file containing the call to the function with fsolve:
fun = @root7d;
x0 = [0,0];
x = fsolve(fun,x0);
Here the root7d.m file where I defined the function and parameters (the main function has a call to othe functions, I don't know if I'm doing well):
%parameters
Vp=100;
Kp=0.5;
q=1;
phi=0.006;
MIN=1;
N1=10;
gb=0.8;
gp=0.45;
g1=0.6;
g2=0.5;
g3=0.6;
gf=0.75;
arb=1-ar;
ar=0.2;
r1=0.8;
eps2=0.02;
rho = @(x,vp,kp,gp,gb,MIN,N1)( (1-gp)* vp*x(1)/(kp+x(1))...
+ (1-gb)* (MIN*exp(x(1)/N1)*x(2)));
G1 = @(x,ar,eps2)((ar*x(2)+(1-ar)*x(2))/(eps2^2 + (ar*x(2)+(1-ar)*x(2))^2));
function F = root7d(x,vp,kp,q,phi,r1,MIN,N1,gb,ar,arb)
F(1) = -vp*x(1)/(kp+x(1))*q*x(2) +q*rho(x,gp,gb) + phi - r1*MIN*exp(x(1)/N1)*x(2);
F(2) = gb*r1*MIN*exp(x(1)/N1)*x(2) - r1*G1(x,ar)*arb*x(2)/(ar*x(2)+(1-ar)*x(2));
end
I don't know why I obtain the following message: Failure in initial objective function evaluation. FSOLVE cannot continue.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!