x = fmincon(fun,[1 1 2],A,b,Aeq,beq,lb,ub,nonlcon,options)
Iter Func-count Fval Feasibility Step Length Norm of First-order
step optimality
0 4 3.000000e+00 4.000e+00 1.000e+00 0.000e+00 2.000e+00
1 9 2.928889e+00 3.352e+00 7.000e-01 1.504e+00 9.644e-01
2 13 2.571265e+00 7.559e-01 1.000e+00 1.060e+00 3.470e-01
3 17 2.789068e+00 2.110e-01 1.000e+00 7.947e-01 3.581e-01
4 21 2.988095e+00 1.191e-02 1.000e+00 3.066e-01 4.893e-02
5 25 2.999988e+00 1.161e-05 1.000e+00 1.437e-02 9.121e-04
6 29 3.000000e+00 5.045e-09 1.000e+00 7.238e-05 1.451e-04
7 33 3.000000e+00 5.265e-09 1.000e+00 7.255e-05 1.646e-07
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.
<stopping criteria details>
x =
2.99999999210178 -1.73125747607761e-08 1.00000000263274
>> x = fmincon(fun,[-1 1 0],A,b,Aeq,beq,lb,ub,nonlcon,options)
Iter Func-count Fval Feasibility Step Length Norm of First-order
step optimality
0 4 1.000000e+00 3.000e+00 1.000e+00 0.000e+00 2.000e+00
1 12 1.720300e+00 2.280e+00 2.401e-01 7.203e-01 1.520e+00
2 19 1.688289e+00 1.455e+00 3.430e-01 9.684e-01 6.358e-01
3 23 2.587102e+00 4.133e-01 1.000e+00 1.342e+00 6.046e-01
4 27 2.929079e+00 7.341e-02 1.000e+00 6.240e-01 2.038e-01
5 31 3.000225e+00 6.050e-04 1.000e+00 9.457e-02 5.761e-02
6 35 3.000027e+00 5.576e-04 1.000e+00 2.362e-02 1.620e-02
7 39 3.000000e+00 2.761e-05 1.000e+00 5.308e-03 4.556e-04
8 43 3.000000e+00 2.435e-09 1.000e+00 6.453e-05 2.124e-05
9 47 3.000000e+00 0.000e+00 1.000e+00 4.398e-09 1.192e-06
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.
<stopping criteria details>
x =
-3.00000000000053 5.92273862321821e-07 -0.999999999999825
Best Answer