title: optimizing a non linear function of two variables (python)
body: <p>I have an objective function: </p>
  
  <pre><code>def calculate_output(social_sum, learning_sum, w_1, w_2):
  
      economy_output = sum(social_sum) * sum(learning_sum) - w_1 * sum(learning_sum) - w_2 *sum(social_sum)
  
      return economy_output
  </code></pre>
  
  <p>and two constraints, that I need to meet, not optimise, but just meet.</p>
  
  <p>these two constraints are: </p>
  
  <pre><code>def calculate_fz_1(w_1, w_2):
  
      social_sum, learning_sum = calculate_decisions(w_1, w_2, gamma_physical_social, gamma_physical_learning,
                                                         gamma_online_learning, gamma_online_social, Cost_Online,
                                                         Cost_Physical, bivariate_distribution, types_of_agents)
  
      total_social = sum(social_sum)
      total_learning = sum(learning_sum)
  
      marginal_product_z1 = sum(social_sum) - w_1
  
      return marginal_product_z1
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>def calculate_fz_2(w_1, w_2):
  
      social_sum, learning_sum = calculate_decisions(w_1, w_2, gamma_physical_social, gamma_physical_learning,
                                                     gamma_online_learning, gamma_online_social, Cost_Online,
                                                     Cost_Physical, bivariate_distribution, types_of_agents)
  
  
      marginal_product_z2 = sum(learning_sum) - w_2
  
      return marginal_product_z2
  </code></pre>
  
  <p>and these constraints must equal to zero. </p>
  
  <p>problem for me is that the two variables used to calculate the marginal product are non linear and discrete in nature (the variables social sum and learning sum are actually determined by several variables that are discrete), so I was thinking that I would not be able to use scipy.optimise</p>
  
  <p>but I heard on stack that this may be possible to do so with scipy, is this true? would appreciate this!</p>