# Boltzmann distribution for x-velocity # # first, define variables: # mass of CO2: 44 Da; 44 g/mol or .044 kg/mol m = 44.0/1000 # Boltzman const in J/K [ J = kg m^2 s^-2 ] k = 1.38e-23 # Avogadro's no.; molecules/mol N = 6.023e+23 # now, define the function: # we'll use a(x) for T=77 K (boiling T of liquid N2) a(x) = ((m/(2*pi*77*k*N))**0.5)*exp((-m*x**2)/(2*77*k*N)) # we'll use b(x) for T=273 K (freezing point of water) b(x) = ((m/(2*pi*273*k*N))**0.5)*exp((-m*x**2)/(2*273*k*N)) # we'll use c(x) for T=373 K (boiling point of water) c(x) = ((m/(2*pi*373*k*N))**0.5)*exp((-m*x**2)/(2*373*k*N)) # now plot them: set samples 1000 set title "Boltzmann probability distribution for x-velocities of CO2 molecules" set ylabel "Probability (s/m)" set xlabel "x-velocity (m/s)" plot [-1000:1000] a(x), b(x), c(x) #set term post lw 2 "Courier" 18; set output "file.ps" #plot [-1000:1000] a(x), b(x), c(x)