MATLAB Answers

simple fmincon problem, optimization toolbox

3 views (last 30 days)
Bobby Fischer
Bobby Fischer on 10 Sep 2021
Edited: Matt J on 10 Sep 2021
I have an optimization problem in that Matlab solves depending on the initial value given. First, I give X0 = [10 10 10] as the initial value, and ok. But then I give X0 = [0 0 0] as the initial value, which is not a minimum, Matlab gives it as the minimum. Why?
FUN = @(x)-prod(x);
X0 = [10 10 10];
A = [-1 -2 -3;
1 2 3];
B = [0 ; 72];
options = optimset('Display','iter');
X = fmincon(FUN, X0, A, B, [], [], [], [], [], options)
First-order Norm of Iter F-count f(x) Feasibility optimality step 0 4 -1.000000e+03 0.000e+00 9.622e+01 1 8 -2.137831e+03 0.000e+00 1.817e+02 7.782e+00 2 12 -2.198098e+03 0.000e+00 8.705e+01 3.238e+00 3 17 -2.281344e+03 0.000e+00 2.825e+01 6.225e+00 4 21 -2.303595e+03 0.000e+00 2.554e+00 1.755e+00 5 25 -2.303998e+03 0.000e+00 1.707e-01 2.181e-01 6 29 -2.304000e+03 0.000e+00 1.713e-02 2.213e-02 7 33 -2.304000e+03 0.000e+00 1.381e-03 1.352e-03 8 37 -2.304000e+03 0.000e+00 7.437e-06 8.647e-05 Local minimum found that satisfies the constraints. Optimization completed because the objective function is non-decreasing in feasible directions, to within the value of the optimality tolerance, and constraints are satisfied to within the value of the constraint tolerance.
X = 1×3
24.0000 12.0000 8.0000
FUN = @(x)-prod(x);
X0 = [0 0 0];
A = [-1 -2 -3;
1 2 3];
B = [0 ; 72];
options = optimset('Display','iter');
X = fmincon(FUN, X0, A, B, [], [], [], [], [], options)
First-order Norm of Iter F-count f(x) Feasibility optimality step 0 4 -0.000000e+00 0.000e+00 0.000e+00 Initial point is a local minimum that satisfies the constraints. Optimization completed because at the initial point, the objective function is non-decreasing in feasible directions to within the value of the optimality tolerance, and constraints are satisfied to within the value of the constraint tolerance.
X = 1×3
0 0 0

Answers (1)

Matt J
Matt J on 10 Sep 2021
Edited: Matt J on 10 Sep 2021
The point X=[0,0,0] is a first order local minimum. It is a point of zero-gradient, and it satisfies the constraints. You made an unlucky initial guess.
Incidentally, if you are looking for solutions with positive x(i) it would probably be better, numerically, to use the equivalent objective function
FUN=@(x)-sum(log(x))
as well as to impose lower bounds lb=[0;0;0]

Community Treasure Hunt

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

Start Hunting!

Translated by