No solution found with 'fsolver'

조회 수: 7 (최근 30일)
Alejandra Cedenilla
Alejandra Cedenilla 2015년 11월 7일
답변: Star Strider 2015년 11월 7일
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!

답변 (1개)

Star Strider
Star Strider 2015년 11월 7일
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.

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by