Integer Decision Variables Always Forced to Zero in Minimization Problem (MINLP)

Gas pipes - why does gas burn "outwards?"

What exactly is a marshrutka (маршрутка)?

"Literally" Vs "In the true sense of the word"

How do email clients "send later" without storing a password?

Relocation error, error code (127) after last updates

How is Team Scooby Doo (Mystery Inc.) funded?

Do ibuprofen or paracetamol cause hearing loss?

Double it your way

Why do sellers care about down payments?

How to help my 2.5-year-old daughter take her medicine when she refuses to?

Do any aircraft carry boats?

Why island and not light?

How to stabilise the bicycle seatpost and saddle when it is all the way up?

Why did it become so much more expensive to start a university?

Are there any non-WEB re-implementation of TeX Core in recent years?

Why did they ever make smaller than full-frame sensors?

Leaving out pronouns in informal conversation

Maintenance tips to prolong engine lifespan for short trips

Can I toggle Do Not Disturb on/off on my Mac as easily as I can on my iPhone?

How can a Scotland-NI bridge break Brexit impasse?

Which ping implementation is Cygwin using?

How are chord ratios developed exactly?

Uncovering the Accelerated Dragon opening

Is English tonal for some words, like "permit"?



Integer Decision Variables Always Forced to Zero in Minimization Problem (MINLP)














3












$begingroup$


I am trying to write out a MINLP problem of optimal control for an invasive species and the code that I have for my PYOMO model is below. Some of the initialization values take from an Excel spreadsheet, so they are not made explicit in the formulation below. Additionally, these values aren't real data, but simulated data I have made just to try and get my model running.



The problem that I am encountering is that my binary variable model.level1, which emphasizes whether or not a cell receives treatment, is always slammed to zero in my objective function which indicates that no control is applied to any cells and this effect cascades throughout the rest of the equations and results in unrealistic results even for fake data.



Perhaps I am overlooking something in my constraints that are causing the binary variable to be slammed to 0 rather than having a variety of different 0's and 1's throughout the solution?





model = ConcreteModel()
Imax = 2
Jmax = 2
Tmax = 3
Kmax = 2
model.Iset = RangeSet(1, Imax) # e.g. i = 1, 2, 3
model.Jset = RangeSet(1, Jmax)
model.Tset = RangeSet(1, Tmax)
model.Kset = RangeSet(1, Kmax)

model.juvsurv = Param(initialize=0.60)
model.juvdeath = Param(initialize=0.40)
model.lambd = Param(initialize=0.20)
model.alpha = Param(initialize=2)

model.juvenille = Var(model.Iset, model.Jset, model.Tset, model.Kset, within=NonNegativeReals, initialize=initial_values_ext(3, Tmax, 2, juvenille_init))
model.susceptible = Var(model.Iset, model.Jset, model.Tset,within=NonNegativeReals, initialize=initial_values(3, Tmax, susceptible_init))
model.juvenilleTotal = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
model.inf_b4treat = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals, initialize=initial_values(3, Tmax, inf_b4treat_init))
model.inf_treated = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
model.obj = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)

def objective_rule(model):
return sum (sum (sum (model.obj[i,j,t] for i in model.Iset ) for j in model.Jset ) for t in model.Tset )
model.damages = Objective(rule=objective_rule, sense=minimize)

def obj_rule(model, i,j,t):
return model.obj[i,j,t] == 10*model.inf_b4treat[i,j,t] + 5*model.level1[i,j,t]*model.inf_b4treat[i,j,t]
model.object = Constraint(model.Iset, model.Jset, model.Tset, rule=obj_rule)

# Constraint 1: juvenilles that advance to the next age class (eq. 1)
def juv_advance_rule(model, i, j, t, k):
if t != Tmax and k != Kmax:
return model.juvenille[i, j, t + 1, k + 1] == model.juvenille[i, j, t, k] * model.juvsurv
return Constraint.Skip
model.juv_advance = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_advance_rule)

# Constraint 2: total number of juvenilles in all age classes on cell (i,j)
def juv_total_rule(model, i, j, t):
return model.juvenilleTotal[i, j, t] == sum(model.juvenille[i, j, t, k] for k in model.Kset)
model.juv_total = Constraint(model.Iset, model.Jset, model.Tset, rule=juv_total_rule)

# Constraint 3: recruitment of seedlings to the first juvenille age class.
def juv_recruit_rule(model, i, j, t, k):
if k == 1 and t != Tmax:
return model.juvenille[i, j, t + 1, k] == model.juvdeath * model.juvenilleTotal[i, j, t]
else:
return Constraint.Skip
model.juv_recruit = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_recruit_rule)

# Constraint 4: Susceptible recruitment
def susceptible_advance_rule(model, i, j, t):
if t == Tmax:
return Constraint.Skip
else:
return model.susceptible[i, j, t + 1] == model.susceptible[i, j, t] - model.inf_b4treat[i, j, t] + model.juvsurv * model.juvenille[i, j, t, Kmax]
model.susceptible_advance = Constraint(model.Iset, model.Jset, model.Tset, rule=susceptible_advance_rule)

# Constraint 5(10): Population Growth:
def infested_growth_rule(model, i, j, t):
if t == Tmax:
return Constraint.Skip
else:
return model.inf_b4treat[i, j, t + 1] == ( model.inf_treated[i, j, t]**2 / (model.inf_treated[i,j,t]**2 + model.alpha) ) * model.susceptible[i,j,t] + 10
model.inf_growth = Constraint(model.Iset, model.Jset, model.Tset, rule=infested_growth_rule)

# Constraint 9: Treated Infestation
def treatment_rule(model, i, j, t):
return model.inf_treated[i, j, t] == model.inf_b4treat[i, j, t] * (1 - model.level1[i, j, t] )
model.treated_pop = Constraint(model.Iset, model.Jset, model.Tset, rule=treatment_rule)

def budget_rule(model):
return sum(sum(sum(2*model.level1[i,j,t] for i in model.Iset) for j in model.Jset) for t in model.Tset) <= 3
model.budget = Constraint(model.Iset, model.Jset, model.Tset, rule=budget_rule)

```









share|improve this question











$endgroup$


















    3












    $begingroup$


    I am trying to write out a MINLP problem of optimal control for an invasive species and the code that I have for my PYOMO model is below. Some of the initialization values take from an Excel spreadsheet, so they are not made explicit in the formulation below. Additionally, these values aren't real data, but simulated data I have made just to try and get my model running.



    The problem that I am encountering is that my binary variable model.level1, which emphasizes whether or not a cell receives treatment, is always slammed to zero in my objective function which indicates that no control is applied to any cells and this effect cascades throughout the rest of the equations and results in unrealistic results even for fake data.



    Perhaps I am overlooking something in my constraints that are causing the binary variable to be slammed to 0 rather than having a variety of different 0's and 1's throughout the solution?





    model = ConcreteModel()
    Imax = 2
    Jmax = 2
    Tmax = 3
    Kmax = 2
    model.Iset = RangeSet(1, Imax) # e.g. i = 1, 2, 3
    model.Jset = RangeSet(1, Jmax)
    model.Tset = RangeSet(1, Tmax)
    model.Kset = RangeSet(1, Kmax)

    model.juvsurv = Param(initialize=0.60)
    model.juvdeath = Param(initialize=0.40)
    model.lambd = Param(initialize=0.20)
    model.alpha = Param(initialize=2)

    model.juvenille = Var(model.Iset, model.Jset, model.Tset, model.Kset, within=NonNegativeReals, initialize=initial_values_ext(3, Tmax, 2, juvenille_init))
    model.susceptible = Var(model.Iset, model.Jset, model.Tset,within=NonNegativeReals, initialize=initial_values(3, Tmax, susceptible_init))
    model.juvenilleTotal = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
    model.inf_b4treat = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals, initialize=initial_values(3, Tmax, inf_b4treat_init))
    model.inf_treated = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
    model.obj = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)

    def objective_rule(model):
    return sum (sum (sum (model.obj[i,j,t] for i in model.Iset ) for j in model.Jset ) for t in model.Tset )
    model.damages = Objective(rule=objective_rule, sense=minimize)

    def obj_rule(model, i,j,t):
    return model.obj[i,j,t] == 10*model.inf_b4treat[i,j,t] + 5*model.level1[i,j,t]*model.inf_b4treat[i,j,t]
    model.object = Constraint(model.Iset, model.Jset, model.Tset, rule=obj_rule)

    # Constraint 1: juvenilles that advance to the next age class (eq. 1)
    def juv_advance_rule(model, i, j, t, k):
    if t != Tmax and k != Kmax:
    return model.juvenille[i, j, t + 1, k + 1] == model.juvenille[i, j, t, k] * model.juvsurv
    return Constraint.Skip
    model.juv_advance = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_advance_rule)

    # Constraint 2: total number of juvenilles in all age classes on cell (i,j)
    def juv_total_rule(model, i, j, t):
    return model.juvenilleTotal[i, j, t] == sum(model.juvenille[i, j, t, k] for k in model.Kset)
    model.juv_total = Constraint(model.Iset, model.Jset, model.Tset, rule=juv_total_rule)

    # Constraint 3: recruitment of seedlings to the first juvenille age class.
    def juv_recruit_rule(model, i, j, t, k):
    if k == 1 and t != Tmax:
    return model.juvenille[i, j, t + 1, k] == model.juvdeath * model.juvenilleTotal[i, j, t]
    else:
    return Constraint.Skip
    model.juv_recruit = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_recruit_rule)

    # Constraint 4: Susceptible recruitment
    def susceptible_advance_rule(model, i, j, t):
    if t == Tmax:
    return Constraint.Skip
    else:
    return model.susceptible[i, j, t + 1] == model.susceptible[i, j, t] - model.inf_b4treat[i, j, t] + model.juvsurv * model.juvenille[i, j, t, Kmax]
    model.susceptible_advance = Constraint(model.Iset, model.Jset, model.Tset, rule=susceptible_advance_rule)

    # Constraint 5(10): Population Growth:
    def infested_growth_rule(model, i, j, t):
    if t == Tmax:
    return Constraint.Skip
    else:
    return model.inf_b4treat[i, j, t + 1] == ( model.inf_treated[i, j, t]**2 / (model.inf_treated[i,j,t]**2 + model.alpha) ) * model.susceptible[i,j,t] + 10
    model.inf_growth = Constraint(model.Iset, model.Jset, model.Tset, rule=infested_growth_rule)

    # Constraint 9: Treated Infestation
    def treatment_rule(model, i, j, t):
    return model.inf_treated[i, j, t] == model.inf_b4treat[i, j, t] * (1 - model.level1[i, j, t] )
    model.treated_pop = Constraint(model.Iset, model.Jset, model.Tset, rule=treatment_rule)

    def budget_rule(model):
    return sum(sum(sum(2*model.level1[i,j,t] for i in model.Iset) for j in model.Jset) for t in model.Tset) <= 3
    model.budget = Constraint(model.Iset, model.Jset, model.Tset, rule=budget_rule)

    ```









    share|improve this question











    $endgroup$
















      3












      3








      3





      $begingroup$


      I am trying to write out a MINLP problem of optimal control for an invasive species and the code that I have for my PYOMO model is below. Some of the initialization values take from an Excel spreadsheet, so they are not made explicit in the formulation below. Additionally, these values aren't real data, but simulated data I have made just to try and get my model running.



      The problem that I am encountering is that my binary variable model.level1, which emphasizes whether or not a cell receives treatment, is always slammed to zero in my objective function which indicates that no control is applied to any cells and this effect cascades throughout the rest of the equations and results in unrealistic results even for fake data.



      Perhaps I am overlooking something in my constraints that are causing the binary variable to be slammed to 0 rather than having a variety of different 0's and 1's throughout the solution?





      model = ConcreteModel()
      Imax = 2
      Jmax = 2
      Tmax = 3
      Kmax = 2
      model.Iset = RangeSet(1, Imax) # e.g. i = 1, 2, 3
      model.Jset = RangeSet(1, Jmax)
      model.Tset = RangeSet(1, Tmax)
      model.Kset = RangeSet(1, Kmax)

      model.juvsurv = Param(initialize=0.60)
      model.juvdeath = Param(initialize=0.40)
      model.lambd = Param(initialize=0.20)
      model.alpha = Param(initialize=2)

      model.juvenille = Var(model.Iset, model.Jset, model.Tset, model.Kset, within=NonNegativeReals, initialize=initial_values_ext(3, Tmax, 2, juvenille_init))
      model.susceptible = Var(model.Iset, model.Jset, model.Tset,within=NonNegativeReals, initialize=initial_values(3, Tmax, susceptible_init))
      model.juvenilleTotal = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
      model.inf_b4treat = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals, initialize=initial_values(3, Tmax, inf_b4treat_init))
      model.inf_treated = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
      model.obj = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)

      def objective_rule(model):
      return sum (sum (sum (model.obj[i,j,t] for i in model.Iset ) for j in model.Jset ) for t in model.Tset )
      model.damages = Objective(rule=objective_rule, sense=minimize)

      def obj_rule(model, i,j,t):
      return model.obj[i,j,t] == 10*model.inf_b4treat[i,j,t] + 5*model.level1[i,j,t]*model.inf_b4treat[i,j,t]
      model.object = Constraint(model.Iset, model.Jset, model.Tset, rule=obj_rule)

      # Constraint 1: juvenilles that advance to the next age class (eq. 1)
      def juv_advance_rule(model, i, j, t, k):
      if t != Tmax and k != Kmax:
      return model.juvenille[i, j, t + 1, k + 1] == model.juvenille[i, j, t, k] * model.juvsurv
      return Constraint.Skip
      model.juv_advance = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_advance_rule)

      # Constraint 2: total number of juvenilles in all age classes on cell (i,j)
      def juv_total_rule(model, i, j, t):
      return model.juvenilleTotal[i, j, t] == sum(model.juvenille[i, j, t, k] for k in model.Kset)
      model.juv_total = Constraint(model.Iset, model.Jset, model.Tset, rule=juv_total_rule)

      # Constraint 3: recruitment of seedlings to the first juvenille age class.
      def juv_recruit_rule(model, i, j, t, k):
      if k == 1 and t != Tmax:
      return model.juvenille[i, j, t + 1, k] == model.juvdeath * model.juvenilleTotal[i, j, t]
      else:
      return Constraint.Skip
      model.juv_recruit = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_recruit_rule)

      # Constraint 4: Susceptible recruitment
      def susceptible_advance_rule(model, i, j, t):
      if t == Tmax:
      return Constraint.Skip
      else:
      return model.susceptible[i, j, t + 1] == model.susceptible[i, j, t] - model.inf_b4treat[i, j, t] + model.juvsurv * model.juvenille[i, j, t, Kmax]
      model.susceptible_advance = Constraint(model.Iset, model.Jset, model.Tset, rule=susceptible_advance_rule)

      # Constraint 5(10): Population Growth:
      def infested_growth_rule(model, i, j, t):
      if t == Tmax:
      return Constraint.Skip
      else:
      return model.inf_b4treat[i, j, t + 1] == ( model.inf_treated[i, j, t]**2 / (model.inf_treated[i,j,t]**2 + model.alpha) ) * model.susceptible[i,j,t] + 10
      model.inf_growth = Constraint(model.Iset, model.Jset, model.Tset, rule=infested_growth_rule)

      # Constraint 9: Treated Infestation
      def treatment_rule(model, i, j, t):
      return model.inf_treated[i, j, t] == model.inf_b4treat[i, j, t] * (1 - model.level1[i, j, t] )
      model.treated_pop = Constraint(model.Iset, model.Jset, model.Tset, rule=treatment_rule)

      def budget_rule(model):
      return sum(sum(sum(2*model.level1[i,j,t] for i in model.Iset) for j in model.Jset) for t in model.Tset) <= 3
      model.budget = Constraint(model.Iset, model.Jset, model.Tset, rule=budget_rule)

      ```









      share|improve this question











      $endgroup$




      I am trying to write out a MINLP problem of optimal control for an invasive species and the code that I have for my PYOMO model is below. Some of the initialization values take from an Excel spreadsheet, so they are not made explicit in the formulation below. Additionally, these values aren't real data, but simulated data I have made just to try and get my model running.



      The problem that I am encountering is that my binary variable model.level1, which emphasizes whether or not a cell receives treatment, is always slammed to zero in my objective function which indicates that no control is applied to any cells and this effect cascades throughout the rest of the equations and results in unrealistic results even for fake data.



      Perhaps I am overlooking something in my constraints that are causing the binary variable to be slammed to 0 rather than having a variety of different 0's and 1's throughout the solution?





      model = ConcreteModel()
      Imax = 2
      Jmax = 2
      Tmax = 3
      Kmax = 2
      model.Iset = RangeSet(1, Imax) # e.g. i = 1, 2, 3
      model.Jset = RangeSet(1, Jmax)
      model.Tset = RangeSet(1, Tmax)
      model.Kset = RangeSet(1, Kmax)

      model.juvsurv = Param(initialize=0.60)
      model.juvdeath = Param(initialize=0.40)
      model.lambd = Param(initialize=0.20)
      model.alpha = Param(initialize=2)

      model.juvenille = Var(model.Iset, model.Jset, model.Tset, model.Kset, within=NonNegativeReals, initialize=initial_values_ext(3, Tmax, 2, juvenille_init))
      model.susceptible = Var(model.Iset, model.Jset, model.Tset,within=NonNegativeReals, initialize=initial_values(3, Tmax, susceptible_init))
      model.juvenilleTotal = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
      model.inf_b4treat = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals, initialize=initial_values(3, Tmax, inf_b4treat_init))
      model.inf_treated = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)
      model.obj = Var(model.Iset, model.Jset, model.Tset, within=NonNegativeReals)

      def objective_rule(model):
      return sum (sum (sum (model.obj[i,j,t] for i in model.Iset ) for j in model.Jset ) for t in model.Tset )
      model.damages = Objective(rule=objective_rule, sense=minimize)

      def obj_rule(model, i,j,t):
      return model.obj[i,j,t] == 10*model.inf_b4treat[i,j,t] + 5*model.level1[i,j,t]*model.inf_b4treat[i,j,t]
      model.object = Constraint(model.Iset, model.Jset, model.Tset, rule=obj_rule)

      # Constraint 1: juvenilles that advance to the next age class (eq. 1)
      def juv_advance_rule(model, i, j, t, k):
      if t != Tmax and k != Kmax:
      return model.juvenille[i, j, t + 1, k + 1] == model.juvenille[i, j, t, k] * model.juvsurv
      return Constraint.Skip
      model.juv_advance = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_advance_rule)

      # Constraint 2: total number of juvenilles in all age classes on cell (i,j)
      def juv_total_rule(model, i, j, t):
      return model.juvenilleTotal[i, j, t] == sum(model.juvenille[i, j, t, k] for k in model.Kset)
      model.juv_total = Constraint(model.Iset, model.Jset, model.Tset, rule=juv_total_rule)

      # Constraint 3: recruitment of seedlings to the first juvenille age class.
      def juv_recruit_rule(model, i, j, t, k):
      if k == 1 and t != Tmax:
      return model.juvenille[i, j, t + 1, k] == model.juvdeath * model.juvenilleTotal[i, j, t]
      else:
      return Constraint.Skip
      model.juv_recruit = Constraint(model.Iset, model.Jset, model.Tset, model.Kset, rule=juv_recruit_rule)

      # Constraint 4: Susceptible recruitment
      def susceptible_advance_rule(model, i, j, t):
      if t == Tmax:
      return Constraint.Skip
      else:
      return model.susceptible[i, j, t + 1] == model.susceptible[i, j, t] - model.inf_b4treat[i, j, t] + model.juvsurv * model.juvenille[i, j, t, Kmax]
      model.susceptible_advance = Constraint(model.Iset, model.Jset, model.Tset, rule=susceptible_advance_rule)

      # Constraint 5(10): Population Growth:
      def infested_growth_rule(model, i, j, t):
      if t == Tmax:
      return Constraint.Skip
      else:
      return model.inf_b4treat[i, j, t + 1] == ( model.inf_treated[i, j, t]**2 / (model.inf_treated[i,j,t]**2 + model.alpha) ) * model.susceptible[i,j,t] + 10
      model.inf_growth = Constraint(model.Iset, model.Jset, model.Tset, rule=infested_growth_rule)

      # Constraint 9: Treated Infestation
      def treatment_rule(model, i, j, t):
      return model.inf_treated[i, j, t] == model.inf_b4treat[i, j, t] * (1 - model.level1[i, j, t] )
      model.treated_pop = Constraint(model.Iset, model.Jset, model.Tset, rule=treatment_rule)

      def budget_rule(model):
      return sum(sum(sum(2*model.level1[i,j,t] for i in model.Iset) for j in model.Jset) for t in model.Tset) <= 3
      model.budget = Constraint(model.Iset, model.Jset, model.Tset, rule=budget_rule)

      ```






      pyomo minlp optimal-control






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 7 hours ago









      E. Tucker

      9622 silver badges18 bronze badges




      9622 silver badges18 bronze badges










      asked 8 hours ago









      D.GrayD.Gray

      4247 bronze badges




      4247 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          3














          $begingroup$

          You can try adding a constraint forcing one of the affected variable to be nonzero. If the model becomes infeasible, you can try to find the conflicting constraints. If the model stays feasible, this means that your objective function represents other priorities than you expected.






          share|improve this answer









          $endgroup$






















            2














            $begingroup$

            I only skimmed your model so others may be better able to point to the error directly, but here are some reasons this may occur:



            • Constraints: as you mention, perhaps they're set so that it's not possible to apply the treatment. E.g, is the budget accidentally set too tightly so it can't afford it? (There are several sums in your budget_rule - I'd double check that constraint)

            • Objective function: perhaps it hurts the OF value when treatment is applied. E.g., does the cost of treatment outweigh the benefit? Also I'm not sure why model.inf_b4treat is included in both the not treated and treated terms (could be fine). Also, always good to double-check whether you mean to minimize vs. maximize.

            • Inputs: is the problem initialized so that no one needs treatment?

            Other ideas to debug:



            • Test the model with the an extreme inputs and/or adjusted/removed constraints. E.g., no budget limit, no treatment cost

            • If still not clear, iteratively remove constraints and resolve. See what the limiting one may be.

            Best wishes!






            share|improve this answer









            $endgroup$














            • $begingroup$
              Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
              $endgroup$
              – D.Gray
              6 hours ago













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "700"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2for.stackexchange.com%2fquestions%2f2525%2finteger-decision-variables-always-forced-to-zero-in-minimization-problem-minlp%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            $begingroup$

            You can try adding a constraint forcing one of the affected variable to be nonzero. If the model becomes infeasible, you can try to find the conflicting constraints. If the model stays feasible, this means that your objective function represents other priorities than you expected.






            share|improve this answer









            $endgroup$



















              3














              $begingroup$

              You can try adding a constraint forcing one of the affected variable to be nonzero. If the model becomes infeasible, you can try to find the conflicting constraints. If the model stays feasible, this means that your objective function represents other priorities than you expected.






              share|improve this answer









              $endgroup$

















                3














                3










                3







                $begingroup$

                You can try adding a constraint forcing one of the affected variable to be nonzero. If the model becomes infeasible, you can try to find the conflicting constraints. If the model stays feasible, this means that your objective function represents other priorities than you expected.






                share|improve this answer









                $endgroup$



                You can try adding a constraint forcing one of the affected variable to be nonzero. If the model becomes infeasible, you can try to find the conflicting constraints. If the model stays feasible, this means that your objective function represents other priorities than you expected.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 4 hours ago









                SimonSimon

                8173 silver badges14 bronze badges




                8173 silver badges14 bronze badges
























                    2














                    $begingroup$

                    I only skimmed your model so others may be better able to point to the error directly, but here are some reasons this may occur:



                    • Constraints: as you mention, perhaps they're set so that it's not possible to apply the treatment. E.g, is the budget accidentally set too tightly so it can't afford it? (There are several sums in your budget_rule - I'd double check that constraint)

                    • Objective function: perhaps it hurts the OF value when treatment is applied. E.g., does the cost of treatment outweigh the benefit? Also I'm not sure why model.inf_b4treat is included in both the not treated and treated terms (could be fine). Also, always good to double-check whether you mean to minimize vs. maximize.

                    • Inputs: is the problem initialized so that no one needs treatment?

                    Other ideas to debug:



                    • Test the model with the an extreme inputs and/or adjusted/removed constraints. E.g., no budget limit, no treatment cost

                    • If still not clear, iteratively remove constraints and resolve. See what the limiting one may be.

                    Best wishes!






                    share|improve this answer









                    $endgroup$














                    • $begingroup$
                      Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                      $endgroup$
                      – D.Gray
                      6 hours ago















                    2














                    $begingroup$

                    I only skimmed your model so others may be better able to point to the error directly, but here are some reasons this may occur:



                    • Constraints: as you mention, perhaps they're set so that it's not possible to apply the treatment. E.g, is the budget accidentally set too tightly so it can't afford it? (There are several sums in your budget_rule - I'd double check that constraint)

                    • Objective function: perhaps it hurts the OF value when treatment is applied. E.g., does the cost of treatment outweigh the benefit? Also I'm not sure why model.inf_b4treat is included in both the not treated and treated terms (could be fine). Also, always good to double-check whether you mean to minimize vs. maximize.

                    • Inputs: is the problem initialized so that no one needs treatment?

                    Other ideas to debug:



                    • Test the model with the an extreme inputs and/or adjusted/removed constraints. E.g., no budget limit, no treatment cost

                    • If still not clear, iteratively remove constraints and resolve. See what the limiting one may be.

                    Best wishes!






                    share|improve this answer









                    $endgroup$














                    • $begingroup$
                      Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                      $endgroup$
                      – D.Gray
                      6 hours ago













                    2














                    2










                    2







                    $begingroup$

                    I only skimmed your model so others may be better able to point to the error directly, but here are some reasons this may occur:



                    • Constraints: as you mention, perhaps they're set so that it's not possible to apply the treatment. E.g, is the budget accidentally set too tightly so it can't afford it? (There are several sums in your budget_rule - I'd double check that constraint)

                    • Objective function: perhaps it hurts the OF value when treatment is applied. E.g., does the cost of treatment outweigh the benefit? Also I'm not sure why model.inf_b4treat is included in both the not treated and treated terms (could be fine). Also, always good to double-check whether you mean to minimize vs. maximize.

                    • Inputs: is the problem initialized so that no one needs treatment?

                    Other ideas to debug:



                    • Test the model with the an extreme inputs and/or adjusted/removed constraints. E.g., no budget limit, no treatment cost

                    • If still not clear, iteratively remove constraints and resolve. See what the limiting one may be.

                    Best wishes!






                    share|improve this answer









                    $endgroup$



                    I only skimmed your model so others may be better able to point to the error directly, but here are some reasons this may occur:



                    • Constraints: as you mention, perhaps they're set so that it's not possible to apply the treatment. E.g, is the budget accidentally set too tightly so it can't afford it? (There are several sums in your budget_rule - I'd double check that constraint)

                    • Objective function: perhaps it hurts the OF value when treatment is applied. E.g., does the cost of treatment outweigh the benefit? Also I'm not sure why model.inf_b4treat is included in both the not treated and treated terms (could be fine). Also, always good to double-check whether you mean to minimize vs. maximize.

                    • Inputs: is the problem initialized so that no one needs treatment?

                    Other ideas to debug:



                    • Test the model with the an extreme inputs and/or adjusted/removed constraints. E.g., no budget limit, no treatment cost

                    • If still not clear, iteratively remove constraints and resolve. See what the limiting one may be.

                    Best wishes!







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 7 hours ago









                    E. TuckerE. Tucker

                    9622 silver badges18 bronze badges




                    9622 silver badges18 bronze badges














                    • $begingroup$
                      Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                      $endgroup$
                      – D.Gray
                      6 hours ago
















                    • $begingroup$
                      Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                      $endgroup$
                      – D.Gray
                      6 hours ago















                    $begingroup$
                    Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                    $endgroup$
                    – D.Gray
                    6 hours ago




                    $begingroup$
                    Initially yes I set the problem up so that model.level1 is 0. My thought process here was that running the model would provide the optimal values for that variable. It seemed strange to me that some areas would have the model.level1 variable be 1 while others would be 0 for no particular reason. I will give these debugging methods a go and see what I can figure out.
                    $endgroup$
                    – D.Gray
                    6 hours ago


















                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Operations Research Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2for.stackexchange.com%2fquestions%2f2525%2finteger-decision-variables-always-forced-to-zero-in-minimization-problem-minlp%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480