Chapter 2 : Physico Chemical Calculations

example 2.1 page number 71

In [2]:
import math 

p1=15.     #in bar
p2=1.013  #in bar
t1=283.    #in K
t2=273.    #in K
v1=10.     #in l

v2=p1*v1*t2/(t1*p2);

print "volume of oxygen = %f liters"%(v2)
volume of oxygen = 142.842692 liters

example 2.2 page number 71

In [3]:
import math 

nCO2 = 2./44;     #moles of CO2
nO2 = 4./32;     #moles of O2
nCH4 = 1.5/16;   #moles of CH4

total_moles = nCO2+nO2+nCH4;
yCO2 = nCO2/total_moles;
yO2 = nO2/total_moles;
yCH4 = nCH4/total_moles;

print  " Composition of mixture = CH4 = %f O2 = %f  CO2 = %f "%(yCH4,yO2,yCO2)

pCO2=nCO2*8.314*273/(6*10**-3);
pO2=nO2*8.314*273/(6*10**-3);
pCH4=nCH4*8.314*273/(6*10**-3);

print  "pressure of CH4 = %f kPa pressure of O2 = %f kPa pressure of CO2 =%f kPa"%(pCH4*10**-3,pO2*10**-3,pCO2*10**-3)

total_pressure=pCO2+pCH4+pO2;
print  "total pressure =  %f Kpa"%(total_pressure*10**-3)
 Composition of mixture = CH4 = 0.354839 O2 = 0.473118  CO2 = 0.172043 
pressure of CH4 = 35.464406 kPa pressure of O2 = 47.285875 kPa pressure of CO2 =17.194864 kPa
total pressure =  99.945145 Kpa

example 2.3 page number 72

In [4]:
import math 

P=104.3     #total pressure in KPa
pH2O=2.3    #in KPa
pH2=P-pH2O; #in KPa

VH2=209*pH2*273/(293*101.3)

print "volume of hydrogen obtained = %f ml"%(VH2)


m=350/196.08*11.2   #mass of metal in grams
print "mass of metal equivalent to 11.2 litre/mol of hydrogen = %f gm"%(m)
volume of hydrogen obtained = 196.079432 ml
mass of metal equivalent to 11.2 litre/mol of hydrogen = 19.991840 gm

example 2.4 page number 72

In [5]:
import math 
w=2   #in gm
m=0.287  #in gm

mNaCl=58.5/143.4*m;

print "mass of NaCl = %f gm"%(mNaCl )

percentage_NaCl=mNaCl/w*100;
print "amount of NaCl = %f"%(percentage_NaCl)
mass of NaCl = 0.117082 gm
amount of NaCl = 5.854079

example 2.5 page number 72

In [6]:
import math 

w=4.73    #in gm5
VCO2=5.30    #in liters

weight_CO2=44/22.4*VCO2;
carbon_content=12./44*weight_CO2;
percentage_content=(carbon_content/w)*100;

print "percentage amount of carbon in sample = %f"%(percentage_content)
percentage amount of carbon in sample = 60.027182

example 2.6 page number 73

In [7]:
import math 

volume_H2=0.5    #in m3
volume_CH4=0.35  #in m3
volume_CO=0.08   #in m3
volume_C2H4=0.02 #in m3
volume_oxygen=0.21  #in m3 in air

H2=0.5*volume_H2;
CH4=2*volume_CH4;
CO=0.5*volume_CO;
C2H4=3*volume_C2H4;

total_O2=H2+CH4+CO+C2H4;
oxygen_required=total_O2/volume_oxygen;

print "amount of oxygen required = %f cubic meter"%(oxygen_required)
amount of oxygen required = 5.000000 cubic meter

example 2.7 page number 73

In [8]:
import math 


density_H2SO4 = 1.10   #in g/ml
mass_1 = 100*density_H2SO4;   #mass of 100ml of 15% solution
mass_H2SO4 = 0.15*mass_1;
density_std = 1.84   #density of 96% sulphuric acid
mass_std = 0.96*density_std;   #mass of H2SO4 in 1ml 96% H2SO4

volume_std = mass_H2SO4/mass_std;    #volume of 96%H2SO4
mass_water = mass_1 - mass_H2SO4;

print "volume of 0.96 H2SO4 required = %f ml"%(volume_std)
print "mass of water required = %f g"%(mass_water)
volume of 0.96 H2SO4 required = 9.341033 ml
mass of water required = 93.500000 g

example 2.8 page number 73

In [9]:
import math 

w_H2SO4=0.15    #in gm/1gm solution
density=1.10   #in gm/ml
m=density*1000;   #mass per liter
weight=m*w_H2SO4;   #H2SO4 per liter solution
molar_mass=98;

Molarity=weight/molar_mass;
print "Molarity = %f mol/l"%(Molarity)

equivalent_mass=49;
normality=weight/equivalent_mass;
print "Normality = %f N"%(normality)

molality=176.5/molar_mass;
print "Molality = %f"%(molality)
Molarity = 1.683673 mol/l
Normality = 3.367347 N
Molality = 1.801020

example 2.9 page number 74

In [1]:
import math 

molar_mass_BaCl2=208.3;      #in gm
equivalent_H2SO4=0.144;

normality=equivalent_H2SO4*1000/28.8;

print "Normality = %f N"%(normality)
Normality = 5.000000 N

example 2.10 page number 74

In [11]:
import math 

solubility_70=30.2     #in gm/100gm
w_solute=solubility_70*350/130.2;     #in gm

w_water=350-w_solute;
solubility_30=10.1    #in gm/100gm
precipitate=(solubility_70-solubility_30)*w_water/100

print "amount precipitated = %f gm"%(precipitate)
amount precipitated = 54.032258 gm

example 2.11 page number 74

In [12]:
import math 

absorbtion_coefficient=1.71    #in liters
molar_mass=44;

solubility=absorbtion_coefficient*molar_mass/22.4;   #in gm
pressure=8/solubility*101.3;

print "pressure required = %f kPa"%(pressure)
pressure required = 241.267411 kPa

example 2.12 page number 74

In [13]:
import math 


w_water=540.   #in gm
w_glucose=36.  #in gm
m_water=18.;      #molar mass of water
m_glucose=180.;   #molar mass of glucose

x=(w_water/m_water)/(w_water/m_water+w_glucose/m_glucose);
p=8.2*x;
depression=8.2-p;

print "depression in vapor pressure = %f Pa"%(depression*1000)
depression in vapor pressure = 54.304636 Pa

example 2.13 page number 75

In [14]:
import math 

w_glucose=9.    #in gm
w_water=100.    #in gm
E=0.52;
m=90/180.;    #moles/1000gm water

delta_t=E*m;
boiling_point=100+delta_t;

print "boiling_point of water = %f degreeC"%(boiling_point)
boiling_point of water = 100.260000 degreeC

example 2.14 page number 75

In [15]:
import math 

K=1.86;
c=15   #concentration of alcohol
delta_t=10.26;

m=delta_t/K;   #molality
M=c/(m*85);    #molar mass
print "molar mass = %f gm"%(M*1000)

density=0.97     #g/ml
cm=c*density/(M*100);
print "molar concentration of alcohol = %f moles/l"%(cm)

p=cm*8.314*293   #osmotic pressure
print "osmotic pressure = %f Mpa"%(p/1000)
molar mass = 31.991744 gm
molar concentration of alcohol = 4.548048 moles/l
osmotic pressure = 11.079055 Mpa

example 2.15 page number 75

In [16]:
import math 

u_in = 0.575   #from the graph
u_s = 0.295   #in mPa-s

M_v = (u_in/(5.80*10**-5))**(1/0.72);
u_red = 0.628;   #in dl/g

c = 0.40   #in g/dl
k = (u_red-u_in)/((u_in**2)*c);

print "k = %f Mv = %fu_in = %f dl/gm"%(k,M_v,u_in)
k = 0.400756 Mv = 355085.654054u_in = 0.575000 dl/gm

example 2.16 page number 76

In [17]:
import math 

C=54.5     #% of carbon
H2=9.1     #% of hydrogen
O2=36.4    #% of oxygen
x=C/12.;    #number of carbon molecules
y=O2/16.;   #number of oxygen molecules
z=H2/2.    #number of hydrogen molecules
molar_mass=88.;
density=44.;

ratio=molar_mass/density;
x=ratio*2;
y=ratio*1;
z=ratio*4;

print "x = %f y = %f z = %f"%(x,y,z)
print "formula of butyric acid is = C4H8O2"
x = 4.000000 y = 2.000000 z = 8.000000
formula of butyric acid is = C4H8O2

example 2.17 page number 77

In [8]:
import math 

C=93.75    #% of carbon
H2=6.25    #% of hydrogen
x=C/12     #number of carbon atoms
y=H2/2     #number of hydrogen atoms
molar_mass=64
density=4.41*29;

ratio=density/molar_mass;
x=round(ratio*5);
y=round(ratio*4);

print "x = %f y = %f"%(x,y)
print "formula of butyric acid is = C10H8"
x = 10.000000 y = 8.000000
formula of butyric acid is = C10H8

example 2.18 page number 77

In [3]:
import math 

C=50.69     #% of carbon
H2=4.23     #% of hydrogen
O2=45.08    #% of oxygen
a=C/12;    #number of carbon molecules
c=O2/16;   #number of oxygen molecules
b=H2/2;    #number of hydrogen molecules
molar_mass=71;

def f(m):
    return (2.09*1000)/(60*m);


M=f((1.25/5.1));

print "actual molecular mass = %f"%(M)

ratio=M/molar_mass;
a=round(ratio*3);
b=round(ratio*3);
c=round(ratio*2);

print "a = %d, b = %d, c = %d"%(a,b,c)
print "M = %.1f g/mol"%M
print "formula of butyric acid is = C6H6O4"
actual molecular mass = 142.120000
a = 6, b = 6, c = 4
M = 142.1 g/mol
formula of butyric acid is = C6H6O4

example 2.19 page number 78

In [12]:
import math 

C=64.6     #% of carbon
H2=5.2     #% of hydrogen
O2=12.6    #% of oxygen
N2=8.8     #% of nitrogen
Fe=8.8     #% of iron

a=C/12;    #number of carbon molecules
c=8.8/14;   #number of nitrogen molecules
b=H2;    #number of hydrogen molecules
d=O2/16;   #number of oxygen molecules
e=Fe/56    #number of iron atoms

cm=243.4/(8.31*293)     #concentration

molar_mass=63.3/cm;
 
print "a = %d, b = %d, c = %d, d = %d, e = %d"%(a*6.5,b*6.5,c*6.5,d*6.5,e*6.5)
print "formula of butyric acid is = C34H33N4O5Fe"
a = 34, b = 33, c = 4, d = 5, e = 1
formula of butyric acid is = C34H33N4O5Fe

example 2.20 page number 78

In [21]:
import math 

E1=-0.25;
E2=0.80;
E3=0.34;

a=[E1,E2,E3];
sorted(a)

print "sorted potential in volts ="
print  (a)
print  ("E2>E3>E1")
print  ("silver>copper>nickel")
sorted potential in volts =
[-0.25, 0.8, 0.34]
E2>E3>E1
silver>copper>nickel

example 2.21 page number 79

In [22]:
import math 

E0_Zn=-0.76;
E0_Pb=-0.13;
c_Zn=0.1;
c_Pb=0.02;

E_Zn=E0_Zn+(0.059/2)*math.log10(c_Zn);
E_Pb=E0_Pb+(0.059/2)*math.log10(c_Pb);
E=E_Pb-E_Zn;

print "emf of cell = %f V"%(E)
print "Since potential of lead is greater than that of zinc thus reduction will occur at\
 lead electrode and oxidation will occur at zinc electrode"
emf of cell = 0.609380 V
Since potential of lead is greater than that of zinc thus reduction will occur at lead electrode and oxidation will occur at zinc electrode

example 2.22 page number 79

In [23]:
import math 

E0_Ag=0.80;
E0_AgNO3=0.80;
c_Ag=0.001;
c_AgNO3=0.1;

E_Ag=E0_Ag+(0.059)*math.log10(c_Ag);
E_AgNO3=E0_AgNO3+(0.059)*math.log10(c_AgNO3);
E=E_AgNO3-E_Ag;

print "emf of cell = %f V" %(E)
print "since E is positive, the left hand electrode will be anode and\
 the electron will travel in the external circuit from the left hand to the right hand electrode"
emf of cell = 0.118000 V
since E is positive, the left hand electrode will be anode and the electron will travel in the external circuit from the left hand to the right hand electrode

example 2.23 page number 79

In [24]:
import math 
pH=12;    #pH of solution
E_H2=0;

E2=-0.059*pH;
E=E_H2-E2;

print "EMF of cell = %f V"%(E)
EMF of cell = 0.708000 V

example 2.24 page number 80

In [25]:
import math 

I=3   #in Ampere
t=900   #in s
m_eq=107.9    #in gm/mol
F=96500;

m=(I*t*m_eq)/F;

print "mass = %f gm"%(m)
mass = 3.018964 gm

example 2.25 page number 80

In [26]:
import math 

volume=10*10*0.005;    #in cm3
mass=volume*8.9;
F=96500;
atomic_mass=58.7    #in amu
current=2.5     #in Ampere

charge=(8.9*F*2)/atomic_mass;
yield_=0.95;
actual_charge=charge/(yield_*3600);
t=actual_charge/current;

print "time required = %f hours"%(t)
time required = 3.422497 hours

example 2.26 page number 80

In [27]:
m_MgSO4=90.   #in ppm
MgSO4_parts=120.;
CaCO3_parts=100.;

hardness=(CaCO3_parts/MgSO4_parts)*m_MgSO4;

print "hardness of water = %f mg/l"%(hardness)
hardness of water = 75.000000 mg/l

example 2.27 page number 81

In [1]:
'''
calculate
i) the temporary and total hardness of the sample
ii) the amounts of lime and soda needed for softening of 1 l of the sample
'''

import math 

m1 = 162.   #mass of calcium bi carbonate in mg
m2 = 73.   #mass of magnesium bi carbonate in mg
m3 = 136.  # mass of calsium sulfate in mg
m4 = 95.   # mass of magnesium cloride
m5 = 500.  #mass of sodium cloride in mg
m6 = 50.   # mass of potassium cloride in mg

content_1 = m1*100/m1;    #content of calcium bi carbonate in mg
content_2 = m2*100/(2*m2);   #content of magnesium bi carbonate in mg
content_3 = m3*100/m3;  # content of calsium sufate in mg
content_4 = m4*100/m4;   # content of magnesium cloride


temp_hardness = content_1 + content_2;   #depends on bicarbonate only
total_hardness = content_1+content_2+content_3+content_4;
print "total hardness = %.0f mg/l temporary hardness = %.0f mg/l"%(temp_hardness,total_hardness)

wt_lime = (74./100)*(content_1+2*content_2+content_4);
actual_lime = wt_lime/0.85;
print "amount of lime required = %.1f mg/l"%(actual_lime)

soda_required = (106./100)*(content_1+content_4);
actual_soda = soda_required/0.98;
print "amount of soda required = %.1f mg/l"%(actual_soda)
total hardness = 150 mg/l temporary hardness = 350 mg/l
amount of lime required = 261.2 mg/l
amount of soda required = 216.3 mg/l

example 2.28 page number 82

In [29]:
volume_NaCl=50.    #in l
c_NaCl=5000.       #in mg/l

m=volume_NaCl*c_NaCl;
equivalent_NaCl=50/58.5;

hardness=equivalent_NaCl*m;

print "hardness of water = %f mg/l"%(hardness/1000.)
hardness of water = 213.675214 mg/l

example 2.29 page number 82

In [30]:
import math 

m_benzene = 55.   #in kg
m_toluene = 28.   #in kg
m_xylene = 17.    # in kg

mole_benzene = m_benzene/78.;
mole_toluene = m_toluene/92.;
mole_xylene = m_xylene/106.;

mole_total = mole_benzene+mole_toluene+mole_xylene;
x_benzene = mole_benzene/mole_total;
x_toluene = mole_toluene/mole_total;
x_xylene = mole_xylene/mole_total;

P = x_benzene*178.6+x_toluene*74.6+x_xylene*28;
print "total pressure = %f kPa"%(P)

benzene = (x_benzene*178.6*100)/P;
toluene = (x_toluene*74.6*100)/P;
xylene = (x_xylene*28*100)/P;

print "xylene = %f  toluene = %f  benzene = %f"%(xylene,toluene,benzene)
total pressure = 130.897438 kPa
xylene = 2.932503  toluene = 14.826766  benzene = 82.240730

example 2.30 page number 83

In [31]:
import math 

vapor_pressure=8.    #in kPa
pressure=100.       #in kPa

volume=1     #in m3
volume_ethanol=volume*(vapor_pressure/pressure);
volume_air=1-volume_ethanol;
print "volumetric composition:- air composition = %f ethanol compostion = %f"%(volume_air*100,volume_ethanol*100)

molar_mass_ethanol=46;
molar_mass_air=28.9;
mass_ethanol=0.08*molar_mass_ethanol;    #in kg
mass_air=0.92*molar_mass_air;     #in kg
fraction_ethanol=(mass_ethanol*100)/(mass_air+mass_ethanol);
fraction_air=(mass_air*100)/(mass_air+mass_ethanol);
print "composition by weight:-Air = %f Ethanol vapor = %f"%(fraction_air,fraction_ethanol)

mixture_volume=22.3*(101.3/100)*(299./273);   #in m3
weight_ethanol=mass_ethanol/mixture_volume;
print "weight of ethanol/cubic meter = %f Kg"%(weight_ethanol)

w_ethanol=mass_ethanol/mass_air;
print "weight of ethanol/kg vapor free air = %f Kg"%(w_ethanol)

moles_ethanol=0.08/0.92;
print "kmol of ethanol per kmol of vapor free air = %f"%(moles_ethanol)
volumetric composition:- air composition = 92.000000 ethanol compostion = 8.000000
composition by weight:-Air = 87.841945 Ethanol vapor = 12.158055
weight of ethanol/cubic meter = 0.148739 Kg
weight of ethanol/kg vapor free air = 0.138408 Kg
kmol of ethanol per kmol of vapor free air = 0.086957

example 2.31 page number 84

In [15]:
import math 

vapor_pressure=8.   #in kPa
volume_ethanol=0.05;


partial_pressure=volume_ethanol*100;
relative_saturation=partial_pressure/vapor_pressure;
mole_ratio=volume_ethanol/(1-volume_ethanol);
print "mole ratio = %f \nrelative saturation = %f %%"%(mole_ratio,relative_saturation*100)

volume_vapor=(8./100)*100;
ethanol_vapor=volume_vapor/100.;
air_vapor=1-ethanol_vapor;
saturation_ratio=ethanol_vapor/air_vapor;
percentage_saturation=mole_ratio/saturation_ratio;

print "percentage saturation = %f %%"%(percentage_saturation*100)

print "corresponding to partial pressure of 5kPa we get a dew point of 17.3 degree celcius"
mole ratio = 0.052632 
relative saturation = 62.500000 %
percentage saturation = 60.526316 %
corresponding to partial pressure of 5kPa we get a dew point of 17.3 degree celcius

example 2.32 page number 84

In [6]:
import math 

p = 4.24   #in kPa
H_rel = 0.8;

p_partial = p*H_rel;
molal_H = p_partial/(100-p_partial);
print "initial molal humidity = %.3f"%(molal_H)

P = 200.   #in kPa
p_partial = 1.70   #in kPa
final_H = p_partial/(P-p_partial);
print "final molal humidity = %.4f"%(final_H)

p_dryair = 100 - 3.39;
v = 100*(p_dryair/101.3)*(273./303);
moles_dryair = v/22.4;
vapor_initial = molal_H*moles_dryair;
vapor_final = final_H*moles_dryair;
water_condensed = (vapor_initial-vapor_final)*18;
print "amount of water condensed = %f kg"%(water_condensed)

total_air = moles_dryair+vapor_final;
final_v = 22.4*(101.3/200)*(288./273)*total_air;
print "final volume of wety air = %f m**3"%(final_v)
initial molal humidity = 0.035
final molal humidity = 0.0086
amount of water condensed = 1.832428 kg
final volume of wety air = 46.307275 m**3
In [ ]: