glp_set_row_bnds 中范围是(-100,5) (5,100)的如何设置的?
以下是mod文件中设置的参数;
# 导入GLPK模块
var x1; # 声明变量x1,并设置非负约束条件
var x2; # 声明变量x2,并设置非负约束条件
var x3; # 声明变量x3,并设置非负约束条件
var x4;
var x5;
var x6;
var x7;
# 定义目标函数
maximize obj: 59.4829*x1 + 183.8436*x2 + 152.44829*x3 + 29.0876 *x4 +41.31542*x5 + 40.3154238*x6 + x7;
# 定义约束条件
subject to limit1: 19.95<=x1<=20.75;
subject to limit2: 20.03<=x2<=20.83;
subject to limit3: 20.17<=x3<=20.97;
subject to limit4: 16.5<=x4<=16.5;
subject to limit5: 16.5<=x5<=16.5;
subject to limit6: 20.00<=x6<=20.00;
subject to limit7: x7=>20.97&&x7<=20.17; # 这句一直报错
subject to c1: x2 - x1 >= 0.2974; # -0.2974
subject to c2: x3 - x2 >= 0.6218;
subject to c3: x4 - x3 >= 0.1404;
subject to c4: x5 - x4 >= 0.005;
subject to c5: x6 - x5 >= 0.201577;
# 求解模型
solve;
# 输出结果
printf "Solution: \n";
printf "x1 = %g\n", x1;
printf "x2 = %g\n", x2;
printf "x3 = %g\n", x3;
printf "x4 = %g\n", x4;
printf "x5 = %g\n", x5;
printf "x6 = %g\n", x6;
# 结束
end;