# Variables
import math
N0 = 6.025*10**26
M = 32.
k = 1.38*10**-23
T = 300. #K
# Calculations
m = M/N0
vavg = math.sqrt(8*k*T/(math.pi*m))
vrms = math.sqrt(3*k*T/m)
vm = math.sqrt(2*k*T/m)
# Results
print "Average velocity = %d m/sec"%(vavg)
print " RMS velocity = %d m/sec"%(vrms)
print " Most probable velocity = %.f m/sec"%(vm)
# Variables
import math
T = 300. #K
dv = 0.02
vm = 395. #m/s
m = 5.32*10**-26 #kg
k = 1.38*10**-23
vrms = 483. #m/s
# Calculations
N1 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vm**2 *math.exp(-1) *dv*vm
N2 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vrms**2 *math.exp(-3/2) *dv*vrms
# Results
print "Fraction of oxygen molecules at v most probable speed = %.4f "%(N1)
print " Fraction of oxygen molecules at v rms speed = %.4f "%(N2)
# rounding off error
# Variables
p = 1.013*10**5 #N/m**2
k = 1.38*10**-23
T = 300. #K
v = 445. #m/s
A = 0.001*10**-6 #m**2
# Calculations
n = p/(k*T)
J = n*v/4
escaping = J*A
# Results
print "No. of molecules escaping per unit time = %.2e mol/sec"%(escaping)
# Variables
import math
d = 3.5*10**-10 #m
n = 2.45*10**25
# Calculations
sig = math.pi*d**2
lambda_ = 1./(math.sqrt(2) *sig*n)
frac = math.exp(-2)
# Results
print "Mean free path = %.2e m"%(lambda_)
print " fraction of molecules = %.3f"%(frac)
# Variables
P = 1. #atm
T = 300. #K
# Calculations
cv = 4.97
vavg = 1580. #ft/s
sig = 4.13*10**-18 #ft**2
N0 = 6.025*10**26 *0.4536
K = vavg*3600.*cv/(3*N0*sig)
# Results
print "Thermal conductivity = %.2e B/hr ft F"%(K)
# Variables
m = 5.32*10**-26 #kg
v = 445. #m/s
sigma = 3.84*10**-19 #m**2
# Calculations
mu = m*v/(3*sigma)
# Results
print "Dynamic viscosity of oxygen = %.2e newton sec/m**2"%(mu)