Original Post
Hello, I want to write a simulation of the ideal gas law but I'm having some trouble with the math. I have a few particles/molecules and I want to assign to each of them velocities using the maxwell distribution (the equation is given in the "Distribution of Speeds" section of the article). However, since this is just a probability function I'm not sure how I can create a function that will fit the velocities according to the distribution. Of course a program like this has been done before but I'm just doing this for fun and learning purposes. Here is a link to what I want to achieve: link. Any help is greatly appreciated.
