#calculate the final volume of the gas
#initialisation of variables
V= 22.394 #l
m= 32 #gm
T= 0 #C
T1= 50. #C
p= .8 #atm
#CALCULATIONS
V1= (T1+273.16)*V/(T+273.16)
V2= (1./p)*V1
#RESULTS
print '%s %.3f %s' % (' Volume = ',V2,'lt')
#calculate gthe argon temperature
#initialisation of variables
P= 1 #atm
T= 0 #C
#CALCULATIONS
T1= 10*(T+273.2)
#RESULTS
print '%s %.1f %s' %(' Argon temperature =',T1,' K')
#calculate the Atomic Weight
#initialisation of variables
x= 0.0820544
T= 0 #C
l= 1.7826 #gl^-1atm^-1
#CALCULATIONS
M= x*(273.16+T)*l
#RESULTS
print '%s %.3f %s' % (' Atomic Weight =',M,'gm mole^-1')
#calculate the Molecular weight and molecular formula
#initialisation of variables
g=.270 #g
R=0.08205
T=296.4 #K
P=754.6/760.0 #atm
V=0.03576 #lt
m1= 12
m2= 19
m3= 35.46
yx=.57
#CALCULATIONS
M1=g*R*T/(P*V)
y=round(yx*M1/m3)
n=round((M1-m3*y+m2)/(2*m2+m1))
x=2*n-1
M= n*m1+x*m2+y*m3
#RESULTS
print '%s %.2f %s' %('Approximate molecular weight = ',M1,"gms")
print '%s %.2f %s' % (' Molecular weight =',M,' gms')
print '%s %d %s %d %s %d' %('Molecular formula is C',n,'F',x,'Cl',y)
#calculate the pressure in both cases
#initialisation of variables
n= 10 #moles
R= 0.08205 #atml/molK
T= 300 #K
V= 4.86 #l
b= 0.0643 #ml mol**-1
a= 5.44 #l**2
#CALCULATIONS
P= n*R*T/V
P1= (n*R*T/(V-n*b))-(a*n**2/V**2)
#RESULTS
print '%s %.1f %s' % (' Pressure in case of perfect gas law=',P,' atm')
print '%s %.1f %s' % (' \n Pressure in case of vanderwaals equation =',P1,' atm')
#calculate the pressure of the gas
#initialisation of variables
n= 10 #moles
T= 300 #K
V= 4.86 #l
R= 0.08205 #atml/molK
v= 0.1417 #l
T1= 305.7 #K
#CALCULATIONS
b= v/2
a= 2*v*R*T1
P= ((n*R*T)/(V-n*b))*2.71**(-a*n/(V*R*T))
#RESULTS
print '%s %.1f %s' % (' Pressure =',P,' atm')
#calculate the root mean square velocity
#initialisation of variables
import math
from math import sqrt
T= 0 #C
T1= 100 #C
R= 8.314 #atm lit/mol K
n= 3
M= 2.016 #gm
M1= 28.02 #gm
M2= 146.1 #gm
#CALCULATIONS
u= sqrt(n*R*10**7*(T+273.2)/M)
u1= sqrt(n*R*10**7*(T+273.2)/M1)
u2= sqrt(n*R*10**7*(T+273.2)/M2)
u3= sqrt(n*R*10**7*(T1+273.2)/M)
u4= sqrt(n*R*10**7*(T1+273.2)/M1)
u5= sqrt(n*R*10**7*(T1+273.2)/M2)
#RESULTS
print '%s %.2f %s' % (' root mean square velocity of H2 at 0 C =',u*10**-4,' cm/sec')
print '%s %.3f %s' % (' \n root mean square velocity of N2 at 0 C=',u1*10**-4,' cm/sec')
print '%s %.3f %s' % (' \n root mean square velocity of SF6 at 0 C =',u2*10**-4,'cm/sec')
print '%s %.2f %s' % (' \n root mean square velocity of H2 at 100 C =',u3*10**-4,' cm/sec')
print '%s %.3f %s' % (' \n root mean square velocity of N2 at 100 C =',u4*10**-4,' cm/sec')
print '%s %.3f %s' % (' \n root mean square velocity of SF6 at 100 C =',u5*10**-4,' cm/sec')
#Calculate the no. of collisions in He and N2
#Initialisation of variables
import math
from math import sqrt
P= 1 #at,
T= 300 #K
R= 82.05 #atm l/mol K
R1= 8.314
s= 4*10**-8 #cm
s1= 2*10**-8 #cm
m= 4 #gm
m1= 28 #gm
#CALCULATIONS
N= P*6.02*10**23/(R*T)
n= 2*s1**2*N**2*sqrt(math.pi*R1*10**7*T/m)
n1= 2*s**2*N**2*sqrt(math.pi*R1*10**7*T/m1)
#RESULTS
print '%s %.e %s' % (' no of collisions =',n,'collisions sec^-1 mol^-1')
print '%s %.2e %s' % (' \n no of collisions =',n1,' collisions sec^-1 mol^-1')
#calculate the viscosity of N2
#initialisation of variables
import math
from math import sqrt
M= 28 #gm
R= 8.314*10**7 #atm l/mol K
N= 6.023*10**23
T= 300 #K
s= 4*10**-8#cm
#CALCULATIONS
m= M/N
k= R/N
n= (5./16.)*sqrt(math.pi*m*k*T)/(math.pi*s**2)
#RESULTS
print '%s %.2e %s' % (' viscosity =',n,'poise')
#calculate the Increase in energy per degree for 1 mole of gas
#initialisation of variables
n= 3
R= 2 #cal mol^-1 deg^-1
#CALCULATIONS
I= n*R
#RESULTS
print '%s %.1f %s' %(' Increase in energy =',I,'cal mol^-1 deg^-1')
#calculate the Dipole moment and percentage of ionic character
#initialisation of variables
import math
k= 1.38*10**-16
N= 6*10**23 #molecules
a= 105 #degrees
l= 0.957 #A
e= 4.8*10**-10 #ev
#CALCULATIONS
u= math.sqrt(9*k*2.08*10**4/(4*math.pi*N))
uh= u/(2*math.cos(a*math.pi/180/2.))
z= uh/(l*e*10**-8)
#RESULTS
print '%s %.2e %s' % (' Dipole moment of H2O=',u,'e.s.u.cm')
print '%s %.2e %s' % (' \n Dipole moment of OH bond =',uh,'e.s.u.cm')
print '%s %.2f' % (' \n fraction of ionic character =',z)
#calculate the dielectric constant
#initialisation of variables
import math
u= 1.44*10**-18 #e.s.u
k= 3.8*10**-16
T= 273. #k
N= 6.023*10**23 #molecules
v= 6. #cc
Vm= 44.8*10**3 #cc
#CALCULATIONS
Pm= v+(4*math.pi*N*u**2/(3*3*k*T))
r= Pm/Vm
k= (2*r+1)/(1-r)
#RESULTS
print '%s %.5f' % (' dielectric constant =',k)
print 'The answer is a bit different due to rounding off error in textbook'