title: fitting data to a custom model in python
body: <p>Hi So I am fairly used to python but this is the first time I am using python for data analysis and I was wondering if you could shed some light on an issue I am having. </p>
  
  <p>I need to fit about 4000 different plots to the following function :
  <code>b+e*A*(1.19104*(10**-16))*((x*(10**-9))**-5)*((-1+np.exp(0.0143878/(T*x*(10**-9))))**-1)</code>
  in this function I want to restrict b, e and A to certain values for each plot and the value of the variable T to shift according to the data.</p>
  
  <p>I tried using scipy optimize but I couldn't figure out how to hold parameters with that one.</p>
  
  <p>I tried using pyAstronomy funcfit but for one it is extremely inefficient (or maybe my code is idk) and I wasn't getting data that looked what I had approximated the data should look like.</p>
  
  <p>Finally I am currently trying to use lmfit but my code here seems to have all of the parameters stay the same as the guess and not vary at all. I am confused on how to proceed.
  my current code looks like this...</p>
  
  <pre><code>def bbnm(x,b,e,T,A):
     y = b+e*A*(1.19104*(10**-16))*((x*(10**-9))**-5)*((-1+np.exp(0.0143878/(T*x*(10**-9))))**-1)
     return y     
  
  params = bbmodel.make_params(b=0,e=.99,T=5100,A=wgeometry)
  params['b'].vary = False
  params['e'].vary = False
  params['A'].vary = False
  params['T'].vary = True
  bb = bbmodel.fit(power[1465:2510],params,x=wavelength[1465:2510])
  </code></pre>