No solution found with 'fsolver'

8 visualizzazioni (ultimi 30 giorni)
Alejandra Cedenilla
Alejandra Cedenilla il 7 Nov 2015
Risposto: Star Strider il 7 Nov 2015
I'm trying to solve these problem, but there might be a problem somewhere that I can't find. Could you please help me?
function F = myfun(x)
a=300;
b=35;
Ta=300*9.8;
O1=20+273.15;
p=1.826*9.8;
A=sqrt(a^2+b^2);
F = [x(1)*cosh((x(2)+a)/x(1))-x(1)*cosh(x(2)/x(1))-b;
p*x(1)*cosh(x(2)/x(1))-Ta];
end
x0 = [1000; 10];
x = fsolve(@myfun,x0)
Matlab says:
No solution found.
fsolve stopped because the last step was ineffective. However, the vector of function
values is not near zero, as measured by the default value of the function tolerance.
<stopping criteria details>
x =
119.2596
-102.0987
¡Thank you!

Risposte (1)

Star Strider
Star Strider il 7 Nov 2015
That means that fsolve encountered a local minimum that produced a result far from zero and the gradient descent offered no other options.
However, it converges quite well if you allow complex solutions, and add ‘fval’ to the returned output of fsolve:
x0 = [1000*1i; 1000*1i];
converges to:
x =
101.4346e+000 - 61.6563e+000i
-141.2781e+000 - 8.4579e+000i
fval =
568.4342e-015 + 1.2506e-012i
-2.2737e-012 - 9.0949e-012i
which is acceptably close to zero.

Categorie

Scopri di più su Systems of Nonlinear Equations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by