##water and its treatment##
##example 2.18.1##
import math
W1=12.5;##CaCO3 in water in mg/lit##
W2=8.4;##MgCO3 in water in mg/lit##
W3=22.2;##CaCl2 in water in mg/lit##
W4=9.5;##MgCl2 in water in mg/lit##
W5=33.;##CO2 in water in mg/lit##
W6=6.68;##NaHCO3 in water in mg/lit##
M1=100./100.;##multiplication factor of CaCO3##
M2=100./84.;##multiplication factor of MgCO3##
M3=100./111.;##multiplication factor of CaCl2##
M4=100./95.;##multiplication factor of MgCl2##
M6=100./84.;##multiplication factor of NaHCO3##
P1=W1*M1;##CaCO3 in terms of CaCO3##
P2=W2*M2;##MgCO3 in terms of CaCO3##
P3=W3*M3;##CaCl2 in terms of CaCO3##
P4=W4*M4;##MgCl2 in terms of CaCO3##
P6=W6*M6;##NaHCO3 in terms of CaCO3##
print ("We do not take CO2 since it does not contribute to hardness ");
C=P1+P2+P6;
print'%s %.2f %s'%("\nCarbonate hardness is ",C," mg/l or ppm");
NC=P3+P4;
print'%s %.2f %s'%("\nNon Carbonate hardness is ",NC," mg/l or ppm");
##water and its treatment##
##example 2.18.2##
import math
W1=40.5;##Ca(HCO3)2 in water in mg/lit##
W2=33.3;##CaCl2 in water in mg/lit##
W3=41.;##Ca(NO3)2 in water in mg/lit##
W4=101.;##KNO3 in water in mg/lit##
W5=33.6;##MgCO3 in water in mg/lit##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./111.;##multiplication factor of CaCl2##
M3=100./164.;##multiplication factor of Ca(NO3)2##
M5=100./84.;##multiplication factor of MgCO3##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##
P2=W2*M2;##CaCl2 in terms of CaCO3##
P3=W3*M3;##Ca(NO3)2 in terms of CaCO3##
P5=W5*M5;##MgCO3 in terms of CaCO3##
print ("We do not take KNO3 since it does not contribute to hardness ");
C=P1+P5;
print'%s %.2f %s'%("\nCarbonate hardness is ",C," mg/l or ppm");
NC=P2+P3;
print'%s %.2f %s'%("\nNon Carbonate hardness is ",NC," mg/l or ppm");
##water and its treatment##
##example 2.18.3##
import math
W1=29.1;##Mg(HCO3)2 in water in mg/lit##
W2=40.5;##Ca(HCO3)2 in water in mg/lit##
W3=11.1;##CaCl2 in water in mg/lit##
W4=15.82;##MgCl2 in water in mg/lit##
W5=28.5;##NaCl in water in mg/lit##
W6=22.0;##CO2 in water in mg/lit##
M1=100./146.007;##multiplication factor of Mg(HCO3)2##
M2=100./162.;##multiplication factor of Ca(HCO3)2##
M3=100./111.;##multiplication factor of CaCl2##
M4=100./95.005;##multiplication factor of MgCl2##
P1=W1*M1;##Mg(HCO3)2 in terms of CaCO3##
P2=W2*M2;##Ca(HCO3)2 in terms of CaCO3##
P3=W3*M3;##CaCl2 in terms of CaCO3##
P4=W4*M4;##MgCl2 in terms of CaCO3##
print("We do not take NaCl and CO2 since they do not contribute to hardness ");
C=P1+P2;
print'%s %.2f %s'%("\nCarbonate hardness is ",C," mg/l or ppm");
NC=P3+P4;
print'%s %.2f %s'%("\nNon Carbonate hardness is ",NC," mg/l or ppm");
##water and its treatment##
##example 2.18.4##
import math
W1=16.2;##Ca(HCO3)2 in water in mg/lit##
W2=14.6;##Mg(HCO3)2 in water in mg/lit##
W3=9.5;##MgCl2 in water in mg/lit##
W4=48.;##MgSO4 in water in mg/lit##
W5=12.;##KCl in water in mg/lit##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./146.;##multiplication factor of Mg(HCO3)2 ##
M3=100./95.;##multiplication factor of MgCl2##
M4=100./120.;##multiplication factor of MgSO4##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##
P2=W2*M2;##Mg(HCO3)2 in terms of CaCO3##
P3=W3*M3;##MgCl2 in terms of CaCO3##
P4=W4*M4;##MgSO4 in terms of CaCO3##
print ("We do not take KCl since it does not contribute to hardness ");
C=P1+P2;
print'%s %.2f %s'%("\nCarbonate hardness is ",C," mg/l or ppm");
NC=P3+P4;
print'%s %.2f %s'%("\nNon Carbonate hardness is ",NC," mg/l or ppm");
##water and its treatment##
##example 2.18.5##
import math
W1=81;##Ca(HCO3)2 in water in mg/lit##
W2=84;##MgCO3 in water in mg/lit##
W3=22.2;##CaCl2 in water in mg/lit##
W4=60;##MgSO4 in water in mg/lit##
W5=30;##KCl in water in mg/lit##
M1=100/162;##multiplication factor of Ca(HCO3)2##
M2=100/84;##multiplication factor of MgCO3##
M3=100/111;##multiplication factor of CaCl2##
M4=100/120;##multiplication factor of MgSO4##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##
P2=W2*M2;##MgCO3 in terms of CaCO3##
P3=W3*M3;##CaCl2 in terms of CaCO3##
P4=W4*M4;##MgSO4 in terms of CaCO3##
print ("We do not take KCl since it does not contribute to hardness ");
T=P1+P2;
print'%s %.2f %s'%("\nTemporary hardness is ",T," mg/l or ppm");
P=P3+P4;
print'%s %.f %s'%("\nPermanant hardness is ",P," mg/l or ppm");
To=T+P;
print'%s %.2f %s'%("\nTotal hardness is ",To," mg/l or ppm");
##water and its treatment##
##example 2.18.6##
import math
W1=29.2;##MgCO3 in water in mg/lit##
W2=36.;##MgSO4 in water in mg/lit##
W3=22.2;##CaCl2 in water in mg/lit##
W4=142.5;##MgCl2 in water in mg/lit##
M1=100./84.;##multiplication factor of MgCO3##
M2=100./120.;##multiplication factor of MgSO4##
M3=100./111.;##multiplication factor of CaCl2##
M4=100./95.;##multiplication factor of MgCl2##
P1=W1*M1;##MgCO3 in terms of CaCO3##
P2=W2*M2;##MgSO4 in terms of CaCO3##
P3=W3*M3;##CaCl2 in terms of CaCO3##
P4=W4*M4;##MgCl2 in terms of CaCO3##
T=P1;
print'%s %.2f %s'%("\nCarbonate hardness is ",T," mg/l or ppm");
P=P2+P3+P4;
print'%s %.2f %s'%("\nNon Carbonate hardness is ",P," mg/l or ppm");
##water and its treatment##
##example 2.18.7##
import math
Hardness_ppm=304.##ppm in terms of CaCO3##
Cl=0.07*Hardness_ppm##0.07 Clarke =1 ppm##
Fr=0.1*Hardness_ppm##0.1 French =1 ppm##
mgperlit=Hardness_ppm
print'%s %.2f %s'%("Hardness in terms of Clarke ",Cl," Cl");
print'%s %.2f %s'%("\nHardness in terms of French ",Fr," Fr");
print'%s %.2f %s'%("\nHardness in terms of mg/lit ",mgperlit," mg/l");
##water and its treatment##
##example 2.18.7.A##
import math
W1=32.4;##Ca(HCO3)2 in water in mg/lit##
W2=29.2;##Mg(HCO3)2 in water in mg/lit##
W3=13.5;##CaSO4 in water in mg/lit##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./146.;##multiplication factor of Mg(HCO3)2 ##
M3=100./136.;##multiplication factor of CaSO4##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##
P2=W2*M2;##Mg(HCO3)2 in terms of CaCO3##
P3=W3*M3;##CaSO4 in terms of CaCO3##
T=P1+P2;
print'%s %.0f %s'%("\nTemporary hardness is ",T," mg/l or ppm");
P=P3;
print'%s %.0f %s'%("\nPermanant hardness is ",P," mg/l or ppm");
To=T+P;
print'%s %.2f %s'%("\nTotal hardness is ",To," mg/l or ppm");
##water and its treatment##
##example 2.18.8##
import math
Hardness_Cl=2.42##in terms of Clarke##
Hardness_Fr=3.6##in terms of French##
Cl=Hardness_Cl/0.07##0.07 Clarke =1 ppm##
Fr=Hardness_Fr/0.1##0.1 French =1 ppm##
print'%s %.2f %s'%("2.42Clarke ",Cl," mg/l or ppm");
print'%s %.2f %s'%("\n 3.6 French ",Fr," mg/l or ppm");
##water and its treatment##
##example 2.18.9##
import math
Hardness_ppm1=350.##ppm in terms of CaCO3##
Hardness_ppm2=500.##ppm in terms of CaCO3##
Cl=0.07*Hardness_ppm1##0.07 Clarke =1 ppm##
Fr=0.1*Hardness_ppm2##0.1 French =1 ppm##
print'%s %.2f %s'%("1)Hardness in terms of degree Clarke ",Cl," Cl");
print'%s %.2f %s'%("\n 2)Hardness in terms of degree French ",Fr," Fr");
##water and its treatment##
##example 2.18.10##
import math
W1=40.5;##Ca(HCO3)2 in water in mg/lit##
W2=23.75;##MgCl2 in water in mg/lit##
W3=21.;##MgCO3 in water in mg/lit##
W4=6.;##SiO2 in water in mg/lit##
W5=3.;##CO2 in water in mg/lit##
W6=55.5;##CaCl2 in water in mg/lit##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./95.;##multiplication factor of MgCl2##
M3=100./84.;##multiplication factor of MgCO3##
M6=100./111.;##multiplication factor of CaCl2##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3 or ##
P2=W2*M2;##MgCl2 in terms of CaCO3 or ##
P3=W3*M3;##MgCO3 in terms of CaCO3 or ##
P6=W6*M6;##CaCl2 in terms of CaCO3 or ##
print ("We do not take SiO2 and CO2 since they do not contribute to hardness ");
C=P1+P3;
print'%s %.f %s'%("\nCarbonate hardness is ",C," mg/l or ppm");
NC=P2+P6;
print'%s %.f %s'%("\nNon Carbonate hardness is ",NC," mg/l or ppm");
##water and its treatment##
##example 2.18.11##
import math
W1=17.5;##Ca(HCO3)2 in water in mg/lit##
W2=14.6;##Mg(HCO3)2 in water in mg/lit##
W3=9.5;##MgCl2 in water in mg/lit##
W4=12.0;##MgSO4 in water in mg/lit##
W5=8.4;##MgCO3 in water in mg/lit##
W6=5.5;##CaCl2 in water in mg/lit##
W7=35;##NaCl in water in mg/lit##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./146.;##multiplication factor of Mg(HCO3)2##
M3=100./95.;##multiplication factor of MgCl2##
M4=100./120.;##multiplication factor of MgSO4##
M5=100./84.;##multiplication factor of MgCO3##
M6=100./111.;##multiplication factor of CaCl2##
P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3 or ##
P2=W2*M2;##Mg(HCO3)2 in terms of CaCO3 or ##
P3=W3*M3;##MgCl2 in terms of CaCO3 or ##
P4=W4*M4;##MgSO4 in terms of CaCO3 or ##
P5=W5*M5;##MgCO3 in terms of CaCO3 or ##
P6=W6*M6;##CaCl2 in terms of CaCO3 or ##
print ("We do not take NaCl since it does not contribute to hardness ");
T=P1+P2+P5;
print'%s %.2f %s'%("\nTemporary hardness is ",T," mg/l or ppm");
P=P3+P4+P6;
print'%s %.2f %s'%("\nPermanant hardness is ",P," mg/l or ppm");
To=T+P;
print'%s %.2f %s'%("\nTotal hardness is ",To," mg/l or ppm");
##water and its treatment##
##example 2.18.12##
import math
strength_CaCl2=250./200.##in terms of mgs/ml CaCO3##
volume_CaCl2=25.##volume of CaCl2 titrated(ml)##
EDTA_CaCl2=35.##volume in terms of ml##
volume_hardwater=25.##volume of hardwater titrated(ml)##
EDTA_hardwater=30.##volume used to titrate unknown hardwater##
CaCO3_equivalent_CaCl2=strength_CaCl2*volume_CaCl2##in terms of mg##
one_ml_EDTA=CaCO3_equivalent_CaCl2/EDTA_CaCl2##in terms of CaCO3 equivalent##
titrate_equivalent=one_ml_EDTA*EDTA_hardwater/volume_hardwater##CaCO3 equivalent of titrated volume##
Hardness=titrate_equivalent*1000.##in terms of mg/lit or ppm##
print'%s %.2f %s'%("\nHardness of water is ",Hardness," mg/l or ppm");
##water and its treatment##
##example 2.18.13##
import math
strength_SH=1.##strength of Std hardwater
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=35.##volume for Std hardwater(ml)##
EDTA_H=20.##volume for sample hardwater(ml)##
AB_EDTA=12.##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.14##
import math
conc_SH=.5/500. ##in terms of g/lit##
strength_SH=conc_SH*1000. ##in terms of mgs/lit##
volume_SH=25. ##in terms of ml##
volume_H=50. ##in terms of ml##
EDTA_SH=24. ##volume for Std hardwater(ml)##
EDTA_H=22.5##volume for sample hardwater(ml)##
AB_EDTA=20. ##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.15##
import math
conc_SH=.2/200.##in terms of g/lit##
strength_SH=conc_SH*1000.##in terms of mgs/lit##
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=48.##volume for Std hardwater(ml)##
EDTA_H=15.##volume for sample hardwater(ml)##
AB_EDTA=10.##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.16##
import math
strength_SH=1.##in terms of mgs/lit##
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=20.##volume for Std hardwater(ml)##
EDTA_H=25.##volume for sample hardwater(ml)##
AB_EDTA=18.##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.17##
import math
strength_SH=1.##in terms of mgs/lit##
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=20.##volume for Std hardwater(ml)##
EDTA_H=30.##volume for sample hardwater(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
##water and its treatment##
##example 2.18.18##
import math
strength_SH=1.##in terms of mgs/lit##
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=20.##volume for Std hardwater(ml)##
EDTA_H=25.##volume for sample hardwater(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
##water and its treatment##
##example 2.18.19##
import math
conc_SH=0.28##in terms of g/lit##
strength_SH=conc_SH##in terms of mgs/lit##
volume_SH=100.##in terms of ml##
volume_H=100.##in terms of ml##
EDTA_SH=28.##volume for Std hardwater(ml)##
EDTA_H=33.##volume for sample hardwater(ml)##
AB_EDTA=10.##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.20##
import math
strength_SH=1.##in terms of mgs/lit##
volume_SH=50.##in terms of ml##
volume_H=50.##in terms of ml##
EDTA_SH=20.##volume for Std hardwater(ml)##
EDTA_H=25.##volume for sample hardwater(ml)##
AB_EDTA=18.##volume required after boiling(ml)##
CaCO3_equivalent_SH=strength_SH*volume_SH##in terms of CaCO3 equivalent##
one_ml_EDTA=CaCO3_equivalent_SH/EDTA_SH##in terms of CaCO3 equivalent##
To_sample=one_ml_EDTA*EDTA_H/volume_H##total hardness for given volume##
To=To_sample*1000.##total hardness per litre(ppm)##
P_sample=AB_EDTA*one_ml_EDTA/volume_H##permanent hardness for given volume##
P=P_sample*1000.##permanent hardness per litre(ppm)##
T=To-P
print'%s %.2f %s'%("\nTotal Hardness is ",To," mg/l or ppm");
print'%s %.2f %s'%("\nPermanent Hardness is ",P," mg/l or ppm");
print'%s %.2f %s'%("\nTemporary Hardness is ",T," mg/l or ppm");
##water and its treatment##
##example 2.18.21##
import math
Purity_Lime=.85
Purity_soda=.95
W1=55.5;##amount of CaCl2 in ppm##
W2=20.;##amount of SiO2 in ppm##
W3=12.6;##amount of NaHCO3 in ppm##
W4=250.;##amount of KCl in ppm##
W5=48.;##amount of MgSO4 in ppm##
W6=2.2;##amount of CO2 in ppm##
W7=43.8;##amount of Mg(HCO3)2 in ppm##
W8=2.;##amount of Fe++ in ppm##
W9=10.;##amount of AlCl3 in ppm##
M1=100./111.;##multiplication factor of CaCl2##
M3=100./(84.*2.);##multiplication factor of NaHCO3##
M5=100./120.;##multiplication factor of MgSO4##
M6=100./44.;##multiplication factor of CO2##
M7=100./146.;##multiplication factor of Mg(HCO3)2##
M8=100./55.8;##multiplication factor of Fe++##
M9=100./133.42;##multiplication factor of AlCl3##
P1=W1*M1;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##+L and -S
P5=W5*M5;##in terms of CaCO3##L+S
P6=W6*M6;##in terms of CaCO3##L
P7=W7*M7;##in terms of CaCO3##L
P8=W8*M8;##in terms of CaCO3##L+S
P9=W9*M9;##in terms of CaCO3##L+S
print("We do not take SiO2 and KCl since they do not react with lime/soda");
V=50000.;##volume of water in litres##
L=0.74*(P3+P5+P6+P7*2+P8+P9)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L,"kg");
S=1.06*(P1-P3+P5+P8+P9)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S,"kg")
##water and its treatment##
##example 2.18.22##
import math
Purity_Lime=.85
Purity_soda=.80
Rate_lime=9.##Rs.per kg##
Rate_soda=35.##Rs.per kg##
W1=20.4;##amount of CaSO4 in ppm##
W2=9.5;##amount of MgCl2 in ppm##
W3=7.3;##amount of HCl in ppm##
M1=100./136.;##multiplication factor of CaSO4##
M2=100./95.;##multiplication factor of MgCl2##
M3=100./(36.5*2);##multiplication factor of HCl##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##L+S
V=80000.;##volume of water in litres##
L=0.74*(P2+P3)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P1+P2+P3)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
Cost_lime=L*Rate_lime
Cost_soda=S*Rate_soda
print'%s %.2f %s'%("\nCost of lime is Rs. ",Cost_lime,"");
print'%s %.2f %s'%("\nCost of soda is Rs. ",Cost_soda,"")
##water and its treatment##
##example 2.18.23##
import math
Purity_Lime=.85
Purity_soda=.90
W1=27.2;##amount of CaSO4 in ppm##
W2=24;##amount of MgSO4 in ppm##
W3=11.1;##amount of CaCl2 in ppm##
W4=47.5;##amount of MgCl2 in ppm##
W5=2.195;##amount of CO2 in ppm##
W6=1.825;##amount of HCl in ppm##
W7=13.35;##amount of AlCl3 in ppm##
M1=100/136;##multiplication factor of CaSO4##
M2=100/120;##multiplication factor of MgSO4##
M3=100/111;##multiplication factor of CaCl2##
M4=100/95;##multiplication factor of MgCl2##
M5=100/44;##multiplication factor of CO2##
M6=100/(36.5*2);##multiplication factor of HCl##
M7=100/133.5;##multiplication factor of AlCl3##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L
P6=W6*M6;##in terms of CaCO3##L+S
P7=W7*M7;##in terms of CaCO3##L+S
V=100000.;##volume of water in litres##
L=0.74*(P2+P4+P5+P6+P7)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("Lime required is ",L,"kg");
S=1.06*(P1+P2+P3+P4+P6+P7)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\n Soda required is ",S,"kg")
##water and its treatment##
##example 2.18.24##
import math
W1=50;##amount of CaCO3 in ppm##
W2=14.4;##amount of MgCO3 in ppm##
W3=22.2;##amount of CaCl2 in ppm##
W4=9.5;##amount of MgCl2 in ppm##
W5=20;##amount of Fe2O3 in ppm##
W6=20;##amount of Na2SO4 in ppm##
W7=5;##amount of SiO2 in ppm##
W8=2.2;##amount of CO2 in ppm##
M1=100/100;##multiplication factor of CaCO3##
M2=100/84;##multiplication factor of MgCO3##
M3=100/111;##multiplication factor of CaCl2##
M4=100/95;##multiplication factor of MgCl2##
M8=100/44.05;##multiplication factor of CO2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##L+S
P8=W8*M8;##in terms of CaCO3##L
print("We do not take Fe2O3, Na2SO4 and SiO2 since they do not react with lime/soda");
V=75000.;##volume of water in litres##
L=0.74*(P1+P2*2.+P4+P8)*V;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L,"kg");
S=1.06*(P3+P4)*V;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S,"kg")
##water and its treatment##
##example 2.18.25##
import math
Purity_Lime=.90
Purity_soda=.90
Rate_lime=7.##Rs.per kg##
Rate_soda=35.##Rs.per kg##
W1=30.;##amount of Ca++ in ppm##
W2=21.6;##amount of Mg++ in ppm##
W3=12.2;##amount of HCO3- in ppm##
W4=4.4;##amount of CO2 in ppm##
W5=4.9;##amount of H2SO4 in ppm##
M1=100./40.;##multiplication factor of Ca++##
M2=100./24.;##multiplication factor of Mg++##
M3=100./(61.*2.);##multiplication factor of HCO3-##
M4=100./44.;##multiplication factor of CO2##
M5=100./98.;##multiplication factor of H2SO4##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##+L and -S
P4=W4*M4;##in terms of CaCO3##L
P5=W5*M5;##in terms of CaCO3##L+S
V=25000.;##volume of water in litres##
L=0.74*(P2+P3+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("Quantity of Lime required is ",L," kg");
S=1.06*(P1+P2-P3+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
Cost_lime=L*Rate_lime
Cost_soda=S*Rate_soda
print'%s %.2f %s'%("\nCost of lime is Rs. ",Cost_lime,"");
print'%s %.2f %s'%("\nCost of soda is Rs. ",Cost_soda,"")
##water and its treatment##
##example 2.18.26##
import math
Purity_Lime=.89
Purity_soda=.92
W1=30.;##amount of CaCO3 in ppm##
W2=90.;##amount of MgCO3 in ppm##
W3=160.;##amount of MgCl2 in ppm##
W4=35.;##amount of MgSO4 in ppm##
W5=25.;##amount of CaSO4 in ppm##
W6=120.;##amount of NaCl in ppm##
M1=100./100.;##multiplication factor of CaCO3##
M2=100./84.01;##multiplication factor of MgCO3##
M3=100./95.;##multiplication factor of MgCl2##
M4=100./120.;##multiplication factor of MgSO4##
M5=100./135.9;##multiplication factor of CaSO4##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##S
print ("We do not take NaCl since it does not react with lime/soda");
V=40000.;##volume of water in litres##
L=0.74*(P1+P2*2.+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L,"kg");
S=1.06*(P3+P4+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.27##
import math
Purity_Lime=0.90
Purity_soda=0.90
W1=2.1;##amount of CaCO3 in Clarke##
W2=0.63;##amount of MgCO3 in Clarke##
W3=0.35;##amount of CaSO4 in Clarke##
W4=0.21;##amount of MgSO4 in Clarke##
W5=0.063;##amount of MgCl2 in Clarke##
W6=0.035;##amount of KCl in Clarke##
M1=100./(100.*0.07);##multiplication factor of CaCO3##
M2=100./(84.04*0.07);##multiplication factor of MgCO3##
M3=100./(136.*0.07);##multiplication factor of CaSO4##
M4=100./(120.*0.07);##multiplication factor of MgSO4##
M5=100./(95.*0.07);##multiplication factor of MgCl2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L+S
print ("We do not take KCl since it do not react with lime/soda");
V=85000.;##volume of water in litres##
L=0.74*(P1+P2*2.+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P3+P4+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.28##
import math
Purity_Lime=.89
Purity_soda=.95
W1=14.6;##amount of HCl in ppm##
W2=34.2;##amount of Al2(SO4)3 in ppm##
W3=9.5;##amount of MgCl2 in ppm##
W4=30.;##amount of KCl in ppm##
M1=100./(2.*36.5);##multiplication factor of HCl##
M2=(3.*100.)/342.3;##multiplication factor of Al2(SO4)3##
M3=100./95.;##multiplication factor of MgCl2##
P1=W1*M1;##in terms of CaCO3##L+S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##L+S
print ("We do not take KCl since it does not react with lime/soda");
V=20000.;##volume of water in litres##
L=0.74*(P1+P2+P3)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P1+P2+P3)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.29##
import math
Purity_Lime=0.85
Purity_soda=0.95
W1=3.5;##amount of CaCO3 in ppm##
W2=6.8;##amount of CaSO4 in ppm##
W3=8.4;##amount of MgCO3 in ppm##
W4=5.7;##amount of MgCl2 in ppm##
W5=6.0;##amount of MgSO4 in ppm##
W6=3.0;##amount of SiO2 in ppm##
W7=11.7;##amount of NaCl in ppm##
M1=100./100.;##multiplication factor of CaCO3##
M2=100./135.86;##multiplication factor of CaSO4##
M3=100./84.;##multiplication factor of MgCO3##
M4=100./95.1;##multiplication factor of MgCl2##
M5=100./120.;##multiplication factor of MgSO4##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L+S
print ("We do not take SiO2 and NaCl since they do not react with lime/soda");
V=35000.;##volume of water in litres##
L=0.74*(P1+P3*2+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required in month of Feb 2000 is ",L*29," kg");
S=1.06*(P2+P4+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required in month of Feb 2000 is ",S*29," kg")
##water and its treatment##
##example 2.18.30##
import math
Purity_Lime=0.95
Purity_soda=0.90
W1=9.5;##amount of MgCl2 in ppm##
W2=272;##amount of CaSO4 in ppm##
W3=120;##amount of MgSO4 in ppm##
W4=49;##amount of H2SO4 in ppm##
W5=8;##amount of SiO2 in ppm##
M1=100/95;##multiplication factor of MgCl2##
M2=100/136;##multiplication factor of CaSO4##
M3=100/120;##multiplication factor of MgSO4##
M4=100/98;##multiplication factor of H2SO4##
P1=W1*M1;##in terms of CaCO3##L+S
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
print ("We do not take SiO2 since it does not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P1+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P1+P2+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.31##
import math
Purity_Lime=.80
Purity_soda=.88
W1=84.;##amount of MgCO3 in ppm##
W2=25.;##amount of SiO2 in ppm##
W3=68.;##amount of CaSO4 in ppm##
W4=30.;##amount of MgSO4 in ppm##
W5=19.;##amount of MgCl2 in ppm##
W6=120.;##amount of CaCO3 in ppm##
M1=100./84.004;##multiplication factor of MgCO3##
M3=100./136.;##multiplication factor of CaSO4##
M4=100./120.;##multiplication factor of MgSO4##
M5=100./95.;##multiplication factor of MgCl2##
M6=100./100.;##multiplication factor of CaCO3##
P1=W1*M1;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L+S
P6=W6*M6;##in terms of CaCO3##L
print ("We do not take SiO2 since it does not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P1*2.+P4+P5+P6)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P3+P4+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.32##
import math
Purity_Lime=.97
Purity_soda=.91
W1=24.;##amount of Mg2+ in ppm##
W2=20.;##amount of Ca2+ in ppm##
W3=30.;##amount of CO2 in ppm##
W4=150.;##amount of HCO3- in ppm##
W5=40.;##amount of K+ in ppm##
M1=100./24.;##multiplication factor of Mg2+##
M2=100./40.;##multiplication factor of Ca2+##
M3=100./44.;##multiplication factor of CO2##
M4=100./(61*2);##multiplication factor of HCO3-##
P1=W1*M1;##in terms of CaCO3##L+S
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##+L and -S
print("We do not take K+ since it does not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P1+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P1+P2-P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.33##
import math
Purity_Lime=.80
Purity_soda=.85
W1=162.;##amount of Ca(HCO3)2 in ppm##
W2=9.5;##amount of MgCl2 in ppm##
W3=58.5;##amount of NaCl in ppm##
W4=7.3;##amount of Mg(HCO3)2 in ppm##
W5=36.5;##amount of HCl in ppm##
W6=44.;##amount of CO2 in ppm##
W7=111.;##amount of CaCl2 in ppm##
W8=60.;##amount of MgSO4 in ppm##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./95.;##multiplication factor of MgCl2##
M4=100./146.;##multiplication factor of Mg(HCO3)2##
M5=100./(2.*36.5);##multiplication factor of HCl##
M6=100./44.;##multiplication factor of CO2##
M7=100./111.;##multiplication factor of CaCl2##
M8=100./120.;##multiplication factor of MgSO4##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L
P5=W5*M5;##in terms of CaCO3##L+S
P6=W6*M6;##in terms of CaCO3##L
P7=W7*M7;##in terms of CaCO3##S
P8=W8*M8;##in terms of CaCO3##L+S
print("We do not take NaCl since they do not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P1+P2+P4*2+P5+P6+P8)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P2+P5+P7+P8)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.34##
import math
Purity_Lime=.90
Purity_soda=.90
W1=30.;##amount of Ca2+ in ppm##
W2=21.6;##amount of Mg2+ in ppm##
W3=4.9;##amount of H2SO4 in ppm##
W4=4.4;##amount of CO2 in ppm##
W5=12.2;##amount of HCO3- in ppm##
W6=15.4;##amount of Fe2O3 in ppm##
M1=100./40.;##multiplication factor of Ca2+##
M2=100./24.;##multiplication factor of Mg2+##
M3=100./98.;##multiplication factor of H2SO4##
M4=100./44.01;##multiplication factor of CO2##
M5=100./122.;##multiplication factor of HCO3-##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L
P5=W5*M5;##in terms of CaCO3##+L and -S
print ("We do not take Fe2O3 since it does not react with lime/soda");
V=25000.;##volume of water in litres##
L=0.74*(P2+P3+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P1+P2+P3-P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.35##
import math
Purity_Lime=.95
Purity_soda=.80
W1=14.6;##amount of Mg(HCO3)2 in ppm##
W2=6.8;##amount of CaSO4 in ppm##
W3=8.1;##amount of Ca(HCO3)2 in ppm##
W4=12.;##amount of MgSO4 in ppm##
W5=15.;##amount of Na2SO4 in ppm##
W6=2.;##amount of SiO2 in ppm##
M1=100./146.;##multiplication factor of Ca2+##
M2=100./157.;##multiplication factor of Mg2+##
M3=100./162.08;##multiplication factor of H2SO4##
M4=100./120.;##multiplication factor of CO2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##L+S
print ("We do not take Na2SO4 and SiO2 since they do not react with lime/soda");
V=50000.;##volume of water in litres##
L=0.74*(P1*2.+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P2+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S,"kg")
##water and its treatment##
##example 2.18.36##
import math
Purity_Lime=.86
Purity_soda=.90
W1=35.2;##amount of CaCO3 in ppm##
W2=7.8;##amount of MgCl2 in ppm##
W3=12.5;##amount of HCl in ppm##
W4=33.3;##amount of Al2(SO4)3 in ppm##
W5=8.8;##amount of Na2SO4 in ppm##
W6=18.6;##amount of Fe2O3 in ppm##
M1=100./99.976;##multiplication factor of CaCO3##
M2=100./94.08;##multiplication factor of MgCl2##
M3=100./73.;##multiplication factor of HCl##
M4=100./114.##multiplication factor of Al2(SO4)3##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
print ("We do not take Na2SO4 and Fe2O3 since they do not react with lime/soda");
V=25000.;##volume of water in litres##
L=0.74*(P1+P2+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P2+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.37##
import math
Purity_Lime=.80
Purity_soda=.90
W1=7.1;##amount of Mg(HCO3)2 in ppm##
W2=8.1;##amount of Ca(HCO3)2 in ppm##
W3=4.2;##amount of MgCO3 in ppm##
W4=10.;##amount of CaCO3 in ppm##
M1=100./142.;##multiplication factor of Mg(HCO3)2##
M2=100./162.;##multiplication factor of Ca(HCO3)2##
M3=100./84.;##multiplication factor of MgCO3##
M4=100./100.##multiplication factor of CaCO3##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##L
V=100000.;##volume of water in litres##
L=0.74*(P1*2.+P2+P3*2+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(0.)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.38##
import math
Purity_Lime=.85
Purity_soda=.90
W1=95.;##amount of MgCl2 in ppm##
W2=272.;##amount of CaSO4 in ppm##
W3=120.;##amount of MgSO4 in ppm##
W4=49.;##amount of CaSO4 in ppm##
W5=4.;##amount of SiO2 in ppm##
M1=100./95.;##multiplication factor of CaCO3##
M2=100./136.;##multiplication factor of MgCl2##
M3=100./120.;##multiplication factor of HCl##
M4=100./98.##multiplication factor of Al2(SO4)3##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
print ("We do not take SiO2 since it does not react with lime/soda");
V=10000.;##volume of water in litres##
L=0.74*(P1+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P1+P2+P3)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.39##
import math
Purity_Lime=.90
Purity_soda=1.
W1=136.;##amount of CaSO4 in ppm##
W2=49.;##amount of H2SO4 in ppm##
W3=95.;##amount of MgCl2 in ppm##
W4=60.;##amount of MgSO4 in ppm##
W5=50.;##amount of SiO2 in ppm##
M1=100./136.;##multiplication factor of CaSO4##
M2=100./98.;##multiplication factor of H2SO4##
M3=100./95.;##multiplication factor of MgCl2##
M4=100./120.##multiplication factor of MgSO4##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##S
print ("We do not take SiO2 since it does not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P2)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nQuantity of Lime required is ",L," kg");
S=1.06*(P1+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nQuantity of Soda required is ",S," kg")
##water and its treatment##
##example 2.18.40##
import math
Purity_Lime=.74
Purity_soda=.90
W1=73.;##amount of Mg(HCO3)2 in ppm##
W2=120.;##amount of MgSO4 in ppm##
W3=22.2;##amount of CaCl2 in ppm##
W4=164.;##amount of Ca(NO3)3 in ppm##
W5=15.;##amount of SiO2 in ppm##
M1=100./146.;##multiplication factor of Mg(HCO3)2##
M2=100./120.;##multiplication factor of MgSO4##
M3=100./111.;##multiplication factor of CaCl2##
M4=100./164.##multiplication factor of Ca(NO3)2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##S
P4=W4*M4;##in terms of CaCO3##S
print ("We do not take SiO2 since it does not react with lime/soda");
V=5000.;##volume of water in litres##
L=0.74*(P1*2.+P2)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P2+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.41##
import math
Purity_Lime=.85
Purity_soda=.90
W1=95.;##amount of MgCl2 in ppm##
W2=272.;##amount of CaSO4 in ppm##
W3=120.;##amount of MgSO4 in ppm##
W4=49.;##amount of H2SO4 in ppm##
W5=4.;##amount of SiO2 in ppm##
M1=100./95.;##multiplication factor of MgCl2##
M2=100./136.;##multiplication factor of CaSO4##
M3=100./120.;##multiplication factor of MgSO4##
M4=100./98.##multiplication factor of H2SO4##
P1=W1*M1;##in terms of CaCO3##L+S
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
print("We do not take SiO2 since it does not react with lime/soda");
V=10000.;##volume of water in litres##
L=0.74*(P1+P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P1+P2+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.42##
import math
W1=10.;##amount of CaCO3 in ppm##
W2=14.6;##amount of Mg(HCO3)2 in ppm##
W3=4.4;##amount of CO2 in ppm##
W4=22.2;##amount of CaCl2 in ppm##
W5=9.5;##amount of MgCl2 in ppm##
W6=2.8;##amount of SiO2 in ppm##
M1=100./100.;##multiplication factor of CaCO3##
M2=100./146.;##multiplication factor of Mg(HCO3)2##
M3=100./44.;##multiplication factor of CO2##
M4=100./111.##multiplication factor of CaCl2##
M5=100./95.;##multiplication factor of MgCl2/
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##S
P5=W5*M5;##in terms of CaCO3##L+S
print ("We do not take SiO2 since it does not react with lime/soda");
V=50000.;##volume of water in litres##
L=0.74*(P1+P2+P3+P5)*V;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P4+P5)*V;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.43##
import math
Purity_Lime=.92
Purity_soda=.95
W1=68.2;##amount of CaCO3 in ppm##
W2=29.6;##amount of Mg(NO3)2 in ppm##
W3=58.4;##amount of Mg(HCO3)2 in ppm##
W4=36.;##amount of MgSO4 in ppm##
W5=95.;##amount of MgCl2 in ppm##
W6=27.2;##amount of CaSO4 in ppm##
W7=19.3;##amount of Fe2O3 in ppm##
M1=100./100.;##multiplication factor of CaCO3##
M2=100./148.;##multiplication factor of Mg(NO3)2##
M3=100./146.;##multiplication factor of Mg(HCO3)2##
M4=100./120.##multiplication factor of MgSO4##
M5=100./95.;##multiplication factor of MgCl2##
M6=100./136.;##multiplication factor of CaSO4##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##S
P3=W3*M3;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L+S
P6=W6*M6;##in terms of CaCO3##S
print("We do not take Fe2O3 since it does not react with lime/soda");
V=15000.;##volume of water in litres##
L=0.74*(P1+P3+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P2+P4+P5+P6)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.44##
import math
Purity_Lime=.85
Purity_soda=.95
W1=49.95;##amount of CaCl2 in ppm##
W2=42.;##amount of MgSO4 in ppm##
W3=12.6;##amount of NaHCO3 in ppm##
W4=10.;##amount of SiO2 in ppm##
W5=500.;##amount of NaCl in ppm##
W6=51.1;##amount of Mg(HCO3)2 in ppm##
W7=3.;##amount of CO2 in ppm##
W8=3.;##amount of Fe2+ in ppm##
W9=15.;##amount of AlCl3 in ppm##
M1=100./111.;##multiplication factor of CaCl2##
M2=100./120.;##multiplication factor of MgSO4##
M6=100./146.;##multiplication factor of Mg(HCO3)2##
M7=100./44.3##multiplication factor of CO2##
M8=100./55.;##multiplication factor of Fe2+##
M9=100./133.5##multiplication factor of AlCl3##
P1=W1*M1;##in terms of CaCO3##S
P2=W2*M2;##in terms of CaCO3##L+S
P6=W6*M6;##in terms of CaCO3##L
P7=W7*M7;##in terms of CaCO3##L
P8=W8*M8;##in terms of CaCO3##L+S
P9=W9*M9;##in terms of CaCO3##L+S
print ("We do not take NaHCO3, NaCl and Mg(HCO3)2 since they do not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P2+P6*2+P7+P8+P9)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P1+P2+P8+P9)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.44.A##
import math
Purity_Lime=.90
Purity_soda=.90
W1=146.;##amount of Mg(HCO3)2 in ppm##
W2=81.;##amount of Ca(HCO3)2 in ppm##
W3=15.;##amount of Na2SO4 in ppm##
W4=95.;##amount of MgCl2 in ppm##
W5=111.;##amount of CaCl2 in ppm##
W6=10.;##amount of SiO2 in ppm##
M1=100./146.;##multiplication factor of Mg(HCO3)2##
M2=100./162.7;##multiplication factor of Ca(HCO3)2##
M4=100./95.07;##multiplication factor of MgCl2##
M5=100./111.##multiplication factor of CaCl2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L+S
print("We do not take Na2SO4 and SiO2 since they do not react with lime/soda");
V=100000.;##volume of water in litres##
L=0.74*(P1+P2*2+P4+P5)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P4+P5)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.44.B##
import math
Purity_Lime=.85
Purity_soda=.90
W1=16.2;##amount of Ca(HCO3)2 in ppm##
W2=6.8;##amount of CaSO4 in ppm##
W3=11.1;##amount of CaCl2 in ppm##
W4=6;##amount of MgSO4 in ppm##
W5=8.4;##amount of Mg(HCO3)2 in ppm##
W6=8.;##amount of SiO2 in ppm##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./136.;##multiplication factor of CaSO4##
M3=100./111.;##multiplication factor of CaCl2##
M4=100./120.##multiplication factor of MgSO4##
M5=100./146.##multiplication factor of Mg(HCO3)2##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L+S
P3=W3*M3;##in terms of CaCO3##L+S
P4=W4*M4;##in terms of CaCO3##L+S
P5=W5*M5;##in terms of CaCO3##L
print ("We do not take SiO2 since it does not react with lime/soda");
V=1000000.;##volume of water in litres##
L=0.74*(P1+P4+P5*2.)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P2+P3+P4)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.44.C##
import math
Purity_Lime=.90
Purity_soda=.95
W1=81.;##amount of Ca(HCO3)2 in ppm##
W2=42.;##amount of MgCO3 in ppm##
W3=4.1;##amount of NaAlO2 in ppm##
W4=3.65;##amount of HCl in ppm##
W5=82.;##amount of Ca(NO3)2 in ppm##
W6=4.5;##amount of NaCl in ppm##
M1=100./162.;##multiplication factor of Ca(HCO3)2##
M2=100./84.;##multiplication factor of MgCO3##
M3=100./82.;##multiplication factor of NaAlO2##
M4=100./36.5##multiplication factor of HCl##
P1=W1*M1;##in terms of CaCO3##L
P2=W2*M2;##in terms of CaCO3##L
P3=W3*M3;##in terms of CaCO3##-L-S
P4=W4*M4;##in terms of CaCO3##L+S
print ("We do not take Ca(NO3)2 and NaCl since they do not react with lime/soda");
V=20000.;##volume of water in litres##
L=0.74*(P1+P2*2.-P3+P4)*V/Purity_Lime;##lime required in mg##
L=L/10**6;
print'%s %.2f %s'%("\nLime required is ",L," kg");
S=1.06*(P4-P3)*V/Purity_soda;##soda required in mg##
S=S/10**6;
print'%s %.2f %s'%("\nSoda required is ",S," kg")
##water and its treatment##
##example 2.18.44.D##
import math
volume_hardwater=7000.##in litres##
volume_NaCl=60.##Volume of NaCl in litres##
conc_NaCl=10.##% NaCl consumed by zeolite bed##
Wt_per_Litre=conc_NaCl*10.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent," gms");
print'%s %.2f %s'%("\nHardness of water is ",Hardness,"ppm");
##water and its treatment##
##example 2.18.45##
import math
Hardness=250.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=50.##Volume of NaCl##
conc_NaCl=15.##% NaCl consumed by zeolite bed##
Wt_per_Litre=conc_NaCl*10.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent*1000," mgs");
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.46##
import math
volume_hardwater=5000.##in litres##
H=250.##Hardness of water(mg/lit) or ppm##
Hardness=H/1000.##Hardness of water(gms/lit)##
CaCO3_equivalent=volume_hardwater*Hardness##in terms of (gms/lit)##
conc_NaCl=10.##% NaCl consumed by zeolite bed##
Wt_per_Litre=conc_NaCl*10.##gms NaCl consumed by zeolite bed per litre##
total_wt=CaCO3_equivalent*58.5/50.##total gms NaCl consumed by zeolite bed##
volume_NaCl=total_wt/Wt_per_Litre##in litres##
print'%s %.2f %s'%("\nVolume of NaCl solution required is ",volume_NaCl," litres");
##water and its treatment##
##example 2.18.47##
import math
volume_hardwater=20.##in litres##
H=375.##Hardness of water(mg/lit) or ppm##
CaCO3_equivalent=volume_hardwater*H##in terms of (gms/lit)##
conc_NaCl=20.##% NaCl consumed by zeolite bed##
Wt_per_Litre=conc_NaCl*10.##gms NaCl consumed by zeolite bed per litre##
total_wt=CaCO3_equivalent*58.5/50.##total gms NaCl consumed by zeolite bed##
volume_NaCl=total_wt/Wt_per_Litre##in litres##
print'%s %.2f %s'%("\nVolume of NaCl solution required is ",volume_NaCl," litres");
##water and its treatment##
##example 2.18.48##
import math
volume_hardwater=25000.##in litres##
volume_NaCl=200.##Volume of NaCl##
Wt_per_Litre=20.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nHardness of water sample is ",Hardness," ppm");
##water and its treatment##
##example 2.18.49##
import math
volume_hardwater=10**4##in litres##
volume_NaCl=80.##Volume of NaCl##
conc_NaCl=1000.##mg NaCl consumed by zeolite bed per litre##
Wt_per_Litre=conc_NaCl/1000.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent*1000," mg");
print'%s %.2f %s'%("\nHardness of water is ",Hardness," mg/lit");
##water and its treatment##
##example 2.18.50##
import math
volume_hardwater=75000.##in litres##
volume_NaCl=117.##Volume of NaCl in litres##
conc_NaCl=1500.##mg NaCl consumed by zeolite bed per litre##
Wt_per_Litre=conc_NaCl/1000.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent*10000," mg");
print'%s %.2f %s'%("\nHardness of water is ",Hardness," ppm");
##water and its treatment##
##example 2.18.51##
import math
Hardness=600.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=300.##Volume of NaCl##
Wt_per_Litre=75.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent*1000," mgs");
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.52##
import math
Hardness=50.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=100.##Volume of NaCl##
conc_NaCl=1200.##mgs NaCl consumed by zeolite bed per litre##
Wt_per_Litre=conc_NaCl/1000.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent*1000," mgs");
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.53##
import math
volume_hardwater=75000.##in litres##
volume_NaCl=1500.##Volume of NaCl in litres##
conc_NaCl=117.##mgs NaCl consumed by zeolite bed per litre##
Wt_per_Litre=conc_NaCl/1000.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nHardness of water is ",Hardness," ppm or mg/lit");
##water and its treatment##
##example 2.18.54##
import math
Hardness=500.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=1000.##Volume of NaCl##
Wt_per_Litre=100.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.55##
import math
Hardness=450.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=150.##Volume of NaCl##
Wt_per_Litre=50.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.505##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.56##
import math
Hardness=300.##Hardness of water(mg/lit) or ppm##
H=Hardness/1000.##Hardness of water(gms/lit)##
volume_NaCl=75.##Volume of NaCl##
Wt_per_Litre=75.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.595##in terms of (gms/lit)##
volume_hardwater=CaCO3_equivalent/H
print'%s %.2f %s'%("\nQuantity of water softened using zeolite bed is ",volume_hardwater," litres");
##water and its treatment##
##example 2.18.57##
import math
volume_hardwater=800.##in litres##
volume_NaCl=40.##Volume of NaCl in litres##
Wt_per_Litre=110.##gms NaCl consumed by zeolite bed per litre##
total_wt=Wt_per_Litre*volume_NaCl##total gms NaCl consumed by zeolite bed##
CaCO3_equivalent=total_wt*50./58.5##in terms of (gms/lit)##
H=CaCO3_equivalent/volume_hardwater##Hardness of water(gms/lit)##
Hardness=H*1000.##Hardness of water(mg/lit) or ppm##
print'%s %.2f %s'%("\nCaCO3 equivalent is ",CaCO3_equivalent," gms");
print'%s %.2f %s'%("\nHardness of water is ",Hardness," ppm");