4

I have speed data of many particles to which I want to fit the Maxwellian curve. I am trying to use the fit method from scipy.stats.maxwell to fit to my data and extract the temperature of the system from that.

From the documentation, I am unable to put my finger on what the parameters that we are trying to fit exactly are and hence how they relate to temperature.

Babaji
  • 398
  • 1
  • 4
  • 18

1 Answers1

1

It's related to scale. You also likely want to set floc=0 in maxwell.fit(...)

Cf the argument of the exponential: with non-zero scale it's -x**2 / scale**2 / 2, which you compare to the expected mv**2 / 2kT.

ev-br
  • 24,968
  • 9
  • 65
  • 78
  • I think you mean `-x**2/(2*scale**2)` (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.maxwell.html#scipy.stats.maxwell). In which case, T = (m/k)*scale**2. – Babaji Nov 29 '21 at 08:24
  • I've edited the answer. Note that the factor of two is not squared. – ev-br Nov 29 '21 at 08:58