title: How to input another variable into scipy optimize function
body: <p>Please ignore the messiness, still a noob at this.
  Basically, I have a function:</p>
  <pre><code>def bw(Q,T):
    F = -Tc * Q**2 + T*((1+Q)*np.log(1+Q) + (1-Q)*np.log(1-Q))
    return F
  </code></pre>
  <p>And I need to find the minimum of this at various T's</p>
  <pre><code>Tc = 1
  n = 200
  T1 = 0.5
  T2 = 1.2
  Tt = np.linspace(T1,T2,n)
  Qe = np.ndarray((1,n))
  Q0 = 0.9
  
  for i in range(n):
    T = Tt[i]
    res = minimize(bw,Q0,method='nelder-mead', options={'xatol': 1e-8})
  </code></pre>
  <p>With this, it says it's missing a positional argument T, but then:</p>
  <pre><code>res = minimize(bw(T),Q0,method='nelder-mead', options={'xatol': 1e-8})
  res = minimize(bw(Q,T),Q0,method='nelder-mead', options={'xatol': 1e-8})
  res = minimize(bw(,T),Q0,method='nelder-mead', options={'xatol': 1e-8})
  </code></pre>
  <p>I tried these and they don't work. Then, I tried:</p>
  <pre><code>res = minimize(bw,T,Q0,method='nelder-mead', options={'xatol': 1e-8})
  </code></pre>
  <p>The values I get are wrong. Can anyone help?</p>