- #1

- 4

- 0

I have a random number generator in FORTRAN, which gives a random numbers to my particles initial velocity in three dimension (vx,vy,vz). If, I want to make my particles to embark to move with a specific weight (eg. Maxwellian), what should I do?

absv = sqrt(vx*vx+vy*vy+vz*vz)

wt= absv*absv*exp(-(absv*absv)/(a*a))

(a = sqrt(2*k*t/m))

if you simply plot any random numbers based on 'wt' you will get the maxwellian speed distribution as an output. I want to know, how can I make the 'wt' to be effective as a probability of particles initial distribution.

any suggestion is appreciated