title: Linear optimization with PuLP, additional condition on variables
body: <p>I have to solve an integer linear optimization problem in Python with pulp. 
  I solved the basic problem and now I have to add additional constraints.
  Is anybody who can help me with adding the condition with a logical indicator?
  The logical restriction is: B>5 if A>20</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from pulp import *
  
  prob = LpProblem("The Optimization Problem", LpMaximize)
  A = LpVariable("A", 0, 100)
  B = LpVariable("B", 0, 200)
  C = LpVariable("C", 0, 100)
  R1 = LpVariable("R1", 0)
  R2 = LpVariable("R2", 0)
  
  R1 = 0.1 * A + 0.2 * B + 0.075 * C
  R2 = 0.05 * A + 0.1 * B + 0.05 * C
  
  prob += 2 * A + 3 * B + 2.55 * C - 0.6 * R1 - 0.8 * R2
  prob += 0.5 * A + 0.8 * B + C &lt;= 100, "T1"
  prob += 0.8 * A + 0.6 * B + 0.2 * C &lt;= 100, "T2"
  
  
  prob.writeLP("OptimizationModel.lp")
  
  prob.solve()
  print("Status:", LpStatus[prob.status])
  for v in prob.variables():
      print(v.name, "=", v.varValue)
  </code></pre>