My objective functions optimal value is confirmed to be non-zero, but I am getting 0 for it while trying to run an ampl program. Can you please help?
The mod file contains my constraints and objective function. I am solving this using the simplex method. this is the only method I am allowed to use. I am trying to recreate the results of a research paper.
.mod file
reset;
param N;
# Define decision variables
var a >= 0;
var b >= 0;
var c >= 0;
var d >= 0;
var e >= 0;
var f >= 0;
var g >= 0;
# Define objective function
maximize Z: 0.1*a + 0.2*b + 0.2*c + 0.1*d + 0.3*e + 0.2*f + 0.1*g;
# Define constraints
subject to constraint1: a + b + c + d + e + f + g <= 15000000;
subject to constraint2: 0.2*(4*a - b - c - d - e - f - g) <= 0;
subject to constraint3: 0.2*(a - 4*b + c + d + e + f + g) >= 0;
subject to constraint4: 0.2*(a + b - 4*c + d + e + f + g) >= 0;
subject to constraint5: 0.2*(a + b + c - 4*d + e + f + g) >= 0;
subject to constraint6: 0.2*(a + b + c + d - 4*e + f + g) >= 0;
subject to constraint7: 0.2*(a + b + c + d + e - 4*f + g) >= 0;
subject to constraint8: 0.2*(a + b + c + d + e + f - 4*g) >= 0;
subject to constraint9: 0.8*a - 0.3*b - 0.3*c - 0.3*d - 0.3*e - 0.3*f + 0.8*g >= 0;
subject to constraint10: 0.3*a + 0.3*b - 0.7*c + 0.3*d + 0.3*e - 0.7*f + 0.3*g <= 0;
subject to constraint11: 0.5*a - 0.6*b + 0.5*c + 0.5*d - 0.5*e + 0.5*f + 0.5*g <= 0;
subject to constraint12: 0.3*a - 0.5*b + 0.5*c + 0.1*d - 0.9*e + 0.5*f - 0.2*g >= 0;
.run file
reset;
model Desktop/LO/Presentation/portfolio.mod;
# Solve the problem using the GLPK solver
option solver cplex;
solve;
display Z;
display a,b,c,d,e,f,g;
output
ampl: include Desktop/LO/Presentation/portfolio.run
CPLEX 22.1.1.0: optimal solution; objective 0
5 dual simplex iterations (1 in phase I)
Z = 0
a = 0
b = 0
c = 0
d = 0
e = 0
f = 0
g = 0