diff options
author | debashisdeb | 2014-06-20 15:42:42 +0530 |
---|---|---|
committer | debashisdeb | 2014-06-20 15:42:42 +0530 |
commit | 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (patch) | |
tree | f54eab21dd3d725d64a495fcd47c00d37abed004 /Thermodynamics:_A_Core_Course | |
parent | a78126bbe4443e9526a64df9d8245c4af8843044 (diff) | |
download | Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.gz Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.bz2 Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.zip |
removing problem statements
Diffstat (limited to 'Thermodynamics:_A_Core_Course')
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH2.ipynb | 11 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH3.ipynb | 113 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH4.ipynb | 15 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH5.ipynb | 210 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH6.ipynb | 82 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH7.ipynb | 66 |
6 files changed, 0 insertions, 497 deletions
diff --git a/Thermodynamics:_A_Core_Course/CH2.ipynb b/Thermodynamics:_A_Core_Course/CH2.ipynb index 981cbdd9..1adc4757 100644 --- a/Thermodynamics:_A_Core_Course/CH2.ipynb +++ b/Thermodynamics:_A_Core_Course/CH2.ipynb @@ -27,21 +27,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 2.1\n",
- "#Find out molar constant pressure heat capacity\n",
- "#Variable Declaration\n",
"m=25.0 \t\t\t\t#weight of water vapour [grams]\n",
"w=18.0 \t\t\t\t#molecular weight of water vapour [grams/mol]\n",
"T=9.69 \t\t\t\t#increase in temperature [K]\n",
"Qp=0.45 \t\t\t#heat supplied at constant pressure[KJ]\n",
- "#To find the molar constant pressure specific heat\n",
"\n",
- "#Calculation\n",
"n=m/w \t\t\t\t#no. of moles of water vapour\n",
"Cp=Qp/(n*T) \t\t\t#specific heat capacity at constant pressure[KJ]\n",
"Cp=Cp*1000\t\t\t#specific heat capacity at constant pressure[J]\n",
"\n",
- "#Result\n",
"print\"The specific heat capacity at constant pressure =\",round(Cp,2),\"J K^-1 mol^-1\""
],
"language": "python",
@@ -69,20 +63,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 2.2\n",
- "#To find the minimum work of compression \n",
"import math\n",
- "#Variable declaration\n",
"m=16.0 \t\t\t\t#weight of oxygen [grams]\n",
"w=32.0 \t\t\t\t#molecular weight of oxygen [grams/mol]\n",
"T=300.0 \t\t\t\t#Temperature during compression [K]\n",
"P1=1.0 \t\t\t\t#initial pressure of process [atm]\n",
"P2=100.0 \t\t\t\t#final pressure of process[atm]\n",
"R=8.314 \t\t\t#Universal gas constant [J/K/mol]\n",
- "#Calculation\t\n",
"n=m/w \t\t\t\t#no. of moles of oxygen\n",
"W=-n*R*T*math.log(P1/P2) \n",
- "#Result\n",
"print\"Mininmum work done to compress oxygen =\",round(W),\"J(approx)\""
],
"language": "python",
diff --git a/Thermodynamics:_A_Core_Course/CH3.ipynb b/Thermodynamics:_A_Core_Course/CH3.ipynb index b72e6afa..fa64788f 100644 --- a/Thermodynamics:_A_Core_Course/CH3.ipynb +++ b/Thermodynamics:_A_Core_Course/CH3.ipynb @@ -27,17 +27,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.1\n",
- "#to find energy transfered in form of heat:\n",
- "#Variable declaration\n",
"V1=14 \t\t\t\t#initial volume of cylinder in m3\n",
"V2=9 \t\t\t\t#final volume of cylinder in m3\n",
"P=2000 \t\t\t\t#pressure during the operation in N/m2\n",
"U=(-6000) \t\t\t#internal energy of the system in J\n",
- "#Calculation\t\n",
"W=-P*(V2-V1) \t\t\t#work done during the operation in J\n",
"Q=U-W \t\t\t\t#energy tranfered in form of heat in J\n",
- "#Result\n",
"print\"energy tranfered in form of heat is\",Q,\"J\"\n",
" "
],
@@ -66,19 +61,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.2\n",
- "#to find the heat lost or gained by the system:\n",
- "#Variable declaration\n",
"R=8.314 \t\t\t\t#universal gas constant [J/K/mol]\n",
"T=300\t\t\t\t\t#temperture for the process [K]\n",
"U=0 \t\t\t\t\t#change in internal energy [J]\n",
"V1=2.28 \t\t\t\t#initial volume [m3]\n",
"V2=4.56 \t\t\t\t#final volume[m3]\n",
- "#Calculation\n",
"import math\n",
"W=2.303*R*T*math.log10(V2/V1) \t\t#work done during the process[J]\n",
"Q=W \t\t\t\t\t#heat lost or gained by the system[J]\n",
- "#Result\n",
"print\"The heat gained by the system is\",round(Q),\"J mol^-1\""
],
"language": "python",
@@ -106,19 +96,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.3\n",
"\n",
- "#to find Q,W,U for 1 mole of bromine vaporizes\n",
- "#Variable declaration\n",
- "#given:\n",
"H=29.2 \t\t\t\t\t#latent heat of vaporisation[KJ/mol]\n",
"T=332 \t\t\t\t\t#temperature of the system[K]\n",
"R=8.314 \t\t\t\t#universal gas constant [J/K/mol]\n",
- "#Calculation\n",
"Qp=H \t\t\t\t\t#at constant pressure [KJ]\n",
"W=-R*0.001*T \t\t\t\t#workdone [KJ]\n",
"U=Qp+W \t\t\t\t\t#change in internal energy[KJ]\n",
- "#Result\n",
"print\"Heat absorbed by the bromine vapours is\",Qp,\"KJ\"\n",
"print\"\\nWorkdone during the process is\",round(W,2),\"KJ\"\n",
"print\"\\nChange in internal energy of the system is\",round(U,2),\"KJ\"\n"
@@ -152,19 +136,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.4\n",
- "#to find change in enthalpy of the process:\n",
"\n",
- "#variable declaration\n",
"print\"C7H16(l) + 11O2(g) -> 7CO2(g) + 8H2O(l)\" \n",
"n=-4 \t\t\t\t#change in no. of moles when reaction proceeds from reactants to \t\t\t\tproducts\n",
"T=298 \t\t\t\t#temperature of the process [K]\n",
"R=8.314 \t\t\t#universal gas constant [J/K/mol]\n",
"Qv=-4800 \t\t\t#heat energy at constant volume [KJ]\n",
- "#Calculation\t\n",
"U=Qv \t\t\t\t#change in internal energy of system [KJ]\n",
"H=U+n*R*0.001*T \t\t#change in enthalpy of the system[KJ]\n",
- "#Result\n",
"print\"the change in enthalpy of system is\",round(H,2),\"kJ\"\n"
],
"language": "python",
@@ -193,19 +172,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.5\n",
- "#to find the Q,W,H\n",
- "#Variable declaration\n",
"n=1 \t\t\t\t#number of moles of an given ideal gas\n",
"T=298 \t\t\t\t#temperature for the process[K]\n",
"V1=8.3 \t\t\t\t#initial volume of the ideal gas[m3]\n",
"V2=16.8 \t\t\t#final volume of the ideal gas[m3]\n",
"R=8.314 \t\t\t#universal gas constant[J#K#mol]\n",
"import math\n",
- "#Calculation\n",
"W=-2.303*R*T*math.log10(V2/V1) #[J]\n",
"Q=-W \t\t\t\t#[J]\n",
- "#Result\n",
"print\"H=U+PV ,where U is change in internal energy which is zero due to isothermal process\" \n",
"print\"PV where V is change in volume of system ,PV=RT & RT==0 since T i.e change in temp is zero for system\" \n",
"print\"Therefore,the change in enthalpy is 0J\" \n",
@@ -242,19 +216,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.6\n",
"\n",
- "##to find the change in enthalpy(H) of water \n",
- "#Variable declaration\n",
"T1=323 \t\t\t#intial temperature of water[K]\n",
"T2=373 \t\t\t#final temperature of water[K]\n",
"Cp=75.29 \t\t#specific heat of water[J/K/mol]\n",
"w=100.0 \t\t\t#weight of water[g]\n",
"mol_wt=18.0 \t\t#molecular weight of water[g/mol]\n",
- "#Calculation\t\n",
"n=w/mol_wt \t\t#no. of moles of water[moles]\n",
"H=(n*Cp*(T2-T1))*0.001 \t#change in enthalpy of water[J]\n",
- "#Result\n",
"print\"The change in enthalpy of water is\",round(H,2),\"kJ\"\n"
],
"language": "python",
@@ -282,17 +251,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.7\n",
- "#to find the change in enthalpy of \treaction(H)\n",
"print\"SO2 + 0.5O2 -> SO3\"\n",
- "#Variable declaration\n",
"U=-97030 \t\t\t#heat of reaction[J]\n",
"n=1-(1+0.5) \t\t\t#change in no. of moles \n",
"R=8.314 \t\t\t#universal gas constant[J/K/mol]\n",
"T=298 \t\t\t\t#temperature during the reaction[K]\n",
- "#Calculation\t\n",
"H=U+n*R*T \t\t\t#change inenthalpy of reaction[J]\n",
- "#result\n",
"print\"The change in enthalpy of reaction is\",round(H),\"J(approx)\"\n"
],
"language": "python",
@@ -321,30 +285,22 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.8\n",
- "#to find the change in internal energy (U) of given reaction\n",
"print\"i.C(s) + O2(g) -> CO2(g)\"\n",
- "#Variable declaration\n",
"H1=-393.5 \t\t#change in enthalpy [KJ/mol]\n",
"T1=298 \t\t\t#temperature [K]\n",
"n1=0 \t\t\t#change in no. of moles in reaction moving in forward direction\n",
"R=0.008314 \t\t#universal gas constant [KJ/K/mol]\n",
"\n",
- "#Calculation\t\n",
"U1=H1-n1*R*T1 \t\t#change in internal energy [KJ]\n",
"print\"The change in internal energy is\",round(U1,1),\"KJ/mol\"\n",
"\n",
- "#to find the change in internal energy (U) of given reaction\n",
"print\"ii.C(s) + 0.5O2 -> CO(g)\" \n",
- "#Variable declaration\n",
"H2=-110.5 \t\t#change in enthalpy[KJ/mol]\n",
"T2=298 \t\t\t#temperature[K]\n",
"n2=1-0.5 \t\t#change in no. of moles in reaction moving in forward direction\n",
"R=0.008314 \t\t#universal gas constant [KJ/K/mol]\n",
"\n",
- "#Calculation\n",
"U2=H2-n2*R*T2 \t\t#change in internal energy [KJ]\n",
- "#result\n",
"print\"The change in internal energy is\",round(U2,3),\"KJ/mol\""
],
"language": "python",
@@ -375,17 +331,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.9\n",
- "#to find the standard heat of rxn for combustion of 1 mole of C6H6\n",
"print\"The standard heat of combustion of\"\n",
"print\"2C6H6(l)+ 15O2(g)-> 12 CO2(g)+ 6 H2O(l)\" \n",
"print\"H1(standard heat of combustion)=-6536 KJ/mol\" \n",
- "#Variable declaration\n",
"H1=-6536 \t\t\t#standard heat of combustion [KJ/mol]\n",
- "#Calculation\t\n",
"print\"C6H6(l)+ 7.5 O2(g)-> 6 CO2(g)+ 6 H2O(l)\" \n",
"H2=H1/2 \t\t\t#standard heat of combustion[KJ/mol]\n",
- "#Result\n",
"print\"H2(standard heat of combustion for 1 mole of C6H6)=\",H2,\"kJ/mol\"\n"
],
"language": "python",
@@ -417,14 +368,9 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.10\n",
- "#to find the standard heat of formation of one mole of product\n",
"print\"N2(g)+3H2(g)-> 2NH3(g)\" \n",
- "#Variable declaration\n",
"H=-92.22 \t\t\t#standard heat of reaction [KJ/mol]\n",
- "#Calculation\n",
"H1=H/2 \t\t\t\t#standard heat of formation of 1 mole [KJ/mol]\n",
- "#Result\n",
"print\"H(heat of formation of 1 mole of product)=\",H1,\"kJ mol^-1\"\n"
],
"language": "python",
@@ -453,19 +399,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.11\n",
"\n",
- "#to find the standard heat of reaction\n",
"print\"C2H5OH(l)+3O2(g)->2CO2(g)+3H2O(l)\" \n",
- "#Variable declaration\n",
"T=298 \t\t\t\t#temperature during the reaction[K]\n",
"Hw=-285.83 \t\t\t#standard heat of formation of liquid water [KJ/mol]\n",
"He=-277.69 \t\t\t#standard heat of formation of liquid ethanol[KJ/mol]\n",
"Hco2=-393.51 \t\t\t#standard heat of formation of carbon dioxide[KJ/mol]\n",
"Ho2=0 \t\t\t\t#standard heat of formation of oxygen gas[KJ/mol]\n",
- "#Calculation\t\n",
"H=2*Hco2+3*Hw-He-3*Ho2 \t\t#standard heat of reaction\n",
- "#Result\n",
"print\"H(standard heat of reaction)=\",H,\"kJ\"\n"
],
"language": "python",
@@ -494,19 +435,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.12\n",
"\n",
- "#to find the value of standard heat of formation of CO\n",
"print\"CO(g)+NO(g)->0.5N2(g)+CO2(g)\" \n",
- "#Variable declaration\n",
"Hrxn=-374 \t\t#standard heat of reaction[KJ/mol]\n",
"Hno=90.25 \t\t#standard heat of formation of NO[KJ/mol]\n",
"Hco2=-393.51 \t\t#standard heat of formation of CO2[KJ/mol]\n",
"Hn2=0 \t\t\t#standard heat of formation of N2[KJ/mol]\n",
"T=298 \t\t\t#temperature of reaction [K]\n",
- "#Calculation\n",
"Hco=0.5*Hn2+Hco2-Hno-Hrxn \t#standard heat of formation of CO[KJ/mol]\n",
- "#result\n",
"print\"Hco(standard heat of formation)=\",Hco,\"kJ mol^-1\""
],
"language": "python",
@@ -535,24 +471,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.13\n",
- "#to find the heat of combustion and formation of propylene\n",
"\n",
- "#Variable declaration\n",
- "#(\"C3H6(g)+H2(g)->C3H8(g) H1=-29.6 Kcal\") \n",
- "#(\"C3H8(g)+5O2(g)->3CO2(g)+4H2O(l) H2=-530.6 Kcal\") \n",
- "#(\"C(s)+O2(g)->CO2(g) H3=-94.0 Kcal\") \n",
- "#(\"H2(g)+0.5O2(g)->H2O(l) H4=-68.3 Kcal. \") \n",
"H1=-29.6 \t\t#the standard heat of hydrogenation of gaseous propylene to propane[Kcal]\n",
"H2=-530.6 \t\t#the heat of combustion of propane[Kcal] \n",
"H3=-94.0 \t\t#the heat of formation of carbon dioxide[Kcal]\n",
"H4=-68.3 \t\t#the heat of formation of liquid water[Kcal]\n",
"\n",
- "#Calculation\n",
"\n",
"print\"C3H6(g)+4.5O2(g)->3CO2(g)+3H2O(l)\" \n",
"H5=(3*H3+4*H4)-(H1+H2)#[Kcal]\n",
- "#Result\n",
"print\"\\n H(standard heat of combustion)=\",H5,\"Kcal\"\n",
"print\"3C(s)+3H2(g)->C3H6(g)\" \n",
"H6=-H5+3*H3+3*H4 #[Kcal]\n",
@@ -588,18 +515,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.14\n",
"\n",
- "#to find the heat of formation of N2O5\n",
- "#Variable declaration\n",
"H1=-114.1 \t\t\t#standard heat of reaction:2NO(g)+O2(g)->2NO2(g) [KJ/mol]\n",
"H2=-110.2 \t\t\t#standard heat of reaction:4NO2(g)+O2(g)->2N2O5(g) [KJ/mol]\n",
"H3=180.5 \t\t\t#standard heat of reaction:N2(g)+O2(g)->2NO(g) [KJ/mol]\n",
"\n",
"\t#reacton:N2(g)+2.5O2(g)->N2O5(g)\n",
- "#Calculation\n",
"H4=(2*H1+H2+2*H3)/2 \t\t#standard heat of formation of N2O5[KJ/mol]\n",
- "#Result\n",
"print\"H(standard heat of formation of N2O5)=\",H4,\"kJ/mol\" "
],
"language": "python",
@@ -627,17 +549,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.15\n",
- "#to find the standard heat of formaton of solid sucrose\n",
- "#Variable declaration\n",
"Hc=-5645 \t\t#standard enthalpy of combustion of \t\t\treaction:C12H22O11(s)+12O2(g)->12CO2(g)+11H2O(l) [KJ/mol]\n",
"Hf1=-393.51 \t\t#standard heat of formation of CO2: C(s)+O2(g)->CO2(g) [KJ/mol]\n",
"Hf2=-285.83 \t\t#standard heat of formation of H2O: H2(g)+0.5O2(g)->H2O(l) [KJ/mol]\n",
"\n",
- "#Calculation\n",
"\t#reaction:12C(s)+11H2(g)+5.5O2(g)->C12H22O11(s)\n",
"Hf=12*Hf1+11*Hf2-Hc \t#[KJ/mol]\n",
- "#Result\n",
"print\"Hf(standard heat of formation of solid sucrose)=\",Hf,\"KJ/mol(approx)\""
],
"language": "python",
@@ -665,10 +582,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.16\n",
"\n",
- "#to find the standard heat of formation of NH3 at 400K for same reaction\n",
- "#Variable declaration\n",
"Hf1=-46.11 \t\t\t#standard heat of formation of NH3 at 298K \t\t\t\t#reaction:0.5N2(g)+1.5H2(g)->NH3(g) [KJ/mol]\n",
"Cp1=29.125 \t\t\t#molar heat capacity at constant pressure for N2(g)[J/K/mol]\n",
"Cp2=28.824 \t\t\t#molar heat capacity at constant pressure for H2(g)[J/K/mol]\n",
@@ -676,12 +590,10 @@ "T1=298 \t\t\t\t#initial temperature[K]\n",
"T2=400 \t\t\t\t#final temperature[K]\n",
"\n",
- "#Calculation\n",
"\t\n",
"Cp=Cp3-0.5*Cp1-1.5*Cp2 \t\t#[J/K/mol]\n",
"T=T2-T1 \t\t\t#[K]\n",
"Hf2=Hf1+Cp*0.001*T \t\t#standard heat of formation for NH3 at 400K[KJ/mol]\n",
- "#result\n",
"print\"\\n Hf2(standard heat of formation for NH3 at 400K =\",round(Hf2,3),\"kJ/mol\""
],
"language": "python",
@@ -710,11 +622,9 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Calculate heat of formation of H2O\n",
"\n",
"from scipy.optimize import fsolve\n",
"from scipy import integrate\n",
- "#Variable declaration\n",
"dH_298=-241.82 #Std Heat of formation at 298 K [kJ mol^-1]\n",
"dH_298=dH_298*1000 # in [J mol^-1]\n",
"T1=298 #[K]\n",
@@ -732,7 +642,6 @@ "dH_1273=dH_1273/1000\n",
"print\"Heat of formation of H2O(g) at 1000 C=\",round(dH_1273,1),\"kJ mol^-1 (APPROXIMATE)\"\n",
"\n",
- "#NOTE\n",
"print\"NOTE:\"\n",
"print\"Slight variation in answer,because integration is not done precisely in the book\"\n",
"print\"In the book,it is written as:-7497.46 instead of -7504.3\""
@@ -765,16 +674,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.18\n",
- "#to find the C-H bond energy of CH4 from the above bond energies\n",
- "#Variable declaration\n",
"H1=435.0 \t\t\t#bond dissociation energy for: CH4->CH3+H [KJ/mol]\n",
"H2=364.0 \t\t\t#bond dissociation energy for:CH3->CH2+H [KJ/mol]\n",
"H3=385.0 \t\t\t#bond dissociation energy for:CH2->CH+H [KJ/mol] \n",
"H4=335.0 \t\t\t#bond dissociation energy for:CH->C+H [KJ/mol]\n",
- "#Calculation\t\n",
"H=(H1+H2+H3+H4)/4 \t#the bond energy for C-H bond in CH4 [KJ/mol]\n",
- "#Result\n",
"print\"\\n H(the C-H bond energy in CH4)=\",round(H,1),\"kJ/mol\"\n"
],
"language": "python",
@@ -803,20 +707,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.19\n",
"\n",
- "#to find the C-C bond energy in ethane bond\n",
- "#Variable declaration\n",
"H1=-84.68 \t\t\t#heat of formation : 2C(s)+3H2(g)->C2H6(g) [KJ/mol]\n",
"H2=2*716.68 \t\t\t#heat of formation : 2C(s)->2C(g) [KJ]\n",
"H3=3*436 \t\t\t#heat of formation : 3H2(g)->6H(g) [KJ]\n",
"H4=412 \t\t\t\t#taking it as bond energy for one C-H bond[KJ/mol]\n",
"\n",
- "#Calculation\n",
"\n",
"H=H2+H3-H1 \t\t\t#heat of reaction : C2H6(g)->2C(g)+6H(g) [KJ/mol]\n",
"H5=H-6*H4 \t\t\t#bond energy for one C-C bond in ethane bond [KJ/mol]\n",
- "#Result\n",
"print\"\\n Hc-c(bond energy for one C-C bond in ethane bond)=\",H5,\"kJ/mol\"\n"
],
"language": "python",
@@ -845,9 +744,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 3.20\n",
- "#to find the lattice enthalpy of magnesium bromide\n",
- "#Variable declaration\n",
"\t#MgBr2(s)-->Mg(s)+Br2(l)-->Mg(g)+Br2(l)-->Mg(g)+Br2(g)-->Mg(g)+2Br(g)-->Mg+2(g) + 2e(g) + \t2Br(g)-->Mg+2(g) + 2Br-(g)\n",
"H1=-524 \t\t#enthalpy of formation of MgBr2(s) from its element [KJ/mol]\n",
"H2=148 \t\t\t#enthalpy of sublimation of Mg(s) [KJ/mol]\n",
@@ -856,9 +752,7 @@ "H5=2187 \t\t#enthalpy of ionization of Mg(g) to Mg+2(g) [KJ/mol]\n",
"H6=-650 \t\t#enthalpy of formation of Br-(g) [KJ/mol]\n",
"\n",
- "#calculation\n",
"H=-H1+H2+H3+H4+H5+H6 \t#lattice enthalpy [KJ/mol]\n",
- "#Result\n",
"print\"\\n H(lattice enthalpy of magnesium bromide)=\",H,\"kJ/mol\"\n"
],
"language": "python",
@@ -887,24 +781,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Calculate maximum flame temperature\n",
"\n",
"from scipy.optimize import fsolve\n",
"from scipy import integrate\n",
"\n",
- "#Variable declaration\n",
"\n",
- "#CH4(g)+2*O2(g)--->CO2(g)+2*H2O(l)\n",
"dH1_298=-881.25 #[kJ/mol]\n",
- "#H2O(l)-->H2O(g)\n",
"dH2_298=43.60 #[kJ/mol]\n",
- "#2H2O(l)-->2*H2O(g)\n",
"dH3_298=2*dH2_298 #[kJ/mol]\n",
- "#Adding (1) and (3)\n",
"dH4_298=dH1_298+dH3_298 #[kJ/mol]\n",
"dH_heat=-dH4_298*1000 #[J/mol]\n",
"\n",
- "#CALCULATION\n",
"\n",
"def f(T2):\n",
" def g(T):\n",
diff --git a/Thermodynamics:_A_Core_Course/CH4.ipynb b/Thermodynamics:_A_Core_Course/CH4.ipynb index f0aec688..faa2aabc 100644 --- a/Thermodynamics:_A_Core_Course/CH4.ipynb +++ b/Thermodynamics:_A_Core_Course/CH4.ipynb @@ -27,19 +27,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 4.1\n",
"\n",
- "#to find the mass of substance present in liquid and vapour phase \n",
- "#Variable declaration\n",
"M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
"x=0.6 \t\t\t\t#mass fraction for vapour phase \n",
"P=7 \t\t\t\t#pressure [atm]\n",
"T=438 \t\t\t\t#temperature[K]\n",
"\n",
- "#Calculation\n",
"Ml=(1-x)*M \t\t\t#mass fraction of liquid phase[Kg]\n",
"Mg=x*M \t\t\t\t#mass fraction of vapour phase[Kg]\n",
- "#Result\n",
"print\"M(liquid phase)=\",Ml,\"Kg\\nM(vapour phase)=\",Mg,\"Kg\""
],
"language": "python",
@@ -68,10 +63,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 4.2\n",
"\n",
- "#to find the total volume occupied by the mixture \n",
- "#Variable declaration\n",
"Vl=0.0177 \t\t\t#specific volume of saturated liquid[m3/Kg]\n",
"Vg=4.43 \t\t\t#specific volume of saturated vapour[m3/Kg]\n",
"P=7 \t\t\t\t#pressure[atm]\n",
@@ -79,9 +71,7 @@ "x=0.6 \t\t\t\t#fraction of vapour phase\n",
"M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
"\n",
- "#Calculation\n",
"V=((1-x)*Vl+x*Vg)*M \t\t#total volume occupied [m3]\n",
- "#result\n",
"print\"Total volume occupied =\",round(V,2),\"m^3\"\n"
],
"language": "python",
@@ -109,17 +99,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 4.3\n",
"\n",
- "#to find the total internal energy of the mixture\n",
- "#Variable declaration\n",
"M=2.5 \t\t\t\t#mass of a substance[Kg]\n",
"x=0.6 \t\t\t\t#fraction of vapour phase \n",
"Ug=1105.0 \t\t\t#specific internal energy of saturated vapour[J/Kg]\n",
"Ul=298.0 \t\t\t\t#specific internal energy of saturated liquid[J/Kg] \n",
- "#Calculation\n",
"U=M*((1-x)*Ul+x*Ug) \n",
- "#Result\n",
"print\"The total internal energy of the mixture =\",U,\"J\"\n",
"print\"\\nNOTE:In textbook,it is wrongly calculated as 1950 J\"\n",
" "
diff --git a/Thermodynamics:_A_Core_Course/CH5.ipynb b/Thermodynamics:_A_Core_Course/CH5.ipynb index 865af391..2b811195 100644 --- a/Thermodynamics:_A_Core_Course/CH5.ipynb +++ b/Thermodynamics:_A_Core_Course/CH5.ipynb @@ -27,19 +27,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.1\n",
"\n",
- "#to find the workdone , heat rejected , and efficiency of the engine\n",
- "#Variable declaration\n",
"T1=373.0 \t\t\t\t#initial temperature [K]\n",
"T2=573.0 \t\t\t\t#final temperature [K]\n",
"Q2=750.0 \t\t\t\t#Heat absorbed by carnot engine[J]\n",
"\n",
- "#Calculation\n",
"e=(T2-T1)/T2 \t\t\t#efficiency of the engine\n",
"W=e*Q2 \t\t\t\t#Workdone by the engine[J]\n",
"Q1=T1*Q2/T2 \t\t\t#Heat rejected by the engine[J]\n",
- "#Result\n",
"print\"Efficiency of the engine =\",round(e,3) \n",
"print\"\\n Workdone by the engine =\",round(W),\"J\"\n",
"print\"\\n Heat rejected by the engine =\",round(Q1),\"J\"\n"
@@ -73,15 +68,10 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.2\n",
- "#to analyse the efficiency of the engine \n",
"\n",
- "#Variable declaration\n",
"T1=250.0 #temperature of heat rejection[K]\n",
"T2=1000.0 #temperature of heat absorption[K]\n",
- "#Calculation\n",
"e=1-(T1/T2) \n",
- "#Result\n",
"print\"Efficiency of the corresponding carnot engine =\",e,\"or\",e*100,\"%\"\n",
"print\" Therefore , the inventors claim of 80% efficiency is absurd.The patent application should be rejected\" \n"
],
@@ -111,16 +101,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.3\n",
- "#To find the minimum heat required from heat source to yield the above work\n",
- "#Variable declaration\n",
"T1=323.0 \t\t\t\t#temperature [K]\n",
"T2=423.0 \t\t\t\t#temperature [K]\n",
"W=1.3 \t\t\t\t#work [KJ]\n",
- "#Calculation\n",
"e=(T2-T1)/T2 \t\t\t#efficiency\n",
"Q2=W/e \t\t\t\t#minimum heat withdrawal from heat source[KJ]\n",
- "#Result\n",
"print\"Minimum heat withdrawal from heat source=\",round(Q2,2),\"kJ\""
],
"language": "python",
@@ -148,18 +133,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.5\n",
- "#to find the molar entropy change \n",
- "#Variable declaration\n",
"T=298 \t\t\t#Temperature [K]\n",
"n=1 \t\t\t#no. of moles\n",
"V1=500 \t\t\t#initial volume [cm3]\n",
"V2=1000 \t\t#final volume [cm3]\n",
"R=8.314 \t\t#Universal gas constant [J/mol/K]\n",
"import math\n",
- "#Calculation\n",
"S=R*math.log(V2/V1)\t\t#molar entropy change at constant temperature[J/K]\n",
- "#Result\n",
"print\"Molar entropy change of argon =\",round(S,1),\"J/K\"\n"
],
"language": "python",
@@ -187,16 +167,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.6 \n",
"\n",
- "#to find the change in molar entropy when the gas expands isothermally and reversibly\n",
- "#Variable declaration\n",
"W=1728.0 \t\t\t#Isothermal and reversible work done[J/mol]\n",
"T=298.0 \t\t\t#Isothermal temperature[K]\n",
- "#Calculation\n",
"\n",
"S=W/T \t\t\t#change in molar entropy for isothermal and reversible process\n",
- "#result\n",
"print\"The change in molar entropy =\",round(S,1),\"JK^-1mol^-1\"\n"
],
"language": "python",
@@ -224,17 +199,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.7\n",
"\n",
- "#To find the change in entropy of the surroundings at 298K\n",
- "#Variable declaration\n",
"H=-92.22 \t\t\t#Standard reaction enthalpy[KJ]\n",
"T=298 \t\t\t\t#Temperature [K]\n",
"\n",
- "#Calculation\t\n",
"\t#standard reaction enthalpy is H.Therefore, heat gained by the surroundings at 298K is -H\n",
"S=-H*1000/T \t\t\t#Change in entropy[J/K]\n",
- "#Result\n",
"print\"Change in entropy of the surroundings at 298k =\",round(S,1),\"J/K\"\n"
],
"language": "python",
@@ -262,19 +232,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.8\n",
"\n",
- "#To find the change in entropy for argon gas\n",
- "#Variable declaration\n",
"T1=298.0 \t\t\t\t#Initial Temperature[K]\n",
"T2=573.0 \t\t\t\t#Final Temperature[K]\n",
"Cv=29.1 \t\t\t#Specific Heat capacity of argon gas [J/K/mol]\n",
"n=1 \t\t\t\t#no. of moles\n",
"\n",
"import math\n",
- "#calculation\n",
"S=n*Cv*math.log(T2/T1) \t\t#Change in entropy [J/K]\n",
- "#Result\n",
"print\"The change in entropy of the argon gas is\",round(S,2),\"J/K\"\n",
"\n"
],
@@ -303,10 +268,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.9\n",
"\n",
- "#To find the total entropy change of solid\n",
- "#Variable declaration\n",
"T1=276.0 \t\t\t\t#Initial temperature[K]\n",
"Tf=278.7 \t\t\t#Freezing point temperature[K]\n",
"Tb=353.3 \t\t\t#Boiling point temperature[K]\n",
@@ -318,7 +280,6 @@ "mass=200.0\t\t\t#weight of solid benzene[g]\n",
"print\"Cp doesnot change within this temp limit\" \n",
"import math\n",
- "#calculation\n",
"n=mass/mol_wt \t\t\t#no. of moles\n",
"\n",
"S1=n*Cp*math.log(Tf/T1) \t#entropy change in heating [J/K]\n",
@@ -327,7 +288,6 @@ "S4=n*Hv/Tb \t\t\t#entropy change in vaporization[J/K]\n",
"S5=n*Cp*math.log(T2/Tb) \t#entropy change in heating[J/K]\n",
"S=S1+S2+S3+S4+S5 \t\t#total entropy change in heating from 276 to 373K\n",
- "#Result\n",
"print\"Total entropy change in heating 200g benzene from 3 to 100`C is\",round(S,1),\"J/K or\",round(S/1000,3),\"KJ/K\"\n",
"print\"\\nNOTE:In textbook the value of 'n' is wrongly calculated as 25.64 instead of 2.564,SO there is a error in answer shown in book\" "
],
@@ -359,22 +319,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.10\n",
- "#To find the change in entropy of the gas\n",
- "#Isothermal process\n",
- "#Variable declaration\n",
"mass=32 \t\t\t#weight of methane gas[gm]\n",
"P1=6*10**5 \t\t\t#Initial temperature[N/m2]\n",
"P2=3*10**5 \t\t\t#Final pressure[N/m2]\n",
"mol_wt=16 \t\t\t#molecular weight of methane gas[g/mol]\n",
"T=298 \t\t\t\t#Temperature[K]\n",
- "#calculation\t\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"import math\t\n",
"n=mass/mol_wt \t\t\t#no. of moles\n",
"S=n*R*math.log(P1/P2) \t\t#change in entropy of gas[J/K]\n",
"\n",
- "#Result\n",
"print\"The change in entropy of the gas is\",round(S,2),\"J/K\""
],
"language": "python",
@@ -402,37 +356,25 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Calculate:\n",
- "#1.Total no. og possible configuration\n",
- "#2.Probability of getting a configuration\n",
- "#3.Total energy and average energy of the system\n",
- "#4.Change in energy of the system\n",
"\n",
"import math\n",
- "#Variable declaration\n",
"black=2 #No. of black balls\n",
"white=1 #No. of white ball\n",
"\n",
- "#CALCULATION\n",
"\n",
- "#Total no. of config\n",
"W=math.factorial(black+white)/(math.factorial(black)*math.factorial(white))\n",
- "#Probability of getting a config\n",
"P=1.0/W\n",
- "#Total and Average energy of system\n",
"E1=0+1+2\n",
"E2=E1\n",
"E3=E2\n",
"E=E1+E2+E3\n",
"E_av=E/3\n",
- "#Change in total energy of system\n",
"E1_dash=1+2+3\n",
"E2_dash=E1_dash\n",
"E3_dash=E2_dash\n",
"E_dash=E1_dash+E2_dash+E3_dash\n",
"change=E_dash-E\n",
"\n",
- "#RESULT\n",
"print\"1.Total No. of possible configuration:\",W\n",
"print\"2.Probability of getting a configuration=\",P,\"or 1/3\"\n",
"print\"3.Total energy of system=\",E\n",
@@ -470,20 +412,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.12\n",
"\n",
- "#To find the relative number of distinguishable quantum states in 1 mole of water and ice at 273K \n",
- "#Variable declaration\n",
"n=1.0 \t\t\t#no. of moles\n",
"T=273.0 \t\t\t#temperature [K]\n",
"Hf=6000.0 \t\t#enthalpy of fusion at 273K [J/mol]\n",
"k=1.38*(10**-23) \t#boltzmann constant[J/K]\n",
"\n",
- "#calculation\n",
"p=Hf/(k*T)/2.303 \n",
"print\"\\nTHE RESULT IS 10^24,which is too large to be displayed by ipython \"\n",
- "#w=10**(p) \t\t#w is the relative no. of distinguishable quantum states\n",
- "#Result\n",
"print\"This value of w is very large to calculate for python,because it's in the range of 10^24\"\n",
"print\"The relative no. of distinguishable quantum states in 1 mole of water and ice at 273K is 10^24\" \n",
"print\"\\nTHE RESULT IS 10^24,which is too large to be displayed by ipython \"\n",
@@ -519,19 +455,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.13\n",
"\n",
- "#To find the total entropy change of solid\n",
- "#Variable declaration\n",
"T=300 \t\t\t#temperature[K]\n",
"n=4 \t\t\t#no. of moles of an ideal gas\n",
"P1=2.02*10**5 \t\t#initial pressure[N/m2]\n",
"P2=4.04*10**5 \t\t#final pressure[N/m2]\n",
"R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
"import math\n",
- "#calculation\n",
"G=n*R*T*2.303*math.log10(P2/P1) \t#[J]\n",
- "#Result\n",
"print\" The change in Gibbs free energy is\",round(G,1),\"J\"\n"
],
"language": "python",
@@ -559,20 +490,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.14\n",
"\n",
- "#To find the work function or Helmholts free energy\n",
- "##Variable declaration\n",
"n=1 \t\t\t#no. of moles\n",
"T=300 \t\t\t#temperature[K]\n",
"V1=2 \t\t\t#initial volume[m3]\n",
"V2=20 \t\t\t#final volume[m3]\n",
"R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
"import math\n",
- "#calculation\n",
"\t\n",
"A=-n*R*T*2.303*math.log10(V2/V1) \t#Change in work function[J/mol]\n",
- "#Result\n",
"print\"The change in Helmholts free energy is\",round(A),\"J/mol\""
],
"language": "python",
@@ -600,23 +526,18 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.15\n",
- "#To find the energy change that can be extracted as heat and work \n",
"print\"C6H12O6(s) + 6O2(g) --> 6CO2(g) + 6H2O(l)\"\n",
- "#Variable declaration\n",
"T=298 \t\t\t\t#Temperature[k]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"S=182.45 \t\t\t#standard entropy change at 298K [J/K]\n",
"U=-2808 \t\t\t#change in internal energy at 298K[KJ/mol]\n",
"\t#reaction is taking place in bomb calorimeter so no volume change \n",
"\t#therefore U=Q at constant volume\n",
- "#calculation\n",
"\t\n",
"A=U-T*S*0.001 \t\t\t#Energy extracted as heat[KJ/mol]\n",
"Wmax=A \t\t\t\t#work done [KJ/mol]\n",
"dn=6-6 \t\t\t\t#change in no. of moles\n",
"H=U+dn*R*T \t\t\t#Change in enthalpy of the bomb calorimeter[KJ]\n",
- "#Result\n",
"print\"The energy change that can be extracted as heat is\",round(A),\"KJ/mol\"\n",
"print\"\\nThe energy change that can be extracted as work is\",round(-A),\"KJ/mol\"\n",
"print\"\\nThe change in enthalpy of bomb calorimeter is\",round(H),\"KJ/mol\"\n"
@@ -651,10 +572,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.16\n",
"\n",
- "#To find the helmholts free energy and Gibbs free energy\n",
- "#Variable declaration\n",
"print\"C8H18(g)+12.5O2(g)-->8CO2(g)+9H2O(l)\" \n",
"\n",
"T=298.0 \t\t\t\t#temperature[K]\n",
@@ -662,12 +580,10 @@ "H=-5109000.0 \t\t\t#Heat of reaction[J]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"dn=8-(1+12.5) \t\t\t#change in no. of moles\n",
- "#calculation\n",
"\n",
"U=H \t\t\t\t#[J]\n",
"A=U-T*S \t\t\t#Change in helmholts free energy[J]\n",
"G=A+dn*R*T \t\t\t#Change in Gibbs free energy[J]\n",
- "#Result\n",
"print\"The change in Helmholts free energy is\",round(A),\"J\"\n",
"print\"\\nThe change in Gibbs free energy is\",round(G),\"J\"\n",
"print\"The calculation is not precise in book,that's why a slight change in answer\""
@@ -701,10 +617,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.17\n",
- "#To find the Helmholts free energy and Gibbs free energy\n",
"print\"C3H6(g)+4.5O2(g)-->3CO2(g)+3H2O(l)\" \n",
- "##Variable declaration\n",
"S=-339.23 \t\t\t#standard change in entropy [J/K]\n",
"T=298 \t\t\t\t#temperature[K]\n",
"Hf1=20.42 \t\t\t#enthalpy of formation of C3H6(g)[J]\n",
@@ -712,13 +625,11 @@ "Hf3=-285.83 \t\t\t#enthalpy of formation of H2O(l)[J]\n",
"dn=3-4.5-1 \t\t\t#change in no. of moles\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
- "#calculation\n",
"\n",
"H=3*Hf2+3*Hf3-Hf1 \t\t#Enthalpy of the reaction[J]\n",
"U=H-dn*R*0.001*T \t\t#Change in internal energy of the reaction[J]\n",
"A=U-T*S*0.001 \t\t\t#Helmholts free energy change[J]\n",
"G=A+dn*R*0.001*T \t\t#Gibbs free energy change[J]\n",
- "#Result\n",
"print\"The change in Helmholts free energy is\",round(A,2),\"kJ\"\n",
"print\"\\nThe change in Gibbs free energy is\",round(G,2),\"kJ\""
],
@@ -750,22 +661,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.19\n",
- "#To find the total entropy change\n",
"print\"CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\"\n",
"\n",
- "#Variable declaration\n",
"S1=-242.98 \t\t\t\t#standard entropy change for the combustion reaction[J/K]\n",
"Hf1=-74.81 \t\t\t\t#Enthalpy of formation of CH4(g)[KJ/mol]\n",
"Hf2=-393.51 \t\t\t\t#Enthalpy of formation of CO2(g)[KJ/mol]\n",
"Hf3=-285.83 \t\t\t\t#Enthalpy of formation of H2O(l)[KJ/mol]\n",
"T=298 \t\t\t\t\t#temperature[K]\n",
- "#calculation\n",
"\t \n",
"H=Hf2+2*Hf3-Hf1 \t\t\t#Change in enthalpy of reaction[KJ]\n",
"S2=-H*1000/T \t\t\t\t#Change in entropy of the surrounding[J/K]\n",
"Stotal=(S1+S2)*0.001 \t\t\t#Total entropy change \n",
- "#Result\n",
"print\"The total change in entropy is\",round(Stotal,2),\"KJ/K\"\n"
],
"language": "python",
@@ -794,19 +700,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.20\n",
- "#To find the spontanity of the reaction\n",
"print\"2H2(g)+O2(g)-->2H2O(l)\" \n",
- "##Variable declaration\n",
"Hf1=-285.83 \t\t\t\t#standard enthalpy of formation of H2O(l)[KJ/mol]\n",
"S=-327 \t\t\t\t\t#Standard entropy change for the same reaction[J/K]\n",
"T=298 \t\t\t\t\t#temperature[K]\n",
"\n",
- "#calculation\n",
"\t\n",
"H=2*Hf1-0-0 \t\t\t\t#Enthalpy of the reaction[KJ/mol]\n",
"G=H-T*S*0.001 \t\t\t\t#Change in Gibbs free energy[KJ]\n",
- "#Result\n",
"print\"The change in Gibbs free energy is\",round(G,2),\"KJ\\n \"\n",
"print\"As change in Gibbs free energy is negative.Therefore,the reaction is spontaneous\"\n"
],
@@ -838,22 +739,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.21\n",
"\n",
"\n",
- "#To find the standard enthalpy of reaction \n",
"print\"CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\" \n",
- "#Variable declaration\n",
"S=-242.98 \t\t\t#standard entropy change for reaction [J/K]\n",
"T=298 \t\t\t\t#temperature[K]\n",
"Gf1=-50.72 \t\t\t#standard Gibbs free energy of formation for CH4(g)[KJ/mol]\n",
"Gf2=-394.36 \t\t\t#standard Gibbs free energy of formation for CO2(g)[KJ/mol]\n",
"Gf3=-237.13 \t\t\t#standard Gibbs free energy of formation for H2O(l)[KJ/mol]\n",
- "#calculation\n",
"\n",
"G=Gf2+2*Gf3-Gf1 \t\t#Standard Gibbs free energy for reaction[KJ/mol]\n",
"H=G+T*S*0.001 \t\t\t#Standard enthalpy of reaction [KJ]\n",
- "#Result\n",
"print\"The standard enthalpy of reaction is\",round(H,2),\"kJ\"\n"
],
"language": "python",
@@ -882,22 +778,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.22\n",
- "#To find the maximum energy that can be extracted as non-expansion work is equal to the change in free energy of the system\n",
"print\"C6H12O6(s)+6O2(g)-->6CO2(g)+6H2O(l)\"\n",
- "#Variable declaration\n",
"mass=25.0 \t\t\t#mass of glucose for combustion under standard condition[gm]\n",
"T=298 \t\t\t\t#temperature[K]\n",
"Gf1=-910 \t\t\t#Standard Gibbs free energy of formation for C6H12O6[KJ/mol]\n",
"Gf2=-394.4 \t\t\t#Standard Gibbs free energy of formation for CO2(g)[KJ/mol]\n",
"Gf3=-237.13 \t\t\t#Standard Gibbs free energy of formation for H2O(l)[KJ/mol]\n",
"mol_wt=180.0 \t\t\t#molecular weight of glucose[gm/mol]\n",
- "#calculation\n",
"\t\n",
"G=6*Gf2+6*Gf3-Gf1\n",
"n=mass/mol_wt \t\t\t#no. of moles\n",
"Gactual=G*n \t\t\t#Gibbs free energy for the combustion of 0.139mol of glucose \n",
- "#Result\n",
"print\"The energy that can be extracted as non-expansion work is\",round(-Gactual),\"KJ\" \n"
],
"language": "python",
@@ -926,16 +817,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.23\n",
- "#To find the value of the inversion temperature for the gas\n",
- "#Variable declaration\n",
"a=1.39*10**-2 \t\t#constant for a vanderwaal's gas[lit2.atm/mol2]\n",
"b=3.92*10**-2 \t\t#constant for a vanderwaal's gas[lit2.atm/mol2]\n",
"R=0.082 \t\t#Universal gas constant[lit.atm/deg/mol]\n",
- "#calculation\n",
"\t\n",
"Ti=(2*a)/(R*b) \t\t#inversion temperature [K]\n",
- "#Result\n",
"print\"The inversion temperature for the gas is\",round(Ti,3),\" K\"\n"
],
"language": "python",
@@ -963,19 +849,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.26\n",
- "#To find the Enthalpy of vaporization of ethylene\n",
- "#Variable declaration\n",
"T=169.25 \t\t\t#Boiling point[K]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"print\"dlnP/dT=He/R*T**2\" \n",
"print\"dlnP/dT=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3)\" \n",
"print\"Therefore using these two equations we calculate the He(enthalpy) of ethylene\" \n",
- "#calculation\n",
"\n",
"x=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3) #it is dlnP/dT\n",
"He=R*0.001*T**2*x #Enthalpy of vaporization[J/mol]\n",
- "#Result\n",
"print\"\\n\\nThe Enthalpy of vaporization of ethylene at its boiling point is\",round(He,3),\"KJ/mol\"\n",
"\n"
],
@@ -1009,21 +890,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.27\n",
- "#To find the boiling point of b/enzene at 60KPa\n",
"\n",
- "#Variable declaration\n",
"P1=101.3 \t\t\t#Initial Pressure[KPa]\n",
"P2=60 \t\t\t\t#Final Pressure[KPa]\n",
"He=31.8 \t\t\t#Enthalpy of vaporization[KJ/mol]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"T1=353.2 \t\t\t#boiling point of benzene at 101.3KPa[K]\n",
"import math\n",
- "#calculation\n",
"\n",
"x=(T1**-1)-(R*0.001*math.log(P2/P1)/He) \n",
"T2=x**-1 \t\t\t#Boiling point of benzene at 60KPa\n",
- "#Result\n",
"print\"The boiling point of benzene at 60KPa is\",round(T2,1),\"K\""
],
"language": "python",
@@ -1051,24 +927,19 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.28\n",
"\n",
- "#To find the molar enthalpy of vapourization\n",
- "##Variable declaration\n",
"P1=0.016 \t\t\t#Vapour pressure of pure ethanol at 273K[bar]\n",
"P2=0.470 \t\t\t#Vapour pressure of pure ethanol at 333K[bar]\n",
"T1=273 \t\t\t\t#initial temperature [K]\n",
"T2=333 \t\t\t\t#final temperature[K]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"P=1.01 \t\t\t\t#vapour pressure at normal boiling point[bar]\n",
- "#calculation\n",
"import math\n",
"\t\n",
"x=(T2**-1)-(T1**-1) \n",
"He=-R*0.001*math.log(P2/P1)/x \t#molar enthalpy of vaporization[J/mol]\n",
"t=(T2**-1)-(R*0.001*math.log(P/P2)/He) \n",
"T=(t**-1)-273 \t\t\t#normal boiling point [C]\n",
- "#Result\n",
"print\"\\n\\nThe normal boiling point for pure ethanol is \",round(T,1),\"C\"\n",
"print\"The molar enthalpy of vapourization is\",round(He,2),\"J/mol\""
],
@@ -1100,10 +971,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.29\n",
"\n",
- "#To find the vapour pressure of benzene at 298K\n",
- "#Variable declaration\n",
"T2=353.2 \t\t\t#normal boiling point of benzene at 1.01325bar[K]\n",
"T1=298\t \t\t\t#temperature [K]\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
@@ -1112,13 +980,11 @@ "\t#benzene obey's Trouton's rule\n",
"print\" from Troutons rule , \" \n",
"print\" He/Tb=85J/K/mol\" \n",
- "#calculation\n",
"\n",
"He=85*T2 \t\t\t#molar enthalpy of vapourization[J/K/mol]\n",
"x=(T2**-1)-(T1**-1) \n",
"t=-He*x/R \n",
"P1=P2/math.exp(t) \n",
- "#Result\n",
"print\"\\nThe vapour pressure of benzene at 298K is\",round(P1,3),\" bar\"\n"
],
"language": "python",
@@ -1149,15 +1015,10 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.30\n",
- "#To find the degrees of freedom \n",
- "#Variable declaration\n",
"c=1 \t\t\t#no. of components(only CO2)\n",
"p=2 \t\t\t#no. of phases(liquid + gas)\n",
- "#calculation\n",
"\n",
"F=c-p+2 \t\t#degree of freedom\n",
- "#Result\n",
"print\"Degrees of freedom is\",F \n",
"print\"Degrees of freedom 1 means that either pressure or temperature can be varied independently,i.e.when temperature is fixed,pressure is automatically fixed\" "
],
@@ -1187,16 +1048,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.31\n",
"\n",
- "#To find the values of degrees of freedom\n",
- "#Variable declaration\n",
"c=1 \t\t\t#no. of components\n",
"p=1 \t\t\t#no. of phases\n",
- "#calculation\n",
"\n",
"F=c-p+2 \t\t#Degrees of freedom\n",
- "#Result\n",
"print\"Degrees of freedom,F is\",F \n",
"print\"Degrees of freedom 2 means both the pressure and temperature can be varied independently\" \n",
"\n",
@@ -1228,16 +1084,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.32\n",
"\n",
- "#To find the mole fraction of sucrose,so that the vapour pressure of water will be lowered by dP\n",
- "#Variable declaration\n",
"P=1.75*10**-5 \t\t\t#Vapour pressure of pure water at 293K[torr]\n",
"dP=1.1*10**-7 \t\t\t#Lowering in vapour pressure of water\n",
- "#calculation\n",
"\n",
"x=dP/P \t\t\t\t#mole fraction of sucrose\n",
- "#Result\n",
"print\"The mole fraction of sucrose is\",round(x,6) \n",
"\n",
"\n"
@@ -1267,18 +1118,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.33\n",
"\n",
- "#To find the partial vapour pressure of benzene over the solution\n",
- "#Variable declaration\n",
"P=94.6 \t\t\t\t#The vapour pressure of pure benzene at 298K[torr]\n",
"n1=20.0 \t\t\t\t#no. of moles of pure benzene\n",
"n2=5.0 \t\t\t\t#no. of moles of pure naphthalene\n",
- "#calculation\n",
"\n",
"x=n1/(n1+n2) \t\t\t#(mole fraction of benzene)\n",
"p=x*P \t\t\t\t#the partial vapour pressure of benzene[torr]\n",
- "#Result\n",
"print\"The partial vapour pressure of benzene is\",p,\"torr\""
],
"language": "python",
@@ -1306,17 +1152,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.34\n",
- "#To find the reduction in chemical potential\n",
- "#Variable declaration\n",
"x=0.28 \t\t\t\t#mole fraction of solute\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"T=298 \t\t\t\t#temperature[K]\n",
"import math\n",
- "#calculation\n",
"\n",
"du=R*T*math.log(1-x) \t\t#reduction in chemical potential[J/mol]\n",
- "#Result\n",
"print\"The reduction in chemical potential is\",round(-du,1),\"J/mol\"\n"
],
"language": "python",
@@ -1344,17 +1185,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.35\n",
- "#To find the boiling point of the solution which is made by dissolving 155g of glucose in 1000g of water\n",
- "#Variable declaration\n",
"Kb=0.51 \t\t\t#ebullioscopic constant of water [K*Kg/mol]\n",
"n=155.0/180.0 \t\t\t#no. of moles of glucose\n",
"m=n/1 \t\t\t\t#[mol/Kg]\n",
"Ti=373.0 \t\t\t\t#Boiling point temperature of water[K]\n",
- "#calculation\n",
"\n",
"Tf=(Ti+Kb*m)-273 \t\t#boiling point temperature of the solution[C]\n",
- "#Result\n",
"print\"The boiling point of the solution is\",round(Tf,2),\"degree C\""
],
"language": "python",
@@ -1382,20 +1218,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.36\n",
"\n",
- "#To find the molar mass of solute(M2)\n",
- "#Variable declaration\n",
"Ti=5.44 #freezing point of pure benzene[K]\n",
"Tf=4.63 #freezing point of solution[K]\n",
"m1=2.12 #mass of the solute[gm]\n",
"m2=125.0 #mass of the benzene[gm]\n",
"Kf=5.12 #cryoscopic constant of pure benzene[K*Kg/mol]\n",
- "#calculation\n",
"\n",
"dTf=Ti-Tf \t#depression in freezing point[K]\n",
"M2=(m1*1000*Kf)/(m2*dTf) #molar mass of solute\n",
- "#Result\n",
"print\"The molar mass of solute is\",round(M2),\"(approx)\"\n"
],
"language": "python",
@@ -1423,20 +1254,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.38\n",
- "#To find the Kp value of the above reaction\n",
"print\"N2(g)+3H2(g)<=>2NH3(g)\"\n",
- "#Variable declaration\n",
"T=298 \t\t\t#Temperature[K]\n",
"Gf1=-16450 \t\t#Gibb's free energy of formation for NH3(g)[J/mol]\n",
"R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
"import math\t\n",
- "#calculation\n",
"\t\n",
"Gf=2*Gf1\t\t\t#Gibb's free energy for the reaction[KJ]\n",
"x=Gf/R/T\n",
"Kp=math.exp(-x) \n",
- "#Result\n",
"print\"The Kp for above reaction is\",round(Kp),\"or 5.85*10^5,in scientific notation(APPROX)\" "
],
"language": "python",
@@ -1465,10 +1291,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.39\n",
- "#To find the reaction Gibb's energy\n",
"print\"0.5N2(g)+1.5H2(g)<=>NH3(g)\" \n",
- "#Variable declaration\n",
"T=298 #Temperature[K]\n",
"Kp=900 #Equilibrium constant for above reaction\n",
"P1=0.32 #partial pressure of N2(g)[bar]\n",
@@ -1476,13 +1299,11 @@ "P3=0.98 #partial pressure of NH3(g)[bar]\n",
"R=8.314 #Universal gas constant[J/K/mol]\n",
"import math\n",
- "#calculation\n",
"\n",
"G=-R*T*math.log(Kp) \n",
"x=(P1**0.5)*(P2**1.5) \n",
"p=P3/x \n",
"Gr=(G+R*T*math.log(p))*0.001 \n",
- "#Result\n",
"print\"The reaction Gibbs free energy is\",round(Gr*1000),\"J/mol \""
],
"language": "python",
@@ -1511,24 +1332,19 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.40\n",
- "#To find the Kp at 423K temperature\n",
"print\"N2(g)+3H2(g)<=>2NH3(g)\"\n",
"\n",
- "#Variable declaration\n",
"Kp1=5.85*10**5 #equilibrium constant at 298K\n",
"H1=-46.11 #standard enthalpy of formation of NH3(g)[KJ/mol]\n",
"T1=298 #Initial temperature[K]\n",
"T2=423 #Final temperature[K]\n",
"R=8.314 #Universal gas constant[J/K/mol]\n",
- "#calculation\n",
"import math\n",
"\n",
"H=2*H1 #enthalpy for reaction [KJ]\n",
"t=(T1**-1)-(T2**-1) \n",
"x=-H*t/(R*0.001) \n",
"Kp2=Kp1*math.exp(x) \n",
- "#Result\n",
"print\"The Equilibrium constant for reaction at 423K is\",round(Kp2) \n"
],
"language": "python",
@@ -1557,11 +1373,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.41\n",
- "#To find the Standard Free energy and equilibrium constant \n",
"print\"Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\"\n",
- "#For Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\n",
- "#Variable declaration\n",
"T=298.0 \t\t\t#Temperature[K]\n",
"R=8.314 \t\t#Universal gas constant[J/K/mol]\n",
"E1=-0.7618 \t\t#Standard electrode potential for Zn2+/Zn [volts]\n",
@@ -1570,25 +1382,18 @@ "n=2.0 \t\t\t#no. of electrons balancing\n",
"\n",
"Ei=E2-E1 \t\t#Standard potential for the reaction[volts]\n",
- "#calculation\n",
"import math\n",
"Gi=-n*F*Ei \t\t#Standard Gibb's Free Energy [KJ/mol] \n",
"Ki=math.exp(-Gi/R/T) \t#Equilibrium constant\n",
- "#Result\n",
"print\"The Free energy for the rection is\",Gi*0.001,\"KJ/mol\"\n",
"print\"The value of equilibrium constant is\",Ki \n",
"\n",
- "#To find the standard free energy and equilibrium constant\n",
- "#Variable declaration\n",
"print\"Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\" \n",
- "#For Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\n",
"E3=0.6141 \t\t#Standard electrode potential for Hg2SO4(s),SO4^2-/Hg(l) [volts]\n",
- "#calculation\n",
"\n",
"Eii=E3-E2 \t\t#Standard potantial for the reaction[volts]\n",
"Gii=-n*F*Eii \t\t#Standard Gibb's free energy[KJ/mol]\n",
"Kii=math.exp(-Gii/R/T) \t#Equilibrium constant\n",
- "#Result\n",
"print\"The Free energy for the rection is\",round(Gii*0.001,1),\"KJ/mol\"\n",
"print\"The value of equilibrium constant is\",Kii\n",
"print\"PLEASE REDO the last line calculation,It is showing wrong result in my PC\"\n"
@@ -1624,9 +1429,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.42\n",
- "#To find the overall e.m.f of the above cell\n",
- "#Variable declaration\n",
"print\"Zn(s)|ZnCl2(soln)||AgCl(s)|Ag-Ag|AgCl(s)|ZnCl2(soln)|Zn(s)\" \n",
"\n",
"m1=0.02 \t\t\t#concentration[M]\n",
@@ -1637,10 +1439,8 @@ "T=298 \t\t\t\t#Temperature [K]\n",
"F=96500 \t\t\t#Faraday's constant[coulomb/mol]\n",
"import math\n",
- "#calculation\n",
"\t\n",
"E=R*T*(math.log(m2*Y2/m1/Y1))*3/2/F \t#[volts]\n",
- "#Result\n",
"print\"The overall e.m.f of the cell is\",round(E,4),\"volt\""
],
"language": "python",
@@ -1669,9 +1469,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.43\n",
- "#To find the e.m.f of the cell\n",
- "#Variable declaration\n",
"print\"H2(g,1atm)|HCl(aq)|HCl(aq)|H2(g,1atm)\" \n",
"m1=0.02 \t\t\t#concentration[M]\n",
"Y1=0.88 \t\t\t#mean ionic activity coefficient\n",
@@ -1682,10 +1479,8 @@ "F=96487 \t\t\t#Faraday's constant[coulombs/mol]\n",
"t=0.178 \t\t\t#Tranference number of Cl-1\n",
"import math\n",
- "#calculation\n",
"\n",
"E=-2*t*R*T*(math.log(m1*Y1/m2/Y2))/F \t#e.m.f of the cell[volts]\n",
- "#Result\n",
"print\"The e.m.f of the cell is\",round(E,3),\" volts\" \n",
"print\"\\nWrongly calculated in book as 0.351 volt\""
],
@@ -1717,22 +1512,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.44\n",
"\n",
- "#To find the values of dG,dS and dH\n",
"print\"The values for reaction that goes on within the cadmium cell\" \n",
- "#Variable declaration\n",
"n=2 \t\t\t#no. of moles\n",
"E=1.01463 \t\t#standard cadmium cell potential[volts]\n",
"d=-5*10**-5 \t\t#i.e d=dE/dT[V/K]\n",
"F=96500 \t\t#[coulomb/mol]\n",
"T=298 \t\t\t#Temperature [K]\n",
- "#calculation\n",
"\n",
"dG=-n*E*F \t\t#Change in Gibb's free energy[J]\n",
"dS=n*F*d \t\t#Change in entropy [J/K]\n",
"dH=dG+T*dS \t\t#change in enthalpy[J]\n",
- "#Result\n",
"print\" dG=\",dG,\"J\\nWrongly calculated in book as -195815 J\"\n",
"print\"\\n dS=\",dS,\"J/K\"\n",
"print\"\\n dH=\",dH,\"J\""
diff --git a/Thermodynamics:_A_Core_Course/CH6.ipynb b/Thermodynamics:_A_Core_Course/CH6.ipynb index b2d73f0e..4326009b 100644 --- a/Thermodynamics:_A_Core_Course/CH6.ipynb +++ b/Thermodynamics:_A_Core_Course/CH6.ipynb @@ -27,25 +27,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Find molar volume of CO2\n",
"\n",
"from scipy.optimize import fsolve\n",
"\n",
- "#Variable declaration:\n",
- "#For CO2:\n",
"a=3.61 #atm L**2 mol**-2\n",
"b=4.29*10**-2 #L mol**-1\n",
"R=0.082 #L atm K**-1 mol**-1\n",
"T=500 #K\n",
"P=100 #atm\n",
"\n",
- "#CALCULATION\n",
"\n",
- "#(P+a/Vm^2)(Vm-b)=RT\n",
- "#or Vm^2(P+a/Vm^2)(Vm-b)=RTVm^2\n",
- "#or P*Vm**3+a*Vm-Pb*Vm**2-a*b=Rt*Vm**2\n",
- "#or Vm^^3-(b+RT/P)Vm**2+a/P*Vm-(a*b)/P=0\n",
- "#Let\n",
"C1=b+(R*T/P) #L mol**-1 [aSsume]\n",
"C2=a/P #L^2 mol^-2 [assume]\n",
"C3=C2*b #L^3mol**-3\n",
@@ -53,7 +44,6 @@ " return(x**3-C1*x**2+C2*x-C3)\n",
"x=fsolve(f,0.3)\n",
"\n",
- "#RESULT\n",
"\n",
"print \"x=\",round(x,3)\n",
"Vm=round(x,3)\n",
@@ -85,23 +75,18 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.5\n",
- "#To find the fugacity and fugacity coefficient\n",
- "#Variable declaration\n",
"b=0.0391 \t\t\t#Van der waals constant[dm3/mol]\n",
"R=0.082 \t\t\t#Universal gas constant[dm3*atm/mol]\n",
"P2=1000 \t\t\t#pressure [atm]\n",
"P1=0 \t\t\t\t#pressure [atm]\n",
"T=1273\t\t \t\t#Temperature [K]\n",
"import math\n",
- "#Calculation\n",
"\n",
"x=b*(P2-P1) \n",
"y=R*T \n",
"fc=math.exp(x/y) \t\t#fugacity coefficient\n",
"\n",
"f=P2*fc #fugacity[atm]\n",
- "#Result\n",
"print\"The fugacity coefficient is\",round(fc,3) \n",
"print\"The fugacity is\",round(f),\"atm\"\n"
],
@@ -131,22 +116,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.10\n",
- "#To find the partial pressure of CO2 gas \n",
- "#Variable declaration\n",
"m1=0.03 #mass of CO2(g)[gm]\n",
"w1=44.01 #molecular weight of CO2(g)[gm/mol]\n",
"m2=250 #mass of water[gm]\n",
"w2=18.02 #molecular weight of water[gm/mol]\n",
"k=1.25*10**6 #Henry's law constant[Torr]\n",
"T=298 #Temperature[K]\n",
- "#Calculation\n",
"\n",
"n1=m1/w1 #no. of moles of CO2\n",
"n2=m2/w2 #no. of moles of water\n",
"x1=n1/(n1+n2) #mole fraction of CO2\n",
"Pco2=k*x1 #Partial pressure of CO2[Torr]\n",
- "#Result\n",
"print\"The partial pressure of CO2 gas is\",round(Pco2,2),\"Torr\""
],
"language": "python",
@@ -174,10 +154,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.11\n",
"\n",
- "#To find the Volume of the solution\n",
- "#Variable declaration\n",
"W=1000 \t\t\t#Total mass of a solution[gm]\n",
"x1=0.5 \t\t\t#mole fraction of Chloroform\n",
"x2=0.5 \t\t\t#mole fraction of Acetone\n",
@@ -185,11 +162,9 @@ "V2m=74.166 \t\t#Partial molar volume of Acetone[cm3/mol]\n",
"M1=119.59 \t\t#molecular weight of chloroform[gm/mol]\n",
"M2=58 \t\t\t#molecular weight of Acetone[gm/mol]\n",
- "#Calculation\n",
"\n",
"nT=W/(x1*M1+x2*M2) \t#Total no. of moles\n",
"V=nT*(x1*V1m+x2*V2m) \t#Total volume[cm3]\n",
- "#Result\n",
"print\"The volume of the solution is\",round(V,1),\"cm^3 (approx)\""
],
"language": "python",
@@ -217,16 +192,11 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.12\n",
- "#to find the excess volume \n",
- "#Variable declaration\n",
"x1=0.5 #mole fraction of chloroform\n",
"x2=0.5 #mole fraction of p-xylene\n",
"T=298 #Temperature[K]\n",
- "#Calculation\n",
"\n",
"Ve=x1*x2*(0.585+0.085*(x1-x2)-0.165*(x1-x2)**2) #Excess volume measured by using a dilatometer\n",
- "#Result\n",
"print\"Ve/(cm3.mol**-1) = \",round(Ve,3) "
],
"language": "python",
@@ -254,10 +224,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.14\n",
"\n",
- "#To find the activity , molality of the electrolytes\n",
- "#Variable declaration\n",
"m1=0.01 \t\t#molality[m]\n",
"v11=1.0 \n",
"v12=2.0 \n",
@@ -267,7 +234,6 @@ "v22=1.0 \n",
"Y2=0.53 \n",
"\n",
- "#Calculation\n",
"\n",
"v1=(v11)+(v12) \n",
"v2=(v21)+(v22) \n",
@@ -279,12 +245,9 @@ "y=1.0/v2 \n",
"m2m=m2*(v21*v21*v22**v22)**y #molality[m]\n",
"a2m=a2**y \n",
- "#Result\n",
"print\"The activity of the electrolyte ZnCl2 is\",round(a1,8)\n",
"print\"The activity of the electrolyte CuSO4 is\",round(a2,8)\n",
- "#print\"The mean activity of ZnCl2 is\",a1m\n",
"print\"The mean molality of ZnCl2 in [m]\",round(m1m,4)\n",
- "#print\"The mean activity of CuSO4 is\",a2m \n",
"print\"The mean molality of CuSO4 in [m]\",m2m \n"
],
"language": "python",
@@ -315,20 +278,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.15\n",
"\n",
- "#To find the molecular weight of sucrose\n",
- "#Variable declaration\n",
"m2=3 \t\t\t#mass of the sucrose[gm]\n",
"m1=0.1 \t\t\t#mass of water [Kg]\n",
"Kf=1.86 \t\t#cryoscopic constant of water[K*Kg/mol]\n",
"dTf=0.16 \t\t#Lowering in freezing point[K]\n",
- "#Calculation\n",
"\t\n",
"a=m1*dTf \n",
"b=Kf*m2 \n",
"M2=b/a \t\t\t#molecular weight\n",
- "#Result\n",
"print\"M2=molecular weight , then M2=\",M2 "
],
"language": "python",
@@ -356,20 +314,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 5.16\n",
"\n",
- "#To find the molecular formula of sulphur\n",
- "#Variable declaration\n",
"dTf=0.088 \t\t\t#Lowering in freezing point[K]\n",
"m2=0.45 \t\t\t#mass of sulphur[gm]\n",
"m1=0.09955 \t\t\t#mass of benzene[gm]\n",
"Kf=5.07 \t\t\t#cryoscopic constant for benzene[K*Kg/mol]\n",
- "#Calculation\n",
"\n",
"a=m1*dTf \n",
"b=Kf*m2 \n",
"M2=b/a \t\t\t\t#molecular weight of sulphur\n",
- "#Result\n",
"print\"The molecular weight of sulphur is\",round(M2,1) \n",
"x=M2/32 \t\t\t#no. of sulphur atoms\n",
"print\"\\n The molecular formula of sulphur is S\",round(x) "
@@ -401,9 +354,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.17\n",
- "#To find the molar mass of macromolecule\n",
- "#Variable declaration\n",
"m2=1.35 \t\t\t#mass of a macromolecule[gm]\n",
"V=100\t \t\t\t#volume of solution[cm^3]\n",
"R=82 \t\t\t\t#Universal gas constant[atm.cm^3.K^-1]\n",
@@ -412,13 +362,11 @@ "d=1 \t\t\t\t#density\n",
"p=1013250 \t\t\t#Atmospheric pressure\n",
"g=980.67 \t\t\t#gravitational field\n",
- "#Calculation\n",
"\n",
"\n",
"a=m2*R*T*p \n",
"b=V*9.9*d*g \n",
"M2=a/b #molar mass of macromolecule\n",
- "#Result\n",
"print\" M2 = molar mass of macromolecule , therefore M2 = \",round(M2),\"g.mol^-1\""
],
"language": "python",
@@ -446,21 +394,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.18\n",
"\n",
- "#To find the osmotic pressure of a solution\n",
- "#Variable declaration\n",
"R=82 \t\t\t#Universal gas constant[atm.ml.K^-1.mol^-1]\n",
"T=298 \t\t\t#Temperature[K]\n",
"V=250 \t\t\t#volume of water[ml]\n",
"m2=2.6 \t\t\t#mass of the protein\n",
"M2=85000 \t\t#molar mass of protein[g.mol^-1]\n",
"\n",
- "#Calculation\n",
"\t\n",
"n2=m2/M2 \t\t\t#no. of moles of protein\n",
"II=(n2*R*T)/V \t\t\t#Osmotic pressure of a solution[atm]\n",
- "#Result\n",
"print\"The osmotic pressure is\",round(II,5),\"atm \"\n"
],
"language": "python",
@@ -488,19 +431,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.19\n",
- "#To find the Ebullioscopic constant of water\n",
- "#Variable declaration\n",
"R=8.314 \t\t\t#Universal gas constant[J.K**-1.mol**-1]\n",
"Tb=373.15 \t\t\t#Boiling point temperature[K]\n",
"M1=0.018 \t\t\t# mass of water[kg]\n",
"Hvap=40.7 \t\t\t#Enthalpy of vaporization[KJ.mol**-1]\n",
- "#Calculation\n",
"\n",
"a=R*0.001*Tb**2*M1 \n",
"b=Hvap \n",
"Kb=a/b \t\t\t\t#Ebullioscopic constant of water[K.Kg.mol**-1]\n",
- "#Result\n",
"print\"The Ebullioscopic constant of water is\",round(Kb,2),\"K.Kg.mol-1\""
],
"language": "python",
@@ -528,19 +466,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.20\n",
- "#To find the value of activity coefficient\n",
"print\"CaF2(s)<=>CaF2(aq)<=>Ca+2(aq) + 2F-(aq)\"\n",
"\n",
- "#Variable declaration\n",
"Ksp=4.0*(10**-11) \t#Solubility product of sparingly soluble salt CaF2\n",
- "#Calculation\n",
"\n",
"x=Ksp/4.0 \n",
"Cs=x**(1.0/3.0) \t\t#Solubility \n",
"y=Cs**2 \n",
"Y=(x/y)**(1.0/3.0) \t\t#activity coefficient\n",
- "#Result\n",
"print\"The activity coefficient is\",Y \n",
"print\"NOTE:please note that the value of Cs is wrongly calculated as 4.64*10^-11 in book\""
],
@@ -571,10 +504,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.21\n",
"\n",
- "#To find the mean activity coefficient of ZnCl2 solution\n",
- "#Variable declaration\n",
"R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"T=298 \t\t\t\t#Temperature[K]\n",
"F=96500 \t\t\t#Faraday's constant\n",
@@ -582,13 +512,11 @@ "E=1.16 \t\t\t\t#e.m.f of the cell[Volts]\n",
"m=0.01 \n",
"import math\n",
- "#Calculation\n",
"\n",
"a=R*T \n",
"b=2*F \n",
"x=a/b \n",
"Y=math.exp((Eo-E-(x*math.log(4*m*m*m)))/(3*x)) #mean activity coefficient\n",
- "#Result\n",
"print\"The mean activity coefficient is\",round(Y,2) "
],
"language": "python",
@@ -616,9 +544,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.22\n",
- "#To find the ionic strength in a solution\n",
- "#Variable declaration\n",
"M1=0.01 \t\t\t#no. of moles of KCl\n",
"M2=0.005 \t\t\t#no. of moles of MgCl2\n",
"M3=0.002 \t\t\t#no. of moles of MgSO4\n",
@@ -629,14 +554,12 @@ "z22=1 \n",
"z31=2 \n",
"z32=2 \n",
- "#Calculation\n",
"\t\n",
"m1=M1/M \t\t\t#molality of KCL[m]\n",
"m2=M2/M \t\t\t#molality of MgCl2[m]\n",
"m3=M3/M \t\t\t#molality of MgSO4[m]\n",
"\n",
"I=0.5*((m1*z11**2+m1*z12**2+m2*z21**2+2*m2*z22**2+m3*z31**2+m3*z32**2)) #[mol/Kg]\n",
- "#Result\n",
"print\"The Ionic strength of a solution is\",I,\"mol/Kg\""
],
"language": "python",
@@ -664,22 +587,17 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 6.23\n",
- "#To find the mean activity coefficient\n",
- "#Variable declaration\n",
"T=298 \t\t\t\t#Temperature[K]\n",
"P=1 \t\t\t\t#pressure [atm]\n",
"m=0.02\t \t\t\t#Ionic strength of HCl solution in CH3OH[mol/Kg]\n",
"E=32.6 \t\t\t\t#Di-electric constant\n",
"d=0.787 \t\t\t#Density[gm/cm3]\n",
- "#Calculation\n",
"\t\n",
"I=0.5*(0.02*1*1+0.02*1*1) \t#Ionic strength of HCl solution[mol/Kg]\n",
"a=I*d \n",
"b=(E**3)*(298**3) \n",
"x=(a/b)**0.5 \n",
"Y=10**(-1.825*1000000*1*1*x) \t#mean activity coefficient\n",
- "#Result\n",
"print\"The mean activity coefficient is\",round(Y,2) "
],
"language": "python",
diff --git a/Thermodynamics:_A_Core_Course/CH7.ipynb b/Thermodynamics:_A_Core_Course/CH7.ipynb index 71226c1e..fdea70a8 100644 --- a/Thermodynamics:_A_Core_Course/CH7.ipynb +++ b/Thermodynamics:_A_Core_Course/CH7.ipynb @@ -27,10 +27,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.1\n",
"\n",
- "#To find the number of ways of distributing N particles\n",
- "#Variable declaration\n",
"N=20 \t\t\t\t#no, of particles\n",
"N1=4 \t\t\t\t#no. of particles in E1 energy level\n",
"N2=4 \t\t\t\t#no. of particles in E2 energy level\n",
@@ -38,7 +35,6 @@ "N4=3 \t\t\t\t#no. of particles in E4 energy level\n",
"N5=3 \t\t\t\t#no. of particles in E5 energy level\n",
"import math\n",
- "#Calculation\n",
"\t\n",
"Nf=math.factorial(N) \n",
"N1f=math.factorial(N1) \n",
@@ -48,7 +44,6 @@ "N5f=math.factorial(N5) \n",
"n=N1f*N2f*N3f*N4f*N5f \n",
"W=Nf/n \t\t\t#no. of ways of distributing\n",
- "#Result\n",
"print\"The no. of ways of distributing the particles is\",W"
],
"language": "python",
@@ -76,16 +71,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.2\n",
- "#To find the fraction of molecules present in vibrational level\n",
- "#Variable declaration\n",
"T=298.0 \t\t\t#Temperature [K]\n",
"v=6.5*10**13 \t\t#Frequency in [sec-1]\n",
"\t#Consider zero point energy = 0.\n",
"h=6.627*10**-34 \t#planck's constant[J.s]\n",
"k=1.381*10**-23 \t#Boltzmann constant \n",
"N=1.0 \t\t\t#Since N=summation(gj*exp(-Ej/kT))\n",
- "#Calculation\n",
"\n",
"E1=h*v \t\t\t#for energy level 1[J]\n",
"E2=2*h*v \t\t#for energy level 2[J]\n",
@@ -97,7 +88,6 @@ "N2=(g2*math.exp(-E2/x)) #molecules present in energy level 2\n",
"n1=N1/N \t\t#fraction of molecules present in energy level 1\n",
"n2=N2/N \t\t#fraction of molecules present in energy level 2\n",
- "#Result\n",
"print\"The fraction of molecule s present in energy level 1 is\",'{0:.7f}'.format(round(n1,7)) \n",
"\n",
"\n",
@@ -129,21 +119,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.3\n",
- "#To find the ratio of no. of particle per state for two states separated by an energy dE\n",
- "#Variable declaration\n",
"dE=4.3*10**-20 \t\t\t#difference in energy levels[J]\n",
"T1=0.000001 \t\t\t#Initial Temperature[K](approximately zero , needed for \t\t\t\texecution)\n",
"T2=300 \t\t\t\t#Final Temperature[K]\n",
"k=1.381*10**-23 \t\t#Boltzmann constant [J/K]\n",
"import math\n",
- "#Calculation\n",
"\t\n",
"x1=k*T1 \n",
"r1=math.exp(-dE/x1) \n",
"x2=k*T2 \n",
"r2=math.exp(-dE/x2) \n",
- "#Result\n",
"print\"The ratio of no. of particles per state at 0K is\",r1 \n",
"print\"The ratio of no. of particles per state at 300K is\",round(r2,6) "
],
@@ -173,16 +158,12 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.4\n",
- "#To find the no. of atoms in first-excited singlet state\n",
- "#Variable declaration\n",
"T1=273.0 \t\t\t\t#[K]\n",
"T2=14273.0 \t\t\t#[K]\n",
"E1=-13.6 \t\t\t#Energy of ground state [eV]\n",
"k=8.617*10.0**-5.0 \t\t\t#Boltzmann constant[eV/K]\n",
"g2=8.0 \t\t\t\t#total no. of states with energy E2\n",
"g1=2.0 \t\t\t\t#total no. of states with energy E1\n",
- "#Calculation\n",
"import math\n",
"\t\n",
"E2=E1/(2.0**2) \t\t#Energy for n=2 (i.e.E2=E1/n2)\n",
@@ -190,7 +171,6 @@ "r1=(g2/g1)*math.exp(-(E2-E1)/x1) \n",
"x2=k*T2 \n",
"r2=(g2/g1)*math.exp(-(E2-E1)/x2) \n",
- "#Result\n",
"print\"The fraction of atoms present in level n=2 at 273K is\", round(r1,190) \n",
"print\"Therefore total 3*10**25 atoms we say that all are present at ground state\" \n",
"print\"\\n\\nThe fraction of atoms present in level n=2 at 14273 is\",round(r2,3) \n",
@@ -228,19 +208,14 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.5\n",
- "#To find the Temperature at this condition \n",
"\n",
- "#Variable declaration\n",
"r1=0.001 \t\t\t#the population of the states at a higher energy to that at a \t\t\t\tlower energy \n",
"dE=8*10**-20 \t\t\t#The difference in energy[J]\n",
"k=1.381*10**-23 \t\t\t#Boltzmann constant [J/K]\n",
"\n",
- "#Calculation\n",
"\n",
"x=k*math.log(r1) \n",
"T=-dE/x #[K]\n",
- "#Result\n",
"print\"The Temperature at this condition is\",round(T,1),\"K\""
],
"language": "python",
@@ -268,29 +243,18 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.6\n",
- "#To find the entropy of the system\n",
"\n",
- "#section(1)\n",
- "#Variable declaration\n",
- "#The energy levels are not degenerate \n",
"w=1 \t\t\t#no. of ways of distributing the molecules\n",
"k=1.381*10**-23 \t#Boltzmann constant[J/K]\n",
- "#Calculation\n",
"import math\n",
"\t\n",
"S1=k*math.log(w) \t\t#Entropy of system at 0K\n",
"print\"The Entropy of System at 0K and non-degenerate eng level is\",S1,\"J/K/mol\"\n",
"\n",
- "#section(2)\n",
- "#Here the energy levels are degenerate\n",
"n=2 \n",
"R=8.314 #Universal gas constant[J/K/mol]\n",
"\n",
- "#To find the entropy of the system\n",
- "#S=kmath.log(n**N)=>S=R*math.log(n)\n",
"S2=R*math.log(n) #Entropy of the system[J/K/mol]\n",
- "#Result\n",
"print\"\\nThe Entropy of system at 0K and degenerete eng level is\",round(S2,2),\"J/K/mol\""
],
"language": "python",
@@ -320,10 +284,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.9\n",
"\n",
- "#To find the Transitional partition function of an oxygen molecule confined in a 1-litre \tvessel at 300K\n",
- "#Variable declaration\n",
"V=0.001 \t\t\t#Volume of vessel[m3]\n",
"T=300 \t\t\t\t#Temperature [K]\n",
"k=1.381*10**-23 \t\t#Boltzmann constant[J/K]\n",
@@ -331,13 +292,11 @@ "h=6.626*10**-34 \t\t#planck's constant[J.s}\n",
"\n",
"\n",
- "#Calculation\n",
"\t\n",
"m=32*1.66*(10**-27) \t\t#mass of oxygen molecule[Kg]\n",
"x=((2*3.14*m*k*T)**(3.0/2.0))*V \n",
"y=h**3 \n",
"zt=x/y \t\t\t\t#Transitional partition function of an oxygen molecule\n",
- "#Result\n",
"print\"The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is\",zt\n",
"print\"Wrongly calculated in book as 5.328*10^33\""
],
@@ -367,9 +326,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.12\n",
- "#To find the Entropy of argon at 273K and 1 atmospheric pressure\n",
- "#Variable declaration\n",
"R=1.99 \t\t\t#Universal gas constant [cal/K]\n",
"e=2.718 \n",
"V=22414 \t\t#volume[cm3]\n",
@@ -379,13 +335,11 @@ "k=1.381*10**-16 \t#Boltzmann constant[erg/K]\n",
"T=273.2 \t\t#Temperature[K]\n",
"import math\n",
- "#Calculation\n",
"\t\n",
"x=V*(e**2.5) \n",
"y=L*(h**3) \n",
"z=(2*3.14*m*k*T)**1.5 \n",
"S=R*math.log(x*z/y) #Entropy [cal/degree/mol]\n",
- "#Result\n",
"print\"The Entropy of argon at 273K and 1 atm is\",round(S,1),\"cal/degree/mol\""
],
"language": "python",
@@ -413,10 +367,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.14\n",
"\n",
- "#To find the rotational entropy and free energy for O2 gas\n",
- "#Variable declaration\n",
"T=298 \t\t\t\t#Temperature[K]\n",
"I=1.9373*10**-46 \t\t#moment of inertia of O2 gas [Kg/m2]\n",
"h=6.626*10**-34 \t\t\t#Planck's constant[J.s]\n",
@@ -424,11 +375,9 @@ "R=8.314 \t\t\t#Universal gas constant[J/K/mol]\n",
"u=2 \t\t\t\t#Homonuclear diatomic molecule\n",
"import math\n",
- "#Calculation\n",
"\t\n",
"Sr=R+R*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[J/K/mol]\n",
"Gr=-R*0.001*T*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[KJ/mol]\n",
- "#Result\n",
"print\"The rotational entropy for O2 gas is\",round(Sr,3),\"J/K/mol\"\n",
"print\"The rotational free energy for O2 gas is\",round(Gr,3),\"KJ/mol\"\n"
],
@@ -458,9 +407,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.15\n",
- "#To find the vibrational contribution to the entropy of F2 at 298K\n",
- "#Variable declaration\n",
"T=298 \t\t\t\t#Temperature[K]\n",
"v=892.1*3*10**10 \t\t#frequency[sec-1]\n",
"h=6.626*10**-27 \t\t#Planck's constant [J.s]\n",
@@ -468,13 +414,11 @@ "e=2.718 \n",
"R=1.998 \t\t\t#Universal gas constant[cal/K]\n",
"\t\n",
- "#Calculation\n",
"import math\n",
"x=h*v/(k*T) \n",
"a=R*x*e**-x/(1-e**-x) \t\t#a=E-Eo/T\n",
"b=R*math.log(1-e**-x) \t\t#b=G-Eo/T\n",
"S=a-b \t\t\t\t#[cal/deg]\n",
- "#Result\n",
"print\"The vibrational contribution to the entropy of F2 is\",round(S,4),\"cal/deg APPROX\""
],
"language": "python",
@@ -502,9 +446,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.16\n",
- "#To find the equilibrium constant\n",
- "#Variable declaration\n",
"T=1273 \t\t\t\t#Temperature[K]\n",
"h=6.26*10**-27 \t\t\t#Planck's constant[J.s]\n",
"k=1.381*10**-16 \t\t\t#Boltzmann constant[erg/K]\n",
@@ -517,14 +458,12 @@ "u=2 \t\t\t\t\t#symmetry number\n",
"L=6.023*10**23 \t\t\t\t#avogadro's number\n",
"import math\n",
- "#Calculation\n",
"\t\n",
"p=((3.14*m*k*T)**1.5)/h/h/h \n",
"s=R*u*h*h/L/8/3.14/3.14/I/k \n",
"q=1-(math.exp(-h*v/k/T)) \n",
"r=math.exp(-dE/k/T) \n",
"Kp=p*s*q*r \t\t\t\t#Equilibrium constant \n",
- "#Result\n",
"print\"The equilibrium constant is\",round(Kp,3) "
],
"language": "python",
@@ -552,9 +491,6 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#example 7.17\n",
- "#To find the equilibrium constant for isotopic exchange reaction\n",
- "#Variable declaration\n",
"T=298.0 #Temperature[K]\n",
"m1=32.0 \n",
"m2=36.0 \n",
@@ -573,14 +509,12 @@ "vo3=1490.0 #vibration frequency of 18O2 [cm-1]\n",
"dE=0.5*h*c*(2*vo1-vo2-vo3) #[erg]\n",
"r=dE/k/T \n",
- "#Calculation\n",
"import math\n",
"\n",
"a=m3**3/m2**1.5/m1**1.5 \n",
"b=(u3**2)*4/u2/u1 \n",
"c=z3**2/z2/z1 \n",
"Kp=a*b*c*math.exp(-r) \n",
- "#Result\n",
"print\"The value of equilibrium constant for isotopic exchange reaction is\",round(Kp,3) "
],
"language": "python",
|