#calculate the no of degrees of freedom
#Initialization of variables
p=3
c=2
#calculations
f=2-p+c
#results
print '%s %d' %("no. of degrees of freedom =",f)
#calculate the change in temperature
#Initialization of variables
T=273.2 #K
vw=1.0001 #cm^3 /g
vi=1.0907 #cm^3 /g
hf=79.7 #cal/g
P1=76 #cm
P2=4.6 #cm
#calculations
dT=T*(vw-vi)*(P2-P1)*13.6*980.7/(hf*4.184*10**7)
#results
print '%s %.4f %s' %("change in temperature =",dT,"deg")
#calculate the value of dPbydT
#Initialization of variables
V=6.84 #cm^3 /g
#calculations
dPbydT=-1.7*4.184*10**7 /(2.19*V*0.06*1.01*10**6)
#results
print '%s %d %s' %("dPbydT =",dPbydT," atm/deg")
#calculate the Pressure
#Initialization of variables
P=6 #atm
T=273.2+25 #K
P=23.8 #mm
V=0.018 #lt/mol
R=0.08206 #lt am/deg mol
#calculations
dPa=V*P*4536/(R*T*760)
Pa=dPa+P
#results
print '%s %.1f %s' %("Pressure =",Pa," mm")
#calculate the mole fraction of methanol in vapor
#Initialization of variables
x=0.25
Ps1=96 #mm
Ps2=43.9 #mm
#calculations
P1=x*Ps1
P2=(1-x)*Ps2
P=P1+P2
Xdash=P1/P
#results
print '%s %.3f' %("mole fraction of methanol in vapor =",Xdash)
#calculate the Molal elevation constant
#Initialization of variables
Hv=539.6 #cal/g
T=273.2+100 #K
#calculations
Kb=1.987*T**2 /(1000*Hv)
#results
print '%s %.3f %s' %("Molal elevation constant =",Kb," deg /mole /kg")
#calculate the Molecular weight of solute
#Initialization of variables
ms=0.5 #mol/kg
m=5 #g
mw=100 #g
Ws=1000 #g/kg
#calculations
Ma=m*Ws/(ms*mw)
#results
print '%s %d %s' %("Molecular weight of solute =",Ma,"g/mol ")
#calculate the molality of the solution
#Initialization of variables
dT=0.23 #C
Kb=1.86 #deg/mol/kg
#calculations
m=dT/Kb
#results
print '%s %.2f %s' %("molality of solution =",m,"m")
#calculate the Osmotic Pressure
#Initialization of variables
p=0.1 #m
T=30+273.2 #K
R=0.08206 #lt atm /deg/mol
P1=1 #atm
#calculations
w=1000/p
V=w/1000.
dP=R*T/V
P=dP+P1
#results
print '%s %.2f %s' %("Osmotic Pressure =",P," atm ")