title: Linear programming. How can I add a constraint that is not constant value ? (like the allocation for each ad <= budgets, both two sides can change)
body: <p>I am building an optimal model using linear programming like below:</p>
  <pre><code>m = gp.Model(&quot;allocation_budget&quot;)
  
  #keywords are given tuple about keyword in ad.{UK retail, free shipping UK etc.}
  allocation = m.addVars(keywords, lb = 0, name=&quot;allocation&quot;)
  # budgets = np.arange(0,1100000,100000)
  budget = m.addVars(budgets, lb = 0, name=&quot;budget&quot;)
  
  #the right side of equation is wrong, it's where I am confused about
  budget_constraint = m.addConstr(allocation.sum() &lt;= budget,&quot;budget_constraint&quot;)
  
  #the objective is to maximize the net revenue which is equal to 4/CPC[k]*allocation[k] - budget, but I don't know to fit the variable &quot;budget&quot; into this equation
  m.setObjective(quicksum(4/CPC[k]*allocation[k] - budget), GRB.MAXIMIZE)
  
  #the following code contain error as well due to the previous problem
  def printSolution():
      if m.status == GRB.OPTIMAL:
          print('\nClicks: %g' % m.objVal)
          print('\nAllocation:')
          allocationx = m.getAttr('x', allocation)
          for k in keywords:            
                  print('%s %g' % (k, allocationx[k]))
          print(&quot;\nBudget: &quot;,budget.x)
      else:
          print('No solution:', m.status)
  m.optimize()
  printSolution()
  </code></pre>
  <p>The objective is to find the right budget values so that the net revenue can be maximized.</p>
  <p>Any help will be great! Please help</p>