Trust-Region Dogleg Method - what do I do?

10 次查看(过去 30 天)
Im trying to solve two equations with two unknowns, however it come back saying "No solution found, fsolve stopped because the problem appears to be locally singular."
then the link says "For more information, see Trust-Region Dogleg Method."
My code is
options = optimset('Display','iter','TolFun',1e-22, 'MaxFunEvals', 1000000, 'MaxIter', 1000000, 'TolX', 0.0000000000000000000000001);
x0 = [-0.002; 5;];
[x,fval] = fsolve(@moments5,x0,options)
But the help files say that fsolve uses the "Trust-Region Dogleg Method" by default.
So is there nothing more I can do? Am I already using the T-R Dogleg Method? I really need to solve these equations.
my m file is
function F = moments5(x)
F = [ (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2)))/x(2)) + (6*(-0.00000020584663788071 - (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2)))/x(2) ) - (((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 3)* x(2)*(2*(-0.00000020584663788071 - (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2))))*((-0.00000020584663788071 - 3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2) )/(-2*(((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510*x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 2)*x(2)*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) )))) - 0.00000001777307772116 ;
15*(-0.00000020584663788071 - (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2)))/x(2)^2 - (((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 3)* (20*(-0.00000020584663788071 - (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2))))*((-0.00000020584663788071 - 3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2) )/(-2*(((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 2)*x(2)*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) )))) + (-4 + ((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1))))) *(-3 + ((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))))*x(2)^2*(4*(-0.00000020584663788071 - (3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2))) )*((-0.00000020584663788071 - 3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2) )/(-2*(((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 2)*x(2)*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))))*((-0.00000020584663788071 - 3*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) ))/x(2) )/(-2*(((-0.00000020584663788071*x(2)^2 - 0.00004503498440459510 *x(2))/(2*(-0.00000020584663788071)*x(2)^2 - 7*0.00004503498440459510 *x(2) - 3*(-0.00021667822379937900 - x(1)))) - 2)*x(2)*(0.00004503498440459510 - ((-0.00021667822379937900 - x(1))/x(2) )))) + 0.00000000039625474282 ];

回答(1 个)

Andrew Newell
Andrew Newell 2011-3-18
It is not asking you to change the method. It is telling you that it can't converge on the answer. The reason is your unrealistically tight tolerances for the answer. If you use TolFun = 1e-8 and TolX=1e-6, the optimizer works fine. If you really need your answer to such a high accuracy, you could try the Symbolic Toolbox.

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by