Mi1=7500 #g/mol , Molecular wt
Mi2=12500
Mi3=17500
Mi4=22500
Mi5=27500
Mi6=32500
Mi7=37500
xi1=0.05 #Number fraction
xi2=0.16
xi3=0.22
xi4=0.27
xi5=0.2
xi6=0.08
xi7=0.02
xM1=Mi1*xi1
xM2=Mi2*xi2
xM3=Mi3*xi3
xM4=Mi4*xi4
xM5=Mi5*xi5
xM6=Mi6*xi6
xM7=Mi7*xi7
xM=xM1+xM2+xM3+xM4+xM5+xM6+xM7
nC=2 #no of carbon atoms in repeat unit
nH=3 #no of hydrogen atoms in repeat unit
nCl=1 #no of chlorine atoms in repeat unit
MwC=12.01 #Molecular wt of carbon
MwH=1.01 #Molecular wt of Hydogen
MwCl=35.45 #Molecular wt of chlorine
m=nC*MwC+nH*MwH+nCl*MwCl #Total wt for PVC
DP=xM/m
wi1=0.02 #weight fraction
wi2=0.1
wi3=0.18
wi4=0.29
wi5=0.26
wi6=0.13
wi7=0.02
wM1=Mi1*wi1
wM2=Mi2*wi2
wM3=Mi3*wi3
wM4=Mi4*wi4
wM5=Mi5*wi5
wM6=Mi6*wi6
wM7=Mi7*wi7
wM=wM1+wM2+wM3+wM4+wM5+wM6+wM7
print"(a)The no Av Molecular wt is",xM,"g/mol"
print"(b)Degree of Polymerisation is",round(DP,0)
print"(c)The weight Av Molecular wt is",wM,"g/mol"
Ac=12.01 #in g/mol Molecular weight of Carbon
Ah=1.008 #in g/mol molecular weight of hydrogen
a=7.41*10**-8 #in cm
b=4.94*10**-8 #in cm
c=2.55*10**-8 #in cm
Na=6.023*10**23
Vc=a*b*c
n=2
A=(2*Ac)+(4*Ah)
density_c=n*A/(Vc*Na)
density_a=0.870 # in g/cm**3
density_s=0.925 # in g/cm**3
pc=density_c*(density_s-density_a)*100/(density_s*(density_c-density_a))
print"(a)Density is",round(density_c,3),"g/cm**3"
print"(b)percentage crystallinity is",round(pc,1),"%"
P1=400000.0 # in Pa Pressure inside the bottle
P2=400.0 # in Pa Pressure outside the bottle
Pm=0.23*10**-13 #Solubility Coefficient
dx=0.05 # in cm Thickness of wall
J=(-Pm*(P2-P1)/dx)
A=500 #surface area of bottle in cm**2
V_lose=750.0 #cm**3 STP
V=J*A
t=V_lose/round(V,5)
print"Diffusion flux is ",round(J,9),"cm**3 STP/cm**2-s"
print"Time to escape is ",round(t/(3600*24),1),"days"