Fsolve stopped because problem appears regular

I have to find the intersection point for these 2 non linear ODE's, the graph of both appears below and has an intersection point.
k=4, r=0.6
My code for fsolve is:
k=4;
r=0.6;
fnc = @(x1) [ r.*(1-(x1(1)./k)); x1(1)./(1+x1(1).^2)]
[xx,fval]=fsolve(fnc, [1 1])
When I try to use fsolve with the code above, the error says:
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient,
but the vector of function values is not near zero as measured by the
value of the function tolerance.
<stopping criteria details>
These still occurs with different guess values

 Respuesta aceptada

Matt J
Matt J el 9 de Nov. de 2020
Editada: Matt J el 9 de Nov. de 2020
k=4;
r=0.6;
fnc = @(x1) [ r.*(1-(x1(1)./k)) ;x1(1)./(1+x1(1).^2)];
[xx,difference]=fzero(@(x1) diff(fnc(x1)), [-2,2])
xx = 0.7736
difference = -5.5511e-17
fnc(xx)
ans = 2×1
0.4840 0.4840

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Nov. de 2020

Editada:

el 9 de Nov. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by