Quadratic Problem 1
[REMOVE_ME]maximize x12+x22+x32−5x2[REMOVEME2]
[REMOVE_ME]subject to:[REMOVEME2]
[REMOVE_ME]−4x1−3x2+≥−8[REMOVEME2]
[REMOVE_ME]2x1+x2+≥2[REMOVEME2]
[REMOVE_ME]−2x2+x3≥0[REMOVEME2]
[REMOVE_ME]x1,x2,x3≥0[REMOVEME2]
Description
maximize x12+x22+x32−5x2
subject to:
−4x1−3x2+≥−8
2x1+x2+≥2
−2x2+x3≥0
x1,x2,x3≥0
Examples
Sys.setenv(ROI_LOAD_PLUGINS = "FALSE")
library("ROI")
library("ROI.plugin.qpoases")
A <- cbind(c(-4, -3, 0),
c( 2, 1, 0),
c( 0, -2, 1))
x <- OP(Q_objective(diag(3), L = c(0, -5, 0)),
L_constraint(L = t(A),
dir = rep(">=", 3),
rhs = c(-8, 2, 0)))
opt <- ROI_solve(x, solver="qpoases")
opt
## Optimal solution found.
## The objective value is: -2.380952e+00
solution(opt)
## [1] 0.4761905 1.0476190 2.0952381