Home

Staff
     
Consulting
               
Mathematica Tools

Customer Quotes
        
Contact

Older Mathematica Items

 

 

 

 

 

Scientific Arts

Maxwellian Probability Distribution Function

Page 1 | Page 2 | Page 3 | Page 4


The Distribution Function and its Cumulative

The Maxwellian probability distribution function (PDF) is proportional to [Graphics:Images/maxwellpdf_gr_8.gif] where [Graphics:Images/maxwellpdf_gr_9.gif] is the molecular speed and [Graphics:Images/maxwellpdf_gr_10.gif] is a parameter that depends on the temperature and molecular mass. The normalization factor is given by

[Graphics:Images/maxwellpdf_gr_11.gif]
[Graphics:Images/maxwellpdf_gr_12.gif]

So a straightforward definition of the Maxwellian PDF is

[Graphics:Images/maxwellpdf_gr_13.gif]

We have defined MaxwellPDF so that, if it is called with just one argument, a default value of 1 is used for [Graphics:Images/maxwellpdf_gr_14.gif]. It is sufficient to consider just [Graphics:Images/maxwellpdf_gr_15.gif] since

[Graphics:Images/maxwellpdf_gr_16.gif]
[Graphics:Images/maxwellpdf_gr_17.gif]

For molecular dynamics [Graphics:Images/maxwellpdf_gr_18.gif] has the value [Graphics:Images/maxwellpdf_gr_19.gif] where [Graphics:Images/maxwellpdf_gr_20.gif] is the mass of the molecular species, [Graphics:Images/maxwellpdf_gr_21.gif] is the Boltzmann constant, and [Graphics:Images/maxwellpdf_gr_22.gif] is the temperature (in Kelvin). This corresponds to,

[Graphics:Images/maxwellpdf_gr_23.gif]
[Graphics:Images/maxwellpdf_gr_24.gif]

To calculate random numbers with a probability distribution that conforms to the Maxwellian PDF, we need to compute the cumulative distribution function and invert it.

Here is the cumulative distribution function.

[Graphics:Images/maxwellpdf_gr_25.gif]
[Graphics:Images/maxwellpdf_gr_26.gif]

So we can define the cumulative Maxwellian distribution function via

[Graphics:Images/maxwellpdf_gr_27.gif]

Similar to the case with MaxwellPDF, we have

[Graphics:Images/maxwellpdf_gr_28.gif]
[Graphics:Images/maxwellpdf_gr_29.gif]

So we will just work with [Graphics:Images/maxwellpdf_gr_30.gif] to generate random numbers. The result can always be rescaled by [Graphics:Images/maxwellpdf_gr_31.gif].

Random Numbers

To generate random numbers according to a given probability distribution function, one can use the inverse of the cumulative distribution function acting on random numbers generated from a uniform distribution. In the case of MaxwellCDF there is no closed form inverse.

[Graphics:Images/maxwellpdf_gr_32.gif]
[Graphics:Images/maxwellpdf_gr_33.gif]

However, we can build a numerical function that provides us with an inverse. There are many ways to do this. We describe several possibilities in the pages that follow.

Interpolation Function Method

Inverse Series Method

Inverse Series Method with Padé Approximants


[Parts of this example are based on an example given in The Mathematica Journal.]


For further information on our services send email to info@scientificarts.com .
Contents of this web site Copyright © 1999-2011, Scientific Arts, LLC.

s