Solver ignores my guess

2 次查看(过去 30 天)
Tim
Tim 2014-6-13
编辑: Matt J 2014-6-13
I am using a the constrained solver fmincon with 2 constrains: all values of x >= 0 and the sum of x is equal to y.
I know the analytic solution for some low y values and I use those as a guess. When look at what fmincon puts into my function, I see that it doesn't put my guess value in to it. And it does not reach my guess values, so it reaches some kind of local minimum. Why is fmincon being stubborn and why doesn't it use my guess values?
  4 个评论
Mahdi
Mahdi 2014-6-13
Have you tried using a value slight bigger than zero? Like 0.00000001, does the same problem happen?
Matt J
Matt J 2014-6-13
编辑:Matt J 2014-6-13
What is the the value of y? 50?
What is the final value of x that fmincon returns?
What is the value of the 3rd output argument "exitflag"?
What options are you passing to fmincon (TolCon, TolFun, Algorithm, etc...)?

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2014-6-13
编辑:Matt J 2014-6-13
The 'interior point' algorithm would ignore your initial guess when AlwaysHonorConstraints='bounds', which is the default. Then, it needs to find a starting point in the interior of your bound constraints. Hence,
x0 = [50 1 1 1 1 1]
is a valid candidate.
  1 个评论
Tim
Tim 2014-6-13
Thanks for your help! At the end, I changed a lot of the tolerance options which resulted in a final solution that was acceptably close to my initial guess.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by