Hi everyone,
I am currently trying to solve a QP, but it always showed error. Could you please help me to solve the problem. I tried to initialize n[i][j]==1 but it didn't work. Thank you!
// Sets
range A = 1..2;
range B = 1..2;
// Parameters
float S[A] = [10, 12];
float K[A] = [200, 300];
float u[A]= [1,1.5];
float hp = 0.5;
float D = 2000;
// Variables
dvar float+ Q[A][B];
dvar float n[A][B] in 0..100;
// Objective
minimize
sum(i in A, j in B) n[i][j]*S[i] + (hp*sum(i in A, j in B) Q[i][j])/2 + sum(i in A, j in B)n[i][j]*Q[i][j]*u[i];
// Constraints
subject to {
sum(i in A, j in B) n[i][j]*Q[i][j] <= D;
forall(i in A)
sum(j in B) Q[i][j] <= K[i];
}
------------------------------
Hang Vu
------------------------------