At every second step fmincon stays on the same point but should continue.

12 views (last 30 days)
For some reason fmincon always does one decent step away from its initial point, but then stays on the point of the first iteration and exits optimization due to StepTolerance. In the output below I enter the finishing point of the previous call to fmincon as the starting point to the next call. I tried to decrease StepTolerance. However then fmincon runs indefinitely and does not stop when it actually found the (supposed) optimum.
  • How can I prevent this behaviour?
  • What could be peculiar about the objective function?
Thank you very much for your time.
Iter F-count f(x) Feasibility optimality step
0 13 1.097369e+04 0.000e+00 2.161e+02
1 35 1.096956e+04 0.000e+00 2.161e+02 1.053e-01
2 49 1.096956e+04 0.000e+00 2.161e+02 2.279e-15
Optimization stopped because the relative changes in all elements of x are
less than options.StepTolerance = 1.000000e-10, and the relative maximum constraint
violation, 0.000000e+00, is less than options.ConstraintTolerance = 1.000000e-06.
Optimization Metric Options
max(abs(delta_x./x)) = 5.82e-16 StepTolerance = 1e-10 (default)
relative max(constraint violation) = 0.00e+00 ConstraintTolerance = 1e-06 (default)
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 13 1.096956e+04 0.000e+00 2.161e+02
1 35 1.096591e+04 0.000e+00 2.154e+02 1.056e-01
2 49 1.096591e+04 0.000e+00 2.154e+02 2.565e-15
Optimization stopped because the relative changes in all elements of x are
less than options.StepTolerance = 1.000000e-10, and the relative maximum constraint
violation, 0.000000e+00, is less than options.ConstraintTolerance = 1.000000e-06.
Optimization Metric Options
max(abs(delta_x./x)) = 6.48e-16 StepTolerance = 1e-10 (default)
relative max(constraint violation) = 0.00e+00 ConstraintTolerance = 1e-06 (default)
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 13 1.096591e+04 0.000e+00 2.154e+02
1 35 1.096221e+04 0.000e+00 2.154e+02 1.057e-01
2 49 1.096221e+04 0.000e+00 2.154e+02 2.675e-15
Optimization stopped because the relative changes in all elements of x are
less than options.StepTolerance = 1.000000e-10, and the relative maximum constraint
violation, 0.000000e+00, is less than options.ConstraintTolerance = 1.000000e-06.
Optimization Metric Options
max(abs(delta_x./x)) = 6.67e-16 StepTolerance = 1e-10 (default)
relative max(constraint violation) = 0.00e+00 ConstraintTolerance = 1e-06 (default)

Answers (1)

Adam Danz
Adam Danz on 24 Aug 2018
It looks like the algorithm settled quickly at a local minima. This isn't necessarily a bad thing - you just want to make sure it's the global minima. One thing you can do is set your StepTolerance (see link) but I have a feeling that won't change much.
Another idea is to set up a loop that will try many different initial point guesses and if it always settles at the same minima, congrats!

Community Treasure Hunt

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

Start Hunting!