diff options
Diffstat (limited to 'Thermodynamics:_A_Core_Course')
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH2.ipynb | 105 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH3.ipynb | 941 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH4.ipynb | 146 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH5.ipynb | 1763 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH6.ipynb | 702 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/CH7.ipynb | 603 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/README.txt | 10 | ||||
-rw-r--r-- | Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png | bin | 0 -> 64676 bytes | |||
-rw-r--r-- | Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png | bin | 0 -> 81768 bytes | |||
-rw-r--r-- | Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png | bin | 0 -> 77102 bytes |
10 files changed, 4270 insertions, 0 deletions
diff --git a/Thermodynamics:_A_Core_Course/CH2.ipynb b/Thermodynamics:_A_Core_Course/CH2.ipynb new file mode 100644 index 00000000..981cbdd9 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH2.ipynb @@ -0,0 +1,105 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2:Important terminologies in Thermodynamics "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1,Page no:13"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The specific heat capacity at constant pressure = 33.44 J K^-1 mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2,Page no:14"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mininmum work done to compress oxygen = 5743.0 J(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/CH3.ipynb b/Thermodynamics:_A_Core_Course/CH3.ipynb new file mode 100644 index 00000000..b72e6afa --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH3.ipynb @@ -0,0 +1,941 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:The first Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1,Page no:18"
+ ]
+ },
+ {
+ "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",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "energy tranfered in form of heat is -16000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2,Page no:18"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat gained by the system is 1729.0 J mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3,Page no:19"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat absorbed by the bromine vapours is 29.2 KJ\n",
+ "\n",
+ "Workdone during the process is -2.76 KJ\n",
+ "\n",
+ "Change in internal energy of the system is 26.44 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4,Page no:20"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C7H16(l) + 11O2(g) -> 7CO2(g) + 8H2O(l)\n",
+ "the change in enthalpy of system is -4809.91 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5,Page no:21"
+ ]
+ },
+ {
+ "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",
+ "print\"The workdone by system is\",round(W,1),\"J mol^-1\"\n",
+ "print\"\\nThe heat evolved is\",round(Q,1),\"J mol^-1\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H=U+PV ,where U is change in internal energy which is zero due to isothermal process\n",
+ "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",
+ "Therefore,the change in enthalpy is 0J\n",
+ "The workdone by system is -1747.3 J mol^-1\n",
+ "\n",
+ "The heat evolved is 1747.3 J mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6,Page no:24"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in enthalpy of water is 20.91 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7,Page no:29"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SO2 + 0.5O2 -> SO3\n",
+ "The change in enthalpy of reaction is -98269.0 J(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8,Page no:29"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i.C(s) + O2(g) -> CO2(g)\n",
+ "The change in internal energy is -393.5 KJ/mol\n",
+ "ii.C(s) + 0.5O2 -> CO(g)\n",
+ "The change in internal energy is -111.739 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9,Page no:30"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The standard heat of combustion of\n",
+ "2C6H6(l)+ 15O2(g)-> 12 CO2(g)+ 6 H2O(l)\n",
+ "H1(standard heat of combustion)=-6536 KJ/mol\n",
+ "C6H6(l)+ 7.5 O2(g)-> 6 CO2(g)+ 6 H2O(l)\n",
+ "H2(standard heat of combustion for 1 mole of C6H6)= -3268 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10,Page no:32"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)-> 2NH3(g)\n",
+ "H(heat of formation of 1 mole of product)= -46.11 kJ mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11,Page no:32"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C2H5OH(l)+3O2(g)->2CO2(g)+3H2O(l)\n",
+ "H(standard heat of reaction)= -1366.82 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12,Page no:33"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CO(g)+NO(g)->0.5N2(g)+CO2(g)\n",
+ "Hco(standard heat of formation)= -109.76 kJ mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13,Page no:34"
+ ]
+ },
+ {
+ "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",
+ "print\"\\n H(standard heat of formation)=\",H6,\"Kcal\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C3H6(g)+4.5O2(g)->3CO2(g)+3H2O(l)\n",
+ "\n",
+ " H(standard heat of combustion)= 5.0 Kcal\n",
+ "3C(s)+3H2(g)->C3H6(g)\n",
+ "\n",
+ " H(standard heat of formation)= -491.9 Kcal\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14,Page no:34"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H(standard heat of formation of N2O5)= 11.3 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15,Page no:35"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hf(standard heat of formation of solid sucrose)= -2221.25 KJ/mol(approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.16,Page no:37"
+ ]
+ },
+ {
+ "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",
+ "Cp3=35.06 \t\t\t#molar heat capacity at constant pressure for NH3(g)[J/K/mol]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Hf2(standard heat of formation for NH3 at 400K = -48.429 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.17,Page no:38"
+ ]
+ },
+ {
+ "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",
+ "T2=1273 #[K]\n",
+ "def f(T):\n",
+ " Cp_H2g=(29.07-((0.836*10**-3)*T)+((20.1*10**-7)*T**2))\n",
+ " Cp_O2g=25.72+(12.98*10**-3)*T-(38.6*10**-7)*T**2\n",
+ " Cp_H2Og=30.36+(9.61*10**-3)*T+(11.8*10**-7)*T**2\n",
+ " delta_Cp=(Cp_H2Og-(Cp_H2g+(1.0/2.0)*Cp_O2g))\n",
+ " return(delta_Cp)\n",
+ "\n",
+ "dHK=integrate.quad(f,T1,T2)\n",
+ "\n",
+ "dH_1273=dH_298+dHK[0]\n",
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat of formation of H2O(g) at 1000 C= -249.3 kJ mol^-1 (APPROXIMATE)\n",
+ "NOTE:\n",
+ "Slight variation in answer,because integration is not done precisely in the book\n",
+ "In the book,it is written as:-7497.46 instead of -7504.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.18,Page no:40"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " H(the C-H bond energy in CH4)= 379.8 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.19,Page no:40"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Hc-c(bond energy for one C-C bond in ethane bond)= 354.04 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.20,Page no:42"
+ ]
+ },
+ {
+ "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",
+ "H3=31 \t\t\t#enthalpy of vaporization of Br2(l) [KJ/mol]\n",
+ "H4=193 \t\t\t#enthalpy of dissociation Br2 to 2Br(g) [KJ/mol]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " H(lattice enthalpy of magnesium bromide)= 2433 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.21,Page no:44"
+ ]
+ },
+ {
+ "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",
+ " Cp_CO2g=26.0+((43.5*10**-3)*T)-((148.3*10**-7)*T**2)\n",
+ " Cp_H2Og=30.36+((9.61*10**-3)*T)+((11.8*10**-7)*T**2)\n",
+ " Cp_N2g=27.30-((5.23*10**-3)*T)-((0.04*10**-7)*T**2)\n",
+ " sig_nCpf=Cp_CO2g+2*Cp_H2Og+8*Cp_N2g\n",
+ " return(sig_nCpf)\n",
+ " crt=integrate.quad(g,298,T2)\n",
+ " ct=crt[0]-dH_heat\n",
+ " return(ct)\n",
+ "T2=fsolve(f,2)\n",
+ "print \"T2,maximum flame temperature is :\",round(T2[0],2),\"K\"\n",
+ "print\"Calculation mistake in book,wrongly written as:2250 K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T2,maximum flame temperature is : 2957.06 K\n",
+ "Calculation mistake in book,wrongly written as:2250 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/CH4.ipynb b/Thermodynamics:_A_Core_Course/CH4.ipynb new file mode 100644 index 00000000..f0aec688 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH4.ipynb @@ -0,0 +1,146 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:Defining Thermodynamic State:The State Postulate"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1,Page no:51"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M(liquid phase)= 1.0 Kg\n",
+ "M(vapour phase)= 1.5 Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2,Page no:51"
+ ]
+ },
+ {
+ "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",
+ "T=438 \t\t\t\t#temperature[K]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total volume occupied = 6.66 m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3,Page no:51"
+ ]
+ },
+ {
+ "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",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The total internal energy of the mixture = 1955.5 J\n",
+ "\n",
+ "NOTE:In textbook,it is wrongly calculated as 1950 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/CH5.ipynb b/Thermodynamics:_A_Core_Course/CH5.ipynb new file mode 100644 index 00000000..865af391 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH5.ipynb @@ -0,0 +1,1763 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5:The second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1,Page no:59"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of the engine = 0.349\n",
+ "\n",
+ " Workdone by the engine = 262.0 J\n",
+ "\n",
+ " Heat rejected by the engine = 488.0 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2,Page no:61"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency of the corresponding carnot engine = 0.75 or 75.0 %\n",
+ " Therefore , the inventors claim of 80% efficiency is absurd.The patent application should be rejected\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3,Page no:62"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum heat withdrawal from heat source= 5.5 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5,Page no:64"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar entropy change of argon = 5.8 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6,Page no:64"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in molar entropy = 5.8 JK^-1mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7,Page no:68"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy of the surroundings at 298k = 309.5 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8,Page no:69"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy of the argon gas is 19.03 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9,Page no:69"
+ ]
+ },
+ {
+ "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",
+ "T2=373.0 \t\t\t\t#Final temperature[K]\n",
+ "Hf=9870.0 \t\t\t#Standard enthalpy of fusion[J/mol]\n",
+ "Hv=30800.0 \t\t\t#Standard enthalpy of vaporization[J/mol]\n",
+ "Cp=136.1 \t\t\t#Specific heat capacity of benzene[J/K/mol]\n",
+ "mol_wt=78.0 \t\t\t#molecular weight of benzene[g/mol]\n",
+ "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",
+ "S2=n*Hf/Tf \t\t\t#entropy change in melting[J/K] \n",
+ "S3=n*Cp*math.log(Tb/Tf) \t#entropy change in heating[J/K]\n",
+ "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\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cp doesnot change within this temp limit\n",
+ "Total entropy change in heating 200g benzene from 3 to 100`C is 419.4 J/K or 0.419 KJ/K\n",
+ "\n",
+ "NOTE: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\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10,Page no:71"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in entropy of the gas is 11.53 J/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11,Page no:75"
+ ]
+ },
+ {
+ "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",
+ "print\" Therefore,Average energy=\",E_av\n",
+ "print\"4.In this case,Total energy=\",E_dash\n",
+ "print\" Change in total energy of system=\",change"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Total No. of possible configuration: 3\n",
+ "2.Probability of getting a configuration= 0.333333333333 or 1/3\n",
+ "3.Total energy of system= 9\n",
+ " Therefore,Average energy= 3\n",
+ "4.In this case,Total energy= 18\n",
+ " Change in total energy of system= 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12,Page no:77"
+ ]
+ },
+ {
+ "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",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "THE RESULT IS 10^24,which is too large to be displayed by ipython \n",
+ "This value of w is very large to calculate for python,because it's in the range of 10^24\n",
+ "The relative no. of distinguishable quantum states in 1 mole of water and ice at 273K is 10^24\n",
+ "\n",
+ "THE RESULT IS 10^24,which is too large to be displayed by ipython \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.13,Page no:86"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The change in Gibbs free energy is 6916.6 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.14,Page no:86"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in Helmholts free energy is -5744.0 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.15,Page no:87"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C6H12O6(s) + 6O2(g) --> 6CO2(g) + 6H2O(l)\n",
+ "The energy change that can be extracted as heat is -2862.0 KJ/mol\n",
+ "\n",
+ "The energy change that can be extracted as work is 2862.0 KJ/mol\n",
+ "\n",
+ "The change in enthalpy of bomb calorimeter is -2808.0 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.16,Page no:87"
+ ]
+ },
+ {
+ "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",
+ "S=421.5 \t\t\t#change in entropy[J/K]\n",
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C8H18(g)+12.5O2(g)-->8CO2(g)+9H2O(l)\n",
+ "The change in Helmholts free energy is -5234607.0 J\n",
+ "\n",
+ "The change in Gibbs free energy is -5248234.0 J\n",
+ "The calculation is not precise in book,that's why a slight change in answer\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.17,Page no:88"
+ ]
+ },
+ {
+ "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",
+ "Hf2=-393.51 \t\t\t#enthalpy of formation of CO2(g)[J]\n",
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C3H6(g)+4.5O2(g)-->3CO2(g)+3H2O(l)\n",
+ "The change in Helmholts free energy is -1951.16 kJ\n",
+ "\n",
+ "The change in Gibbs free energy is -1957.35 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.19,Page no:92"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\n",
+ "The total change in entropy is 2.74 KJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.20,Page no:93"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2H2(g)+O2(g)-->2H2O(l)\n",
+ "The change in Gibbs free energy is -474.21 KJ\n",
+ " \n",
+ "As change in Gibbs free energy is negative.Therefore,the reaction is spontaneous\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.21,Page no:94"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CH4(g)+2O2(g)-->CO2(g)+2H2O(l)\n",
+ "The standard enthalpy of reaction is -890.31 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.22,Page no:94"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C6H12O6(s)+6O2(g)-->6CO2(g)+6H2O(l)\n",
+ "The energy that can be extracted as non-expansion work is 400.0 KJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.23,Page no:97"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The inversion temperature for the gas is 8.649 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.26,Page no:100"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dlnP/dT=He/R*T**2\n",
+ "dlnP/dT=(2.303*834.13/T**2)+(1.75/T)-(2.30*8.375*10**-3)\n",
+ "Therefore using these two equations we calculate the He(enthalpy) of ethylene\n",
+ "\n",
+ "\n",
+ "The Enthalpy of vaporization of ethylene at its boiling point is 13.846 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.27,Page no:101"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boiling point of benzene at 60KPa is 336.9 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.28,Page no:101"
+ ]
+ },
+ {
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "The normal boiling point for pure ethanol is 77.4 C\n",
+ "The molar enthalpy of vapourization is 42.58 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.29,Page no:102"
+ ]
+ },
+ {
+ "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",
+ "P2=1.01325 \t\t\t#Vapour pressure of benzene[bar]\n",
+ "import math\n",
+ "\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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " from Troutons rule , \n",
+ " He/Tb=85J/K/mol\n",
+ "\n",
+ "The vapour pressure of benzene at 298K is 0.152 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.30,Page no:111"
+ ]
+ },
+ {
+ "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\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Degrees of freedom is 1\n",
+ "Degrees of freedom 1 means that either pressure or temperature can be varied independently,i.e.when temperature is fixed,pressure is automatically fixed\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.31,Page no:111"
+ ]
+ },
+ {
+ "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",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Degrees of freedom,F is 2\n",
+ "Degrees of freedom 2 means both the pressure and temperature can be varied independently\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.32,Page no:113"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mole fraction of sucrose is 0.006286\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.33,Page no:114"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The partial vapour pressure of benzene is 75.68 torr\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.34,Page no:114"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reduction in chemical potential is 813.9 J/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.35,Page no:116"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boiling point of the solution is 100.44 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.36,Page no:117"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molar mass of solute is 107.0 (approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.38,Page no:124"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)<=>2NH3(g)\n",
+ "The Kp for above reaction is 584861.0 or 5.85*10^5,in scientific notation(APPROX)\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.39,Page no:124"
+ ]
+ },
+ {
+ "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",
+ "P2=0.73 #partial pressure of H2(g)[bar]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.5N2(g)+1.5H2(g)<=>NH3(g)\n",
+ "The reaction Gibbs free energy is -14322.0 J/mol \n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.40,Page no:125"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N2(g)+3H2(g)<=>2NH3(g)\n",
+ "The Equilibrium constant for reaction at 423K is 35004905509.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.41,Page no:128"
+ ]
+ },
+ {
+ "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",
+ "E2=-0.403 \t\t#Standard electrode potential for Cd2+/Cd [volts]\n",
+ "F=96500.0 \t\t#Faraday's constant[coulomb/mol]\n",
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zn(s)|ZnCl2(aq)||CdSO4(aq)|Cd(s)\n",
+ "The Free energy for the rection is -69.2484 KJ/mol\n",
+ "The value of equilibrium constant is 1.37586809667e+12\n",
+ "Cd(s)|CdSO4(aq),Hg2SO4(s)|Hg(l)\n",
+ "The Free energy for the rection is -196.3 KJ/mol\n",
+ "The value of equilibrium constant is 2.56773255559e+34\n",
+ "PLEASE REDO the last line calculation,It is showing wrong result in my PC\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.42,Page no:130"
+ ]
+ },
+ {
+ "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",
+ "Y1=0.65 \t\t\t#mean ionic activity coefficient\n",
+ "m2=1.5 \t\t\t\t#concentration[M]\n",
+ "Y2=0.29 \t\t\t#mean ionic activity coefficient \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[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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Zn(s)|ZnCl2(soln)||AgCl(s)|Ag-Ag|AgCl(s)|ZnCl2(soln)|Zn(s)\n",
+ "The overall e.m.f of the cell is 0.1352 volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.43,Page no:131"
+ ]
+ },
+ {
+ "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",
+ "m2=1 \t\t\t\t#concentration[M]\n",
+ "Y2=0.81 \t\t\t#mean ionic activity coefficient\n",
+ "R=8.314 \t\t\t#universal gas constant[J/K/mol]\n",
+ "T=298 \t\t\t\t#Temperature[K]\n",
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H2(g,1atm)|HCl(aq)|HCl(aq)|H2(g,1atm)\n",
+ "The e.m.f of the cell is 0.035 volts\n",
+ "\n",
+ "Wrongly calculated in book as 0.351 volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.44,Page no:133"
+ ]
+ },
+ {
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The values for reaction that goes on within the cadmium cell\n",
+ " dG= -195823.59 J\n",
+ "Wrongly calculated in book as -195815 J\n",
+ "\n",
+ " dS= -9.65 J/K\n",
+ "\n",
+ " dH= -198699.29 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/CH6.ipynb b/Thermodynamics:_A_Core_Course/CH6.ipynb new file mode 100644 index 00000000..b2d73f0e --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH6.ipynb @@ -0,0 +1,702 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6:The Question of Ideality"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2,Page no:144"
+ ]
+ },
+ {
+ "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",
+ "def f(x):\n",
+ " 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",
+ "print\"Therefore,the value of molar volume,Vm=\",Vm,\"L mol^-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x= 0.366\n",
+ "Therefore,the value of molar volume,Vm= 0.366 L mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5,Page no:149"
+ ]
+ },
+ {
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fugacity coefficient is 1.454\n",
+ "The fugacity is 1454.0 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10,Page no:"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The partial pressure of CO2 gas is 61.41 Torr\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11,Page no:161"
+ ]
+ },
+ {
+ "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",
+ "V1m=80.235 \t\t#Partial molar volume of chloroform[cm3/mol]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volume of the solution is 869.4 cm^3 (approx)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.12,Page no:163"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ve/(cm3.mol**-1) = 0.146\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.14,Page no:169"
+ ]
+ },
+ {
+ "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",
+ "Y1=0.71 \n",
+ "m2=0.005 \t\t#molality[m]\n",
+ "v21=1.0 \n",
+ "v22=1.0 \n",
+ "Y2=0.53 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "v1=(v11)+(v12) \n",
+ "v2=(v21)+(v22) \n",
+ "a1=(m1**v1)*(v11**v11)*(v12**v12)*(Y1**v1) \n",
+ "a2=(m2**v2)*(v21**v21)*(v22**v22)*(Y2**v2) \n",
+ "x=1.0/v1 \n",
+ "a1m=a1**x \n",
+ "m1m=m1*(v11**v11*v12**v12)**x #molality[m]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The activity of the electrolyte ZnCl2 is 1.43e-06\n",
+ "The activity of the electrolyte CuSO4 is 7.02e-06\n",
+ "The mean molality of ZnCl2 in [m] 0.0159\n",
+ "The mean molality of CuSO4 in [m] 0.005\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.15,Page no:172"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M2=molecular weight , then M2= 348.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.16,Page no:173"
+ ]
+ },
+ {
+ "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) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The molecular weight of sulphur is 260.4\n",
+ "\n",
+ " The molecular formula of sulphur is S 8.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.17,Page no:174"
+ ]
+ },
+ {
+ "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",
+ "T=300 \t\t\t\t#Temperature[K]\n",
+ "II=9.9 \t\t\t\t#osmotic pressure of the solution[cm]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " M2 = molar mass of macromolecule , therefore M2 = 34660.0 g.mol^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.18,Page no:175"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The osmotic pressure is 0.00299 atm \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.19,Page no:175"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Ebullioscopic constant of water is 0.51 K.Kg.mol-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.20,Page no:176"
+ ]
+ },
+ {
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CaF2(s)<=>CaF2(aq)<=>Ca+2(aq) + 2F-(aq)\n",
+ "The activity coefficient is 0.0599484250319\n",
+ "NOTE:please note that the value of Cs is wrongly calculated as 4.64*10^-11 in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21,Page no:177"
+ ]
+ },
+ {
+ "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",
+ "Eo=0.98 \t\t\t#Standard e.m.f of the cell[Volts]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient is 0.59\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22,Page no:184"
+ ]
+ },
+ {
+ "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",
+ "M=0.1 \t\t\t\t#mass of water[Kg]\n",
+ "z11=1 \n",
+ "z12=1 \n",
+ "z21=2 \n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Ionic strength of a solution is 0.33 mol/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.23,Page no:185"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mean activity coefficient is 0.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/CH7.ipynb b/Thermodynamics:_A_Core_Course/CH7.ipynb new file mode 100644 index 00000000..71226c1e --- /dev/null +++ b/Thermodynamics:_A_Core_Course/CH7.ipynb @@ -0,0 +1,603 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7:Statistical Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1,Page number:193"
+ ]
+ },
+ {
+ "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",
+ "N3=6 \t\t\t\t#no. of particles in E3 energy level\n",
+ "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",
+ "N2f=math.factorial(N2) \n",
+ "N3f=math.factorial(N3) \n",
+ "N4f=math.factorial(N4) \n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The no. of ways of distributing the particles is 162954792000\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2,Page number:194"
+ ]
+ },
+ {
+ "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",
+ "x=k*T \n",
+ "g1=1.0 \n",
+ "g2=1.0 \n",
+ "import math\n",
+ "N1=(g1*math.exp(-E1/x)) #molecules present in energy level 1\n",
+ "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",
+ "print\"The fraction of molecules present in energy level 2 is\",round(n2,10) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of molecule s present in energy level 1 is 0.0000285\n",
+ "The fraction of molecules present in energy level 2 is 8e-10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3,Page number:194"
+ ]
+ },
+ {
+ "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) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of no. of particles per state at 0K is 0.0\n",
+ "The ratio of no. of particles per state at 300K is 3.1e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4,Page number:195"
+ ]
+ },
+ {
+ "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",
+ "x1=k*T1 \n",
+ "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",
+ "x=r2*3.0*10**25.0 \n",
+ "print\"Therefore no. of atoms in level n=2 is\",x \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fraction of atoms present in level n=2 at 273K is 1.97e-188\n",
+ "Therefore total 3*10**25 atoms we say that all are present at ground state\n",
+ "\n",
+ "\n",
+ "The fraction of atoms present in level n=2 at 14273 is 0.001\n",
+ "Therefore no. of atoms in level n=2 is 3.0021673634e+22\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5,Page number:195"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Temperature at this condition is 838.6 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6,Page number:196"
+ ]
+ },
+ {
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Entropy of System at 0K and non-degenerate eng level is 0.0 J/K/mol\n",
+ "\n",
+ "The Entropy of system at 0K and degenerete eng level is 5.76 J/K/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9,Page number:202"
+ ]
+ },
+ {
+ "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",
+ "mol_wt=32 \t\t\t#molecular mass of oxygen molecule\n",
+ "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\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is 1.76621948031e+29\n",
+ "Wrongly calculated in book as 5.328*10^33\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12,Page number:204"
+ ]
+ },
+ {
+ "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",
+ "L=6.023*10**23 \n",
+ "h=6.626*10**-27 \t#Planck's constant [erg.sec]\n",
+ "m=6.63*10**-23 \t\t#mass[gm]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Entropy of argon at 273K and 1 atm is 36.6 cal/degree/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14,Page number:207"
+ ]
+ },
+ {
+ "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",
+ "k=1.381*10**-23 \t\t\t#Boltzmann constant[J/K]\n",
+ "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"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rotational entropy for O2 gas is 43.826 J/K/mol\n",
+ "The rotational free energy for O2 gas is -10.583 KJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.15,Page number:208"
+ ]
+ },
+ {
+ "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",
+ "k=1.381*10**-16 \t\t#Boltzmann constant[erg/K]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The vibrational contribution to the entropy of F2 is 0.1445 cal/deg APPROX\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.16,Page number:211"
+ ]
+ },
+ {
+ "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",
+ "T=1000 \t\t\t\t#Temperature[degrees]\n",
+ "m=3.82*10**-23 \t\t\t#mass of Na [gm]\n",
+ "I=(1.91*10**-23)*(3.078*10**-8)**2 \t#moment of inertia[gm.cm2]\n",
+ "dE=0.73*1.602*10**-12 \t\t\t#[erg]\n",
+ "v=159.23*(3*10**10)\t \t\t#frequency [s-1]\n",
+ "R=82 \t\t\t\t\t#universal gas constant[cm3.atm/deg]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium constant is 0.608\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.17,Page number:212"
+ ]
+ },
+ {
+ "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",
+ "m3=34.0 \n",
+ "u1=8.0 \n",
+ "u2=9.0 \n",
+ "u3=16.0*18.0/34.0 \n",
+ "z1=0.99924 \n",
+ "z2=0.99951 \n",
+ "z3=0.99940 \n",
+ "h=6.26*10**-27 #Planck's constant[J.s]\n",
+ "c=3.0*10**10 #Speed of light[m/s]\n",
+ "k=1.38*10**-16 #Boltzman's constant[erg/K]\n",
+ "vo1=1535.8 #vibration frequency of 16O18O [cm-1]\n",
+ "vo2=1580.4 #vibration frequency of 16O2 [cm-1]\n",
+ "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",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of equilibrium constant for isotopic exchange reaction is 3.996\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/README.txt b/Thermodynamics:_A_Core_Course/README.txt new file mode 100644 index 00000000..c61dc121 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/README.txt @@ -0,0 +1,10 @@ +Contributed By: Deepak Shakya +Course: btech +College/Institute/Organization: DCRUST +Department/Designation: Chemical Engg +Book Title: Thermodynamics: A Core Course +Author: R. C. Srivastava, S. K. Saha And A. K. Jain +Publisher: PHI Learning Pvt. Ltd. +Year of publication: 2004 +Isbn: 81-203-2498-6 +Edition: 2nd
\ No newline at end of file diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png Binary files differnew file mode 100644 index 00000000..df57307c --- /dev/null +++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-1.png diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png Binary files differnew file mode 100644 index 00000000..785f7970 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-2.png diff --git a/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png Binary files differnew file mode 100644 index 00000000..a71d57e5 --- /dev/null +++ b/Thermodynamics:_A_Core_Course/screenshots/deepak-2-3.png |