We will now study what the velocity of the gas molecules is as a function of the temperature. First we introduce the average squared velocity, <v2>. This is obtained by taking the square of the velocities of each molecule in the gas and averaging (indicated by the angular brackets). One can show that in this case <v2> = <v>2.
The relationship between pressure, volume, and average velocity square is:
Here N is the number of molecules in the volume V, and m is the mass of one of them. Combining this result with the ideal gas law gives:
In the simulation, a hot gas (represented by red balls) is mixed with a cold gas (represented by the blue balls). As time passes, the gases interact with each other and reach equilibrium.