SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
Optimization using quadprog [ Reply ]
By: Arvind Krishnan on 2018-10-23 16:05
[forum:46364]
Hey guys, I'm trying to minimize a quadratic function using quadprog in R. The problem has been formulated and it runs on the web console but it isn't finding the optimum. Seems like the iterations stop too early. The equality and inequality constraints are met but the solution is not the optimum.

Any help/suggestions would be appreciated!

Here is the problem:

Objective function to be minimized:
0.09x^2 + 0.36y^2 + 0.36xy -0.27x - 0.54y +0.45^2

Constraints:
x+y = 150
0.3x + 0.6y > 0.4
0.3x + 0.6y < 0.5

Here is the formulation in R that I'm running on the web console:

library(quadprog)
Dmat <- matrix(c(0.000008,0,0.0048,0.000032),2,2,byrow = TRUE)
dvec <- c(0.0024,0.0048)
Amat <- matrix(c(1,-0.002,0.002,0,1,1,-0.004,0.004,1,0),2,5,byrow = TRUE)
bvec <- c(150,-0.9,0.1,0,0)
solve.QP(Dmat,dvec,Amat,bvec,meq=1)

Thanks to:
Vienna University of Economics and Business Powered By FusionForge