I am trying to build my model up and keep running into this output from BARON: Clp0019I {x} variables/rows fixed as scaled bounds too close
. I checked the BARON manual but I wasn't able to find anything that mentions this issue. I found another question where somebody had the exact same issue but I wasn't able to really solve the issue after studying that question for a little while. When I initiate the solve, the BARON output will spam me with that message until I manually stop the solver.
I am using PYOMO and the BARON solver, and below I have generated a minimal reproducible example ready to be copy-pasted, the output from BARON is also listed below.
When I do not include the second constraint, the model is able to solve and I do not run into any problems. However, once this constraint is introduced then I get the problem from above. If anybody can maybe shine some light on why this is occurring that would be great. There are also a couple of things that might be relevant to the error which I will note below:
- The model upper bound is 1E+52 --> This could be problematic and a red flag, but I also am not confident that this means anything in particular to the error that is occurring.
- If you remove the second constraint and solve the model, the solver is able to complete the solve during preprocessing --> This is just something I have noticed, I don't know if it's significant to the problem at hand.
- There might also be something going on with how I have formulated the second constraint that seems to not sit well with the solver.
Minimal Reproducible Example
from __future__ import division
from pyomo.environ import *
from MPBFunctions import *
from pyomo import environ as pym
from pyomo.util.infeasible import *
import pandas as pd
import time
#import math
model = ConcreteModel()
########################################################################################################################
# Set Declaration
########################################################################################################################
Imax = 3
Jmax = 3
Tmax = 1
model.Iset = RangeSet(1, Imax)
model.Jset = RangeSet(1, Jmax)
model.Tset = RangeSet(0, Tmax)
model.Tset2 = RangeSet(1, Tmax)
########################################################################################################################
# Parameter Declaration
########################################################################################################################
model.p = Param(initialize = 203.84)
model.tau = Param(initialize = 0.05)
model.hfee = Param(initialize = 10.69)
model.dfee = Param(initialize = 9.74)
model.c = Param(initialize=137)
model.c0 = Param(initialize = 0.0000349)
model.c1 = Param(initialize = 4)
model.alpha = Param(model.Iset, model.Jset, initialize = {(1, 1): 0.313876345630547,
(1, 2): 0.300292323327834,
(1, 3): 0.348387132466427,
(2, 1): 0.295435707228957,
(2, 2): 0.28522932311189,
(2, 3): 0.287451178160919,
(3, 1): 0.317860171471026,
(3, 2): 0.27807922348595,
(3, 3): 0.275393916055552})
model.TotalVol = Param(model.Iset, model.Jset, initialize = {(1, 1): 2190.59783126487,
(1, 2): 1207.90298253892,
(1, 3): 1050.0053718149,
(2, 1): 704.123722773656,
(2, 2): 1804.76078561487,
(2, 3): 443.906913433536,
(3, 1): 329.654678511934,
(3, 2): 278.458426872543,
(3, 3): 781.01472605762} )
def volume_sum(model):
return sum(sum(model.TotalVol[i,j] for i in model.Iset) for j in model.Jset)
model.InitialVol = Param(initialize=volume_sum)
########################################################################################################################
# Variable Declaration
########################################################################################################################
# Control Variable & Initial Guess of Variable
model.L = Var(model.Iset, model.Jset, model.Tset, bounds = (0,1), initialize = {(1, 1, 1): 0.5,
(1, 2, 1): 0.24,
(1, 3, 1): 0.2,
(2, 1, 1): 0.3,
(2, 2, 1): 0.09,
(2, 3, 1): 0.4,
(3, 1, 1): 0.1,
(3, 2, 1): 0.14,
(3, 3, 1): 0.8})
model.incell_weight = Var(model.Iset, model.Jset, model.Tset, bounds=(0,1), initialize=None)
# State Variables - Initially fixed, but governed by biological constraints
model.susceptible = Var(model.Iset, model.Jset, model.Tset, bounds=(0,8000), initialize = {(1, 1, 0): 6979.1746391853,
(1, 2, 0): 4022.4237807779,
(1, 3, 0): 3013.90399921295,
(2, 1, 0): 2383.33994688046,
(2, 2, 0): 6327.40268751015,
(2, 3, 0): 1544.28628984443,
(3, 1, 0): 1037.10596073212,
(3, 2, 0): 1001.36365234999,
(3, 3, 0): 2835.9912130378})
model.G_PostTreatment = Var(model.Iset, model.Jset, model.Tset, bounds=(0,200), initialize = {(1, 1, 0): 0.0,
(1, 2, 0): 0.0,
(1, 3, 0): 14.0,
(2, 1, 0): 14.0,
(2, 2, 0): 0.0,
(2, 3, 0): 3.0,
(3, 1, 0): 9.0,
(3, 2, 0): 0.0,
(3, 3, 0): 0.0})
model.G_NewGrowth = Var(model.Iset, model.Jset, model.Tset, bounds=(0,200), initialize = {(1, 1, 0): 0.0,
(1, 2, 0): 0.0,
(1, 3, 0): 14.0,
(2, 1, 0): 14.0,
(2, 2, 0): 0.0,
(2, 3, 0): 3.0,
(3, 1, 0): 9.0,
(3, 2, 0): 0.0,
(3, 3, 0): 0.0})
# Fix State Variables
[model.susceptible[i,j,0].fix() for i in model.Iset for j in model.Jset]
[model.G_PostTreatment[i,j,0].fix() for i in model.Iset for j in model.Jset]
[model.G_NewGrowth[i,j,0].fix() for i in model.Iset for j in model.Jset]
# Variables without initial values.
model.incell_weight = Var(model.Iset, model.Jset, model.Tset, bounds=(0,1))
########################################################################################################################
# Objective Function
########################################################################################################################
def objective_rule(model):
return (model.p * model.tau + model.hfee)*model.InitialVol - \
sum (sum (sum ((model.dfee*model.alpha[i, j])*model.G_PostTreatment[i, j, t] + model.c*model.L[i, j, t]*model.G_NewGrowth[i, j, t] \
for i in model.Iset ) for j in model.Jset ) for t in model.Tset2 )
model.damages = Objective(rule=objective_rule, sense=minimize)
#########################################################################################################################
## Constraint Declaration
#########################################################################################################################
def susceptible_rule(model,i,j,t):
if t == 0:
return Constraint.Skip
else:
return model.susceptible[i,j,t] == model.susceptible[i,j,t-1] - model.G_NewGrowth[i,j,t-1]
model.susceptible_constraint = Constraint(model.Iset, model.Jset, model.Tset, rule = susceptible_rule)
def incell_weight_rule(model,i,j,t):
if t == 0:
return Constraint.Skip
else:
return model.incell_weight[i,j,t] == 1 - exp( -1 * (model.c0 * model.susceptible[i,j,t])**model.c1 )
model.incell_weight_rules = Constraint(model.Iset, model.Jset, model.Tset, rule = incell_weight_rule)
########################################################################################################################
# Solving The Model
########################################################################################################################
solver = SolverFactory('baron')
results = solver.solve(model, tee=True)
model.pprint()
print(results)
Expected Output
===========================================================================
BARON version 20.4.14. Built: WIN-64 Tue Apr 14 21:23:22 EDT 2020
BARON is a product of The Optimization Firm.
For information on BARON, see https://minlp.com/about-baron
Changing option LPSol to 8 (CLP) and continuing.
If you use this software, please cite publications from
https://minlp.com/baron-publications, such as:
Khajavirad, A. and N. V. Sahinidis,
A hybrid LP/NLP paradigm for global optimization relaxations,
Mathematical Programming Computation, 10, 383-421, 2018.
===========================================================================
This BARON run may utilize the following subsolver(s)
For LP/MIP/QP: CLP/CBC
For NLP: IPOPT, FILTERSD, FILTERSQP
===========================================================================
Doing local search
Unable to find/load CPLEX library cplex12100.dll.
Unable to find/load CPLEX library cplex1290.dll.
Solving bounding LP
Starting multi-start local search
Done with local search
===========================================================================
Iteration Open nodes Time (s) Lower bound Upper bound
1 1 0.06 -68301.8 0.100000E+52
Clp0019I 1 variables/rows fixed as scaled bounds too close
....
....
Clp0019I 36 variables/rows fixed as scaled bounds too close