No solution found with 'fsolver'

8 ビュー (過去 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 Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by