0

It is known that for a convex quadratic programming with box constraints if there is a local minimum, then it is the global minimum. However, when I check it in Matlab with quadprog() it does not give the global minimum. How I know this: When I use my own algorithm for the same problem, it gives different and better result. How to understand this?

>> P

P =

    6.2468    0.9349   -3.4358   -1.5025    0.8950
    0.9349    5.8463    1.8075   -2.6750   -1.9500
   -3.4358    1.8075    3.9450    0.1500   -1.7000
   -1.5025   -2.6750    0.1500    2.5000    1.0000
    0.8950   -1.9500   -1.7000    1.0000    2.0000

>> f

    f =

       76.9601
       11.5177
      -42.3284
      -18.5108
       11.0264

>> aux = quadprog(P,f,[],[],[],[],-5*ones(5,1), 5*ones(5,1))

    Minimum found that satisfies the constraints.

    Optimization completed because the objective function is non-decreasing in 
    feasible directions, to within the default value of the optimality tolerance,
    and constraints are satisfied to within the default value of the constraint tolerance.

    <stopping criteria details>


    aux =

       -5.0000
       -2.4391
        5.0000
        2.5638
       -2.6857
 >> 0.5*aux'*P*aux+aux'*f

    ans =

     -413.0378
 >> aux = mpc_op(P,-f,-5,5)

aux =

  -12.3202
    0.0004
   -0.0007
    0.0005
   -0.0004

>> 0.5*aux'*P*aux+aux'*f

ans =

 -474.0713

Thanks

  • 1
    Hi! Welcome to StackOverflow! I would suggest you to be more specific in your question, e.g. by providing the MATLAB code, some test input, the corresponding expected output. See also [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – norok2 Sep 27 '18 at 16:34
  • I also tried lower tolerance values for quadprog(), also tried "trust-region-reflective" algorithm for quadprog(), the same result. – Pasha Pashazade Sep 27 '18 at 18:34
  • Even casual inspection shows that mcp_op's `aux` does not obey the lower bound. – Erwin Kalvelagen Sep 29 '18 at 05:16
  • Yes, I did not notice it before. There a very little bug in the code, I have fixed it and it is now giving the same result as quadprog().Thank you – Pasha Pashazade Sep 29 '18 at 16:18

0 Answers0