You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across the following problem when I tried to debug a Maros Meszaros benchmark. The following problem is HS51 from the problem set. It has the following form:
1/2 x' P x + q' x + r
s.t. l <= Ax <= u
We can solve the problem in COSMO with a Box-constraint:
using COSMO
P =[2.0-2.00.00.00.0;
-2.04.02.00.00.0;
0.02.02.00.00.0;
0.00.00.02.00.0;
0.00.00.00.02.0]
q = [0.; -4; -4; -2; -2];
A = [ 1.03.00.00.00.0;
0.00.01.01.0-2.0;
0.01.00.00.0-1.0;
1.00.00.00.00.0;
0.01.00.00.00.0;
0.00.01.00.00.0;
0.00.00.01.00.0;
0.00.00.00.01.0]
b =zeros(8)
l = [ 4.0;
0.0;
0.0;
-1.0e20;
-1.0e20;
-1.0e20;
-1.0e20;
-1.0e20]
u = [4.0;
0.0;
0.0;
1.0e20;
1.0e20;
1.0e20;
1.0e20;
1.0e20;]
# solve with Box constraint l <= Ax <= u
model = COSMO.Model()
constraint = COSMO.Constraint(A, b, COSMO.Box(l, u))
assemble!(model, P, q, constraint)
result = COSMO.optimize!(model);
This yields the correct result obj_val = -6.0.
Now, lets assume we want to solve the same problem using one-sided constraints: l <= Ax <= u <==> -Ax + u >= 0 and Ax - l >= 0
model = COSMO.Model()
constraint1 = COSMO.Constraint(-A, u, COSMO.Nonnegatives)
constraint2 = COSMO.Constraint(A, -l, COSMO.Nonnegatives)
assemble!(model, P, q, [constraint1, constraint2])
result = COSMO.optimize!(model);
which yields the wrong result. It seems like the large values in l and u which internally get set as b mess up (or at least dilute) the residual computations.
We can solve the same problem by removing the unnecessary constraint rows 4-8:
I came across the following problem when I tried to debug a Maros Meszaros benchmark. The following problem is HS51 from the problem set. It has the following form:
We can solve the problem in COSMO with a Box-constraint:
This yields the correct result
obj_val = -6.0
.Now, lets assume we want to solve the same problem using one-sided constraints:
l <= Ax <= u <==> -Ax + u >= 0 and Ax - l >= 0
The solver output:
which yields the wrong result. It seems like the large values in
l
andu
which internally get set asb
mess up (or at least dilute) the residual computations.We can solve the same problem by removing the unnecessary constraint rows
4-8
:unsurprisingly, this again yields the correct result of
obj_val = -6.0
The text was updated successfully, but these errors were encountered: