title: Python Least Squares for multiple variables
body: <p>I have a optimization problem that I need to solve in python. The general structure is</p>
  
  <pre><code>def foo(a, b, c, d, e):
      # do something and return one value
  
  
  def bar(a, b, c, d, e, f, g, h, i, j):
      # do something and return one value
  
  
  def func():
      return foo(a, b, c, d, e) - bar(a, b, c, d, e, f, g, h, i, j)
  </code></pre>
  
  <p>I would like to use <code>least_squares</code> minimization and return the values for <code>f, g, h, i and j</code> as a list where the square difference is the minimum between <code>foo</code> and <code>bar</code>. I'm not sure how to use <code>least_squares</code> for this. </p>
  
  <p>I've tried this:</p>
  
  <pre><code># Initial values f, g, h, i, j
  x0 =[0.5,0.5,0.5,0.05,0.5]
  
  # Constraints
  lb = [0,0,0,0,-0.9]
  ub = [1, 100, 1, 0.5, 0.9]
  
  x = least_squares(func, x0, lb, ub)
  </code></pre>
  
  <p>How do I get <code>x</code> to be the returned value of the list of <code>f, g, h, i and j</code> minimum values? </p>