Chapter 0 - Introduction

Example E1 - Pg 4

In [1]:
#Calculate the final pressure of the gas
#Initialization of variables
P=1.115 #bar
#Calculations
Conv_fac=1/1.01325
FinalP=Conv_fac*P #Final pressure
#Results
print '%s %.3f' %('Final pressure in atmospheres (atm)= ',FinalP)
Final pressure in atmospheres (atm)=  1.100

Example I1 - Pg 5

In [2]:
#Calculate the pressure at the foot of the column
#Initialization of variables
h=0.760 #m
d=1.36*10000 #kg/m^3
#Calculations
P=9.81*d*h
#Results
print '%s %.3e' %('Pressure at the foot of the column (Pa)= ',P)
Pressure at the foot of the column (Pa)=  1.014e+05

Example I2 - Pg 6

In [3]:
#calculate the hydrostatic pressure and pressure in apparatus
#Initialization of variables
h=0.1 #m
d=1000 #Kg/m^3
Patm=100021. #Pa
#Calculations
P=9.81*h*d
Papp=(Patm-P)/1000.
#Results
print '%s %.3f' %('Hydrostatic pressure(Pa) = ',P )
print '%s %.3f' %('\n Pressure in apparatus(kPa) = ',Papp)
Hydrostatic pressure(Pa) =  981.000

 Pressure in apparatus(kPa) =  99.040

Example I3 - Pg 8

In [4]:
#Calculate the no.of moles of copper required
import math
#Initialization of variables
N=8.8*math.pow(10,22)
NA=6.023*math.pow(10,23) #mol^-1
#Calculations
n=N/NA
#Results
print '%s %.2f' %('No. of moles of Cu ( mol Cu)= ',n)
No. of moles of Cu ( mol Cu)=  0.15

Example I4 - Pg 9

In [5]:
#calculate the amount of Carbon atoms 
#Initialization of variables
m=21.5 #g
Mc=12.01 #g/mol
#Calculations
nc=m/Mc
#Results
print '%s %.2f %s' %("Amount of C atoms=",nc,"mol C")
Amount of C atoms= 1.79 mol C