diff options
36 files changed, 9002 insertions, 0 deletions
diff --git a/Introduction_to_Thermal_Systems_Engineering:_Thermodynamics,_Fluid_Mechanics,_and_Heat_Transfe_by_Moran,_Shapiro,_Munson,_Dewitt/README.txt b/Introduction_to_Thermal_Systems_Engineering:_Thermodynamics,_Fluid_Mechanics,_and_Heat_Transfe_by_Moran,_Shapiro,_Munson,_Dewitt/README.txt new file mode 100644 index 00000000..5bda4cc3 --- /dev/null +++ b/Introduction_to_Thermal_Systems_Engineering:_Thermodynamics,_Fluid_Mechanics,_and_Heat_Transfe_by_Moran,_Shapiro,_Munson,_Dewitt/README.txt @@ -0,0 +1,10 @@ +Contributed By: Smriti Nandan Paul +Course: others +College/Institute/Organization: Indian Institute of Technology, Bombay +Department/Designation: Aerospace +Book Title: Introduction to Thermal Systems Engineering: Thermodynamics, Fluid Mechanics, and Heat Transfe +Author: Moran, Shapiro, Munson, Dewitt +Publisher: John Wiley & Sons; Har/Cdr edition (30 January 2003) +Year of publication: 2003 +Isbn: 978-0471204909 +Edition: 1
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/README.txt b/Material_Science_by_S._L._Kakani_and_A._Kakani/README.txt new file mode 100644 index 00000000..21e02a20 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/README.txt @@ -0,0 +1,10 @@ +Contributed By: Girish Vora +Course: btech +College/Institute/Organization: abbccus technology, Ahmedabad +Department/Designation: Developer +Book Title: Material Science +Author: S. L. Kakani and A. Kakani +Publisher: New Age International Publishers, New Delhi +Year of publication: 2005 +Isbn: 81-224-1528-8 +Edition: 1
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch10.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch10.ipynb new file mode 100644 index 00000000..a954cb7d --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch10.ipynb @@ -0,0 +1,65 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8423f8dd8cef07dd1b306293d3f89231a94157a35ba4e1f68dddcd1c471e99b2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 :\n", + "Heat Treatment" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 Page No : 343" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N = 8;\t\t\t#ASTM grain size number\n", + "n = 2**(N-1);\t\t\t#Number of grains per inch square at a magnification\n", + "N_1 = n*100.*100;\t\t\t#Number of grains per inch square without magnification\n", + "\n", + "# Calculation\n", + "N_2 = N_1/(25.4)**2;\t\t\t#Number of grains per mm square without magnification\n", + "A_a = 1./(N_2);\t\t\t#Average area of each grain(in mm**2)\n", + "D = (A_a)**(1./2);\t\t\t#Average grain diameter(in mm)\n", + "\n", + "# Results\n", + "print 'Average grain diameter = %.3f mm'%D\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average grain diameter = 0.022 mm\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch11.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch11.ipynb new file mode 100644 index 00000000..cf7a4c6a --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch11.ipynb @@ -0,0 +1,163 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ccc34ac1a23df3ea87c02161eb6957101119525a84db5440299d3d3e0c490bb9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 :\n", + "Deformation of Materials" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 Page No : 369" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h_1 = 1;\n", + "k_1 = 1;\n", + "l_1 = 1;\n", + "#Miller indices of slip plane\n", + "h_2 = 1;\n", + "k_2 = -1;\n", + "l_2 = 1;\n", + "#Miller indices of stress plane\n", + "h_3 = 1;\n", + "k_3 = 1;\n", + "l_3 = 0;\n", + "\n", + "# Calculation\n", + "#Miller indices of slip direction\n", + "A = (h_1*h_2+k_1*k_2+l_1*l_2)/(((h_1**2+k_1**2+l_1**2)**(1./2))*((h_2**2+k_2**2+l_2**2)**(1./2)));\t\t\t#Value of math.cos(x) where x = angle between slip plane and stress plane\n", + "B = (h_1*h_3+k_1*k_3+l_1*l_3)/(((h_1**2+k_1**2+l_1**2)**(1./2))*((h_3**2+k_3**2+l_3**2)**(1./2)));\t\t\t#Value of math.cos(y) where y = angle between slip direction and stress direction\n", + "C = (1-A**2)**(1./2);\t\t\t#Value of math.sin(x)\n", + "stress = 3.5;\t\t\t#Applied Stress in Mpa\n", + "T_cr = stress*A*B*C;\t\t\t#Critical resolved shear stress(in MPa)\n", + "\n", + "# Results\n", + "print 'Critical resolved shear stress in = %.3f MPa'%T_cr\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Critical resolved shear stress in = 0.898 MPa\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 Page No : 370" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "D = 0.022;\t\t\t#Grain diameter(in mm)\n", + "d = D*10**(-3);\t\t\t#Grain diameter(in m)\n", + "K = 0.63;\t\t\t#Constant(in MNm**(-3/2))\n", + "\n", + "# Calculation\n", + "sigma_i = 80;\t\t\t#in MNm**-2\n", + "sigma_y = sigma_i+K*d**(-1./2);\t\t\t#Yield stress for a polycrystalline alloy\n", + "\n", + "# Results\n", + "print 'Yield stress for a polycrystalline alloy in = %.2f MN/m**2'%sigma_y\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Yield stress for a polycrystalline alloy in = 214.32 MN/m**2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 Page No : 370" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "sigma_y1 = 120;\t\t\t#primary yield strength of polycrystalline material(in MN*m**-2)\n", + "sigma_y2 = 220;\t\t\t#increased yield strength of polycrystalline material(in MN*m**-2)\n", + "d_1 = 0.04*10**(-3);\t\t\t#primary grain diameter(in meter)\n", + "d_2 = 0.01*10**(-3);\t\t\t#grain diameter after decreasing(in meter)\n", + "\n", + "# Calculation\n", + "#sigma_y1 = sigma_i+K*(d_1)**(-1/2)\n", + "#sigma_y2 = sigma_i+K*(d_2)**(-1/2)\n", + "#putting the values and solving the equation\n", + "K = (220-120)/((d_2**(-1./2))-((d_1**(-1./2))));\t\t\t#consmath.tant(in MN*m(-3/2))\n", + "sigma_i = sigma_y1-K*(d_1)**(-1./2);\t\t\t#in MN*m**-2\n", + "d = 1./((10**4)*(256./645))**(1./2);\t\t\t#grain diameter for grain size ASTM 9(in mm)\n", + "D = d*10**(-3);\t\t\t #grain diameter for grain size ASTM 9(in meter)\n", + "sigma_y = sigma_i+K*(D)**(-1./2);\t\t\t#Yield stress for a polycrystalline alloy for grain size ASTM 9(in MN*m**-2)\n", + "\n", + "# Results\n", + "print 'Yield stress for a polycrystalline alloy for grain size ASTM 9 in = %.0f MN*m**-2'%round(sigma_y)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Yield stress for a polycrystalline alloy for grain size ASTM 9 in = 179 MN*m**-2\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch12.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch12.ipynb new file mode 100644 index 00000000..025ece08 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch12.ipynb @@ -0,0 +1,105 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:030c93395768b2f42836485175665cce8f1a2b5170495494504b4c018dda5636" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 :\n", + "Oxidation and Corrosion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 Page No : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "D = 320*10**-3;\t\t\t#in meter\n", + "L = 1;\t\t\t#in meter\n", + "\n", + "# Calculation\n", + "A = math.pi*D*L;\t\t\t#Surface area in meter**2\n", + "l = (200/A);\n", + "\n", + "# Results\n", + "print 'the distance at which magnisium anode capable of giving 2MA = %.0f meters'%l\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the distance at which magnisium anode capable of giving 2MA = 199 meters\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 Page No : 396" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "W = 0.0243;\t\t\t#1 mole of magnesium weight(in Kg)\n", + "C = 2*96490;\t\t\t#used charge (in A-s)\n", + "A = 15*10**(-3);\t\t\t#current density (in A/metre2)\n", + "t = 10;\t\t\t#time (in years)\n", + "T = 10*365*24*3600;\t\t\t#time (in sec)\n", + "\n", + "# Calculation\n", + "#amount of magnesium required = charge required per m2 of hull surface for a design life of 10 years/(used charge for anode)\n", + "Mg_required = W*A*T/C;\t\t\t#magnesium required per square meter of the hull surface for a design life of 10 years\n", + "\n", + "# Results\n", + "print 'magnesium required per square meter of the hull surface for a design life of 10 years = %.1f Kg/m2'%Mg_required\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "magnesium required per square meter of the hull surface for a design life of 10 years = 0.6 Kg/m2\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch13.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch13.ipynb new file mode 100644 index 00000000..8e0b482d --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch13.ipynb @@ -0,0 +1,65 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b68069a86d982f0fbb7f292544735818ed7473431281a6c20f1e7336e739e90b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 :\n", + "Thermal and Optical\n", + "Properties of Materials" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 Page No : 417" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables \n", + "alpha = 20*10**(-6);\t\t\t#linear coefficient of thermal expansion per\u00b0C\n", + "Sigma = -(172);\t\t\t#compressive stress MPa\n", + "T = 20;\t\t\t#Temprature at which rod is stress free(in \u00b0C)\n", + "\n", + "# Calculation\n", + "E = 100*10**3;\t\t\t#modulus of elasticity (in MPa)\n", + "T_f = T-(Sigma/(alpha*E));\t\t\t#maximum temperature the rod may be heated without exceeding a compressive stress of 172 MPa\n", + "\n", + "# Results\n", + "print 'maximum temperature(in \u00b0C) the rod may be heated without exceeding a compressive stress of 172 MPa = %.0f \u00b0C'%T_f\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximum temperature(in \u00b0C) the rod may be heated without exceeding a compressive stress of 172 MPa = 106 \u00b0C\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch14.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch14.ipynb new file mode 100644 index 00000000..caa4b3ba --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch14.ipynb @@ -0,0 +1,403 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c3307fcf5401111c18823817fd228cc6b9116793515454b94be6aa8bf3b80a0e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 :\n", + "Electrical and Magnetic\n", + "Properties of Materials" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 Page No : 443" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "l = 100;\t\t\t#length of wire\n", + "p = 2.66*10**(-8);\t\t\t#resistivity\n", + "\n", + "# Calculation\n", + "A = 3*10**(-6);\t\t\t#cross sectional area\n", + "R = p*l/A;\t\t\t#resismath.tance of an aluminium wire\n", + "\n", + "# Results\n", + "print 'resistance of an aluminium wire = %.3e Ohm'%R\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "resistance of an aluminium wire = 8.867e-01 Ohm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 Page No : 443" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "R_Cu = 1.56;\t\t\t#Resistivity of pure copper(in micro-ohm-cm)\n", + "R_CuNi = 4.06;\t\t\t#Resistivity of Cu containing two atomic percent (in micro-ohm-cm)\n", + "R_Ni = (R_CuNi-R_Cu)/2;\t\t\t#Increase in resistivity due to one atomic % Ni\n", + "\n", + "# Calculation\n", + "R_CuAg = 1.7;\t\t\t#resistivity of copper, containing one atomic percent silver (in micro-ohm-cm)\n", + "R_Ag = R_CuAg-R_Cu;\t\t\t#Increase in resistivity due to one atomic % Ag\n", + "R_CuNiAg = R_Cu+R_Ni+3*R_Ag;\t\t\t#Resistivity of copper alloy containing one atomic percent Ni and 3 atomic percent Ag\n", + "\n", + "# Results\n", + "print 'Resistivity of copper alloy containing one atomic percent Ni and 3 atomic percent Ag = %.2f micro-ohm-cm'%R_CuNiAg\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resistivity of copper alloy containing one atomic percent Ni and 3 atomic percent Ag = 3.23 micro-ohm-cm\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 Page No : 443" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "R_Cu = 1.8*10**(-8);\t\t\t#resistivity of pure copper at room temperature \n", + "R_CuNi = 7*10**(-8);\t\t\t#resistivity of Cu 4% Ni alloy at room temperature \n", + "\n", + "# Calculation\n", + "R_Ni = (R_CuNi-R_Cu)/4;\t\t\t#resistivity due to Impurity scattering per % of Ni\n", + "\n", + "# Results\n", + "print 'resistivity due to impurity scattering per percent of Ni in the Cu lattice = %.1e ohm-meter'%R_Ni\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "resistivity due to impurity scattering per percent of Ni in the Cu lattice = 1.3e-08 ohm-meter\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.4 Page No : 455" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "C = 10**(-9);\t\t\t#capacitance(in F)\n", + "d = 2*10**(-3);\t\t\t#distance of separation in a parallel plate condenser\n", + "E_o = 8.854*10**(-12);\t\t\t#dielectric consmath.tant\n", + "\n", + "# Calculation\n", + "A = (10*10**(-3))*(10*10**(-3));\t\t\t#area of parallel plate condenser\n", + "#C = E_o*E_r*A/d\n", + "E_r = C*d/(E_o*A);\t\t\t#Relative dielectric constant\n", + "\n", + "# Results\n", + "print 'Relative dielectric constant of a barium titanate crystal %.0f'%(E_r)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative dielectric constant of a barium titanate crystal 2259\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.5 Page No : 456" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "q = 1.6*10**(-19);\t\t\t#charge (in C)\n", + "d_1 = 0.06\t\t\t#shift of the titanium ion from the body centre (in \u00c5)\n", + "d_2 = 0.08\t\t\t#shift of the oxygen anions of the side faces (in \u00c5)\n", + "d_3 = 0.06\t\t\t#shift of the oxygen anions of the top and bottom face (in \u00c5) \n", + "\n", + "# Calculation\n", + "D_1 = d_1*10**(-10);\t\t\t#shift of the titanium ion from the body centre (in m)\n", + "D_2 = d_2*10**(-10);\t\t\t#shift of the oxygen anions of the side faces (in m)\n", + "D_3 = d_3*10**(-10);\t\t\t#shift of the oxygen anions of the top and bottom face (in m)\n", + "U_1 = 4*q*D_1;\t\t\t#dipole moment due to two O2\u2013 ions on the four side faces(in C-m)\n", + "U_2 = 2*q*D_2;\t\t\t#dipole moment due to one O2\u2013 on top and bottom(in C-m)\n", + "U_3 = 4*q*D_3;\t\t\t#dipole moment due to one Ti4+ ion at body centre(in C-m)\n", + "U = U_1+U_2+U_3;\t\t\t#Total dipole moment(in C-m)\n", + "V = 4.03*((3.98)**2)*10**(-30);\t\t\t#volume(in m3)\n", + "P = U/V;\t\t\t#polarization the total dipole moments per unit volume\n", + "\n", + "# Results\n", + "print 'polarization = %.2f C/m**2'%P\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "polarization = 0.16 C/m**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.6 Page No : 478" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "V = ((2.87)**3)*10**(-30)\t\t\t#Volume of unit cell of BCC iron (in m**3)\n", + "N = 2.\t\t\t#Number of atoms in the unit cell\n", + "\n", + "# Calculation\n", + "M = 1750.*10**3;\t\t\t#saturation magnetization of BCC Iron A/m\n", + "M_Net = V*M*(1./N)\t\t\t#net magnetic moment per atom\n", + "Bohr_magneton = 9.273*10**(-24);\t\t\t#Bohr_magneton (magnetic moment) in A/m2\n", + "M_moment = M_Net/Bohr_magneton;\t\t\t#The magnetic moment (in units of U_B)\n", + "\n", + "# Results\n", + "print 'The magnetic moment (in units of U_B) = %.1f'%M_moment\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The magnetic moment (in units of U_B) = 2.2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.7 Page No : 479" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "p = 8.90*10**6;\t\t\t#density of nickel in gm/m3. \n", + "N_A = 6.023*10**23;\t\t\t#Avogadro\u2019s number atoms/mol\n", + "At_w = 58.71;\t\t\t#Atomic weight of Ni in gm/mol\n", + "\n", + "# Calculation\n", + "N = p*N_A/At_w;\t\t\t#number of atoms/m3\n", + "U_B = 9.273*10**(-24);\t\t\t#Bohr_magneton\n", + "M_s = 0.60*U_B*N;\t\t\t#saturation magnetization\n", + "pi = 22./7;\n", + "U_o = 4*pi*10**(-7);\t\t\t#magnetic consmath.tant\n", + "B_s = U_o*M_s;\t\t\t#Saturation flux density\n", + "\n", + "# Results\n", + "print 'the saturation magnetization = %.1e'%M_s\n", + "print 'Saturation flux density = %.2f'%B_s\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the saturation magnetization = 5.1e+05\n", + "Saturation flux density = 0.64\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.8 Page No : 479" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "#Each cubic unit cell of ferrous ferric oxide contains 8 Fe2+ and 16 Fe3+ ions and\n", + "n_b = 32;\t\t\t#\n", + "U_B = 9.273*10**(-24);\t\t\t#Bohr_magneton\n", + "\n", + "# Calculation\n", + "a = 0.839*10**(-9);\t\t\t#the unit cell edge length in m\n", + "V = a**3;\t\t\t#volume(in m3)\n", + "M_s = n_b*U_B/V;\t\t\t#the saturation magnetization\n", + "\n", + "# Results\n", + "print 'the saturation magnetization = %.0e A/m'%M_s\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the saturation magnetization = 5e+05 A/m\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.9 Page No : 479" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "\n", + "# Variables\n", + "#hysteresis loss (Ph) and the induced emf loss (Pe) are proportional to the frequency\n", + "#Pe is proportional to the square of the induced emf (Pe)\n", + "#Pe + Ph = 750 W (at 25 Hz)\n", + "#4Pe + 2Ph = 2300 W(at 50Hz)\n", + "#solving equation\n", + "P_e = 800./2;\t\t\t#induced emf loss \n", + "\n", + "# Calculation\n", + "I_d = 4*P_e;\t\t\t#The eddy current loss at the normal voltage and frequency\n", + "\n", + "# Results\n", + "print 'The eddy current loss at the normal voltage and frequency = %.0f W'%I_d\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The eddy current loss at the normal voltage and frequency = 1600 W\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch15.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch15.ipynb new file mode 100644 index 00000000..80dc931f --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch15.ipynb @@ -0,0 +1,197 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ba1924948de9c5df666fb8372fa076fb175eef8afac1d23c28cb6aaf92d05c98" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 15 :\n", + "Semiconductors" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.1 Page No : 520" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "U_n = 1350.\t\t\t#mobility of electron in cm2/volt-sec \n", + "U_h = 480.\t\t\t#hole mobility in cm2/volt-sec\n", + "\n", + "# Calculation\n", + "Sigma = 1.072*10**10\t\t\t#density of electron hole pair per cc at 300\u00b0K for a pure silicon crystal\n", + "e = 1.6*10**(-19);\t\t\t#charge on the electron in C\n", + "Sigma_i = Sigma*e*(U_n+U_h);\t\t\t#Conductivity of pure silicon crystal\n", + "p_i = 1/(Sigma_i);\t\t\t#Resistivity of silicon crystal in Ohm-cm\n", + "P_i = p_i*10**(-2);\t\t\t#Resistivity of silicon crystal in Ohm-m\n", + "\n", + "# Results\n", + "print 'Conductivity of pure silicon crystal = %.2e mho/cm'%Sigma_i\n", + "print 'Resistivity of silicon crystal = %.2e Ohm-m'%P_i\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Conductivity of pure silicon crystal = 3.14e-06 mho/cm\n", + "Resistivity of silicon crystal = 3.19e+03 Ohm-m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.2 Page No : 521" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "U = 1200;\t\t\t#electron mobility in cm2/Volt-sec\n", + "e = 1.6*10**(-19);\t\t\t#charge on the electron in C\n", + "\n", + "# Calculation\n", + "n = 10**13;\t\t\t#concentration of phosphorus\n", + "sigma = U*e*n;\t\t\t#conductivity of crystal in mho/cm\n", + "p_i = 1/sigma;\t\t\t#resistivity of silicon wafer if all donor atom are active\n", + "\n", + "# Results\n", + "print 'resistivity of silicon wafer if all donor atom are active is %.1e ohm-cm'%p_i\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "resistivity of silicon wafer if all donor atom are active is 5.2e+02 ohm-cm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.3 Page No : 521" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "U_n = 3900\t\t\t#mobility of electron in cm2/volt-sec \n", + "U_h = 1900\t\t\t#hole mobility in cm2/volt-sec\n", + "n_i = 2.5*10**13;\t\t\t#concentration of electron\n", + "u_n = U_n*10**(-4);\t\t\t#mobility of electron in m2/volt-sec \n", + "u_h = U_h*10**(-4);\t\t\t#hole mobility in m2/volt-sec\n", + "e = 1.6*10**(-19);\t\t\t#charge on the electron in C\n", + "\n", + "# Calculation\n", + "Sigma_i = n_i*e*(u_n+u_h)*10**6;\t\t\t#Conductivity\n", + "p_i = 1/(Sigma_i);\t\t\t#resistivity of intrinsic germanium rod\n", + "l = 1*10**(-2);\t\t\t#length of germanium rod in m\n", + "w = 1*10**(-3);\t\t\t#width of germanium rod in m\n", + "t = 1*10**(-3);\t\t\t#thick of germanium rod in m\n", + "A = w*t;\t\t\t#Area of cross section in m2\n", + "R = p_i*l/A;\t\t\t#Resistance of an intrinsic germanium rod in Ohm\n", + "\n", + "# Results\n", + "print 'Resistance of an intrinsic germanium rod is %.2f K-Ohm'%(R/10**3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resistance of an intrinsic germanium rod is 4.31 K-Ohm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15.4 Page No : 521" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N_a = 1.1*10**20;\t\t\t#acceptor density in atoms/m3\n", + "n_i = 2.5*10**19;\t\t\t#concentration of majority carrier per m3 \n", + "\n", + "# Calculation\n", + "n_p = (n_i**2)/N_a;\t\t\t#intrinsic density \n", + "R = n_p/n_i;\t\t\t#Ratio of n_p and n_i\n", + "\n", + "# Results\n", + "print 'n_p/n_i = %.2f'%R\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "n_p/n_i = 0.23\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch16.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch16.ipynb new file mode 100644 index 00000000..3588418c --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch16.ipynb @@ -0,0 +1,70 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:56faf14394c3ea1277cb1f85c7bc70faefc404ada370b067ab1e7cf4d70ea9ba" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 16 :\n", + "Superconductivity and\n", + "Superconducting Materials" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16.1 Page No : 551" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "T_c = 4.2;\t\t\t#critical temperature of mercury\n", + "k = 1.4*10**(-23);\t\t\t#\n", + "e = 1.6*10**(-19);\t\t\t#charge on the electron \n", + "\n", + "# Calculation\n", + "E_g = 3*k*T_c;\t\t\t#energy gap (in Joule)\n", + "E = E_g/e;\t\t\t#energy gap (in electron volt)\n", + "h = 6.6*10**(-34)\t\t\t# in J-s\n", + "c = 3*10**8;\t\t\t#in m/s\n", + "wavelength = h*c/E_g;\t\t\t#wavelength of a photon (in m)\n", + "\n", + "# Results\n", + "print 'energy gap = %.1e ev'%E\n", + "print 'wavelength of a photon = %.1e m'%wavelength\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "energy gap = 1.1e-03 ev\n", + "wavelength of a photon = 1.1e-03 m\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch18.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch18.ipynb new file mode 100644 index 00000000..304b44ec --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch18.ipynb @@ -0,0 +1,104 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c178e1bd9fc41dc391bdd628b47b12bf3cc848e75815d75ccf67815a215adacd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 18 :\n", + "Composites" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 18.1 Page No : 610" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "E_f = 69;\t\t\t#modulus of elasticity in GPa\n", + "V_f = 40./100;\t\t\t#Volume of glass fibres %\n", + "E_m = 3.4;\t\t\t#modulus (in GPa)\n", + "V_m = 60./100;\t\t\t#Volume of polyester remath.sin %\n", + "\n", + "# Calculation\n", + "E_cl = E_m*V_m+E_f*V_f;\t\t\t#modulus of elasticity (in Gpa)\n", + "\n", + "# Results\n", + "print 'Modulus of elasticity is %.0f Gpa'%(E_cl)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Modulus of elasticity is 30 Gpa\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 18.2 Page No : 611" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "E_f = 69;\t\t\t#modulus of elasticity in GPa\n", + "V_f = 40./100;\t\t\t#Volume of glass fibres %\n", + "E_m = 3.4;\t\t\t#modulus (in GPa)\n", + "V_m = 60./100;\t\t\t#Volume of polyester remath.sin %\n", + "\n", + "# Calculation\n", + "E_cl = E_m*E_f/(E_m*V_f+E_f*V_m);\t\t\t#modulus of elasticity when the stress is applied perpendicular to the direction of the fibre alignment(in Gpa)\n", + "\n", + "# Results\n", + "print 'modulus of elasticity when the stress is applied perpendicular to the direction of the fibre alignment = %.1f Gpa'%E_cl\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "modulus of elasticity when the stress is applied perpendicular to the direction of the fibre alignment = 5.5 Gpa\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch2.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch2.ipynb new file mode 100644 index 00000000..4478311a --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch2.ipynb @@ -0,0 +1,516 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 : Atomic structure and electronic configuration" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1 Page No : 32" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance of the closest approach alpha particles from the copper nucleus(in meter) = 1.668e-14\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "# Variables\n", + "Eg_k = 5.; #kinetic energy of alpha particles(in MeV)\n", + "Eg_K = 5.*(10**6)*1.6*(10**-19); #kinetic energy of alpha particles(in J)\n", + "mv2 = 2.*Eg_K;\n", + "pi = 22./7;\n", + "phi = 180.; #firing angle\n", + "Z = 29.; #Atomic number\n", + "\n", + "# Calculation\n", + "e = 1.6*(10**-19);\t\t\t#electron charge(in C)\n", + "Eo = 8.85*10**-12;\t\t\t#permittivity of free space\n", + "d = (Z*e**2/(2*pi*Eo*mv2))*(1+1)\t\t\t#;\n", + "\n", + "# Results\n", + "print 'distance of the closest approach alpha particles from the copper nucleus(in meter) = %.3e'%d\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2 Page No : 33" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "first orbit radius of hydrogen atom(in m) = 5.3077e-11\n", + "Orbital frequency of electron(in Hz) = 6.5407e+15\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n", + "m = 9.1*10**(-31);\t\t\t#mass of electron(in Kg)\n", + "E_o = 8.854*10**(-12);\t\t\t#permittivity of free space\n", + "h = 6.625*10**(-34);\t\t\t#Planck constant\n", + "n = 1;\t\t\t#Orbit number\n", + "Z = 1;\t\t\t#atomic number\n", + "pi = 22./7;\n", + "\n", + "# Calculation and Results\n", + "r_1 = (E_o*n**2*h**2)/(pi*m*Z**2*e**2);\t\t\t#first orbit radius of hydrogen atom\n", + "print 'first orbit radius of hydrogen atom(in m) = %.4e'%r_1\n", + "Freq = m*(Z**2)*(e**4)/(4*(E_o**2)*(n**3)*h**3);\t\t\t#\n", + "print 'Orbital frequency of electron(in Hz) = %.4e'%Freq\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3 Page No : 33" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "radius of the second bohr orbit in a math.singly ionized helium atom(in A) = 1.058\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "Z_1 = 1;\t\t\t#atomic number for hydrogen\n", + "n_1 = 1;\t\t\t#first orbit\n", + "r_1 = 0.529;\t\t\t#radius of first orbit of electron for hydrogen \n", + "Z_2 = 2;\t\t\t#atomic number for helium\n", + "n_2 = 2;\t\t\t#second orbit\n", + "\n", + "# Calculation\n", + "k = r_1*Z_1/n_1;\n", + "r_2 = k*((n_2)**2)/Z_2;\t\t\t#radius of first orbit of electron for helium\n", + "\n", + "# Results\n", + "print 'radius of the second bohr orbit in a math.singly ionized helium atom(in A) = ',r_2\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4 Page No : 33" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of energy released = 1.1852\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "n_1 = 1;\t\t\t#first orbit\n", + "n_2 = 2;\t\t\t#second orbit\n", + "n_3 = 3;\t\t\t#third orbit\n", + "\n", + "# Calculation\n", + "#E_1 = -13.6*(Z**2)/(1**2);\n", + "#E_2 = -13.6*(Z**2)/(2**2);\n", + "#E_3 = -13.6*(Z**2)/(3**2);\n", + "#E_3-E_1 = -13.6*(Z**2)*(-8/9);\n", + "#E_2-E_1 = -13.6*(Z**2)*(-3/4);\n", + "E_1 = -13.6/(1**2);\t\t\t#energy of electron in the first bohr orbit of an atom\n", + "E_2 = -13.6/(2**2);\t\t\t#energy of electron in the second bohr orbit of an atom\n", + "E_3 = -13.6/(3**2);\t\t\t#energy of electron in the third bohr orbit of an atom\n", + "\n", + "# Results\n", + "print 'ratio of energy released = %.4f'%((E_3-E_1)/(E_2-E_1))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5 Page No : 34" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "revolutions per second of an electron in the bohr orbit of hydrogen atom = 7.516e+15\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "m = 9.1*10**(-31);\t\t\t#electron mass (in Kg)\n", + "Z = 1;\t\t\t#atomic number\n", + "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n", + "E_o = 8.25*10**(-12);\t\t\t#permittivity of free space\n", + "n = 1;\t\t\t#first bohr orbit\n", + "\n", + "# Calculation\n", + "h = 6.63*10**(-34);\t\t\t#planck consmath.tant\n", + "R_ps = m*(e**4)/(4*(E_o**2)*(h**3));\t\t\t#number of revolutions per second\n", + "\n", + "# Results\n", + "print 'revolutions per second of an electron in the bohr orbit of hydrogen atom = %.3e'%R_ps\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6 Page No : 35" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "orbital frequency of an electron in the first bohr orbit in a hydrogen atom(in Hz) = 6.532e+15\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "n = 1.;\t\t\t#first bohr orbit\n", + "Z = 1.;\t\t\t#atomic number\n", + "\n", + "# Calculation\n", + "m = 9.1*10**(-31);\t\t\t#electron mass in Kg.\n", + "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n", + "E_o = 8.85*10**(-12);\t\t\t#permittivity of free space\n", + "h = 6.63*10**(-34);\t\t\t#planck constant\n", + "v_n = m*(Z**2)*(e**4)/(4*(E_o**2)*(h**3)*(n**3));\t\t\t#orbital frequency of an electron in the first bohr orbit in a hydrogen atom\n", + "\n", + "# Results\n", + "print 'orbital frequency of an electron in the first bohr orbit in a hydrogen atom(in Hz) = %.3e'%v_n\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7 Page No : 35" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total energy in = -13.6 eV\n", + "kinetic energy in = 13.6 eV\n", + "potential energy in = -27.2 eV\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "m = 9.11*10**-31;\t\t\t#mass of electron(in Kg)\n", + "Z = 1; \t\t\t#atomic number\n", + "n = 1;\t\t\t #first bohr orbit\n", + "\n", + "# Calculation\n", + "E_o = 8.854*10**-12;\t\t\t#permittivity of free space\n", + "h = 6.625*10**-34;\t\t\t#planck consmath.tant\n", + "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n", + "E_k = (m*(Z**2)*(e**4))/(8*(E_o**2)*(n**2)*(h**2));\t\t\t#Kinetic energy(in joule)\n", + "E = E_k/e;\t\t\t#Kinetic energy(in eV)\n", + "E_t = -13.6*(Z**2/n**2);\t\t\t#Total Energy(in eV)\n", + "E_p = E_t-E;\t\t\t#Potential energy(in eV)\n", + "\n", + "# Results\n", + "print 'Total energy in = %.1f eV'%E_t\n", + "print 'kinetic energy in = %.1f eV'%E\n", + "print 'potential energy in = %.1f eV'%E_p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8 Page No : 35" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of electron in hydrogen atom in bohr first orbit(in meter/sec) = 2.189e+06\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.626*10**-34;\t\t\t#planck consmath.tant\n", + "E_o = 8.825*10**-12;\t\t\t#permittivity of free space\n", + "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n", + "n = 1;\t\t\t#first bohr orbit\n", + "Z = 1;\t\t\t#atomic number\n", + "\n", + "# Calculation\n", + "v = Z*(e**2)/(2*E_o*n*h);\t\t\t#velocity of electron in hydrogen atom in bohr first orbit\n", + "\n", + "# Results\n", + "print 'velocity of electron in hydrogen atom in bohr first orbit(in meter/sec) = %.3e'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9 Page No : 35" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "principal quntum number when 10.2 eV energy excites electron = 2\n", + "wavelength of radiation when 10.2 eV energy excites electron(in A) = 1216\n", + "principal quntum number when 12.09 eV energy excites electron = 3\n", + "wavelength of radiation when 12.09 eV energy excites electron in = 1026 A\n" + ] + } + ], + "source": [ + "\n", + "\n", + "import math \n", + "\n", + "\n", + "# Variables\n", + "n_1 = 1.;\t\t\t#electron excited from ground state\n", + "h = 6.62*10**-34;\t\t\t#Planck consmath.tant\n", + "c = 3.*10**8;\t\t\t#speed of light\n", + "E_o = 8.825*10**-12;\t\t\t#permittivity of free space\n", + "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n", + "m = 9.11*10**-31;\t\t\t#mass of electron(in Kg)\n", + "E_1 = 10.2;\t\t\t#energy excites the hydrogen from ground level(in eV)\n", + "\n", + "# Calculation and Results\n", + "K = m*e**4/(8*(E_o**2)*(h**2))\t\t\t#in joule\n", + "K_e = K/e;\t\t\t#in eV\n", + "#E_1 = K_e*((1/n_1**2)-(1/n**2))\n", + "#1/(n**2) = 1/(n_1**2)-E_1/K_e\n", + "#n**2 = 1/(1/(n_1**2)-E_1/K_e)\n", + "n = (1/(1/(n_1**2)-E_1/K_e))**(1./2);\t\t\t#principal quntum number when 10.2 eV energy excites electron\n", + "print 'principal quntum number when 10.2 eV energy excites electron = %.f'%(n)\n", + "\n", + "W_1 = h*c/(E_1*e)*10**10;\t\t\t#wavelength of radiation when 10.2 eV energy excites electron\n", + "print 'wavelength of radiation when 10.2 eV energy excites electron(in A) = %d'%W_1\n", + "\n", + "E_2 = 12.09;\t\t\t#energy excites the hydrogen from ground level(in eV)\n", + "n_2 = (1./(1./(n_1**2)-E_2/K_e))**(1./2);\t\t\t#principal quntum number when 12.09 eV energy excites electron\n", + "W_2 = h*c/(E_2*e)*10**10;\t\t\t#wavelength of radiation when 12.09 eV energy excites electron\n", + "print 'principal quntum number when 12.09 eV energy excites electron = %.f'%(n_2)\n", + "print 'wavelength of radiation when 12.09 eV energy excites electron in = %d A'%W_2\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.13 Page No : 58" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "weight of one atom in 1.055e-22 gm\n", + "weight of one proton in 1.675e-24 gm\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "At_w = 63.54;\t\t\t#atomic weight of copper\n", + "N = 6.023*10**23;\t\t\t#avogadro's number\n", + "\n", + "# Calculation\n", + "W_a = At_w/N;\t\t\t#weight of one atom(in gm)\n", + "W_p = W_a/63;\t\t\t#weight of one proton(in gm)\n", + "\n", + "# Results\n", + "print 'weight of one atom in %.3e gm'%W_a\n", + "print 'weight of one proton in %.3e gm'%W_p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.15 Page No : 59" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percentage of Si in Copper silicide Cu_5_Si is = 8.12 %\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "Atw_Cu = 63.54;\t\t\t#atomic weight of copper\n", + "Atw_Si = 28.09;\t\t\t#atomic weight of silicon\n", + "\n", + "# Calculation\n", + "# 5 atoms of copper working in Cu_5_Si\n", + "Tw_Cu = 5*Atw_Cu;\t\t\t#total weight of copper used in copper silicide\n", + "Tw_Si = Atw_Si;\t\t\t#total weight of silicon used in copper silicide\n", + "Percentage = (Tw_Si/(Tw_Cu+Tw_Si))*100;\t\t\t#percentage of Si in Copper silicide\n", + "\n", + "# Results\n", + "print 'percentage of Si in Copper silicide Cu_5_Si is = %.2f %%'%Percentage\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch3.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch3.ipynb new file mode 100644 index 00000000..e5b64fc1 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch3.ipynb @@ -0,0 +1,923 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3 : Crystal Geometry Structure and Defects" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10 Page No : 91" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle Between normals to the planes (111) and (121)(in degrees) = 19.47\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "from numpy import degrees, arccos\n", + "\n", + "# Variables\n", + "#Miller indices of plane\n", + "h_1 = 1.;\n", + "k_1 = 1.;\n", + "l_1 = 1.;\n", + "h_2 = 1.;\n", + "k_2 = 2.;\n", + "l_2 = 1.;\n", + "\n", + "# Calculation\n", + "angle = degrees(arccos((h_1*h_2+k_1*k_2+l_1*l_2)/(((h_1**2+k_1**2+l_1**2)**(1./2))*((h_2**2+k_2**2+l_2**2)**(1./2)))))\n", + "\n", + "# Results\n", + "print 'angle Between normals to the planes (111) and (121)(in degrees) = %.2f'%angle\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11 Page No : 91" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Packing efficiency of sodium chloride in = 66.3 %\n", + "density of sodium chloride in = 2233 Kg/m3\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "r_Na = 0.98;\t\t\t#Radius of Na+(in A)\n", + "r_Cl = 1.81;\t\t\t#Radius of Cl-(in A)\n", + "a = 2*(r_Na+r_Cl);\t\t\t#Lattice parameter (in A)\n", + "\n", + "# Calculation\n", + "pi = 22./7;\n", + "V_i = 4*(4./3)*pi*((r_Na**3)+(r_Cl**3));\t\t\t#Volume of ions present in unit cell\n", + "V_u = a**3;\t\t\t#Volume of unit cell\n", + "Apf = V_i/V_u;\t\t\t#Atomic packing fraction\n", + "Ef_p = (Apf)*100;\t\t\t#Packing efficiency(in %)\n", + "AM_sodium = 22.99;\t\t\t#Atomic mass of sodium(in amu)\n", + "AM_chlorine = 35.45;\t\t\t#Atomic mass of chlorine(in amu)\n", + "M_1 = 4*(AM_sodium+AM_chlorine)*1.66*10**(-27);\t\t\t#Mass of the unit cell\n", + "a_1 = a*10**(-10);\t\t\t#Lattice parameter (in meter)\n", + "V_u1 = (a_1)**3;\n", + "Density = M_1/V_u1;\n", + "\n", + "# Results\n", + "print 'Packing efficiency of sodium chloride in = %.1f %%'%Ef_p\n", + "print 'density of sodium chloride in = %.0f Kg/m3'%Density\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.12 Page No : 91" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "radius in = 4.049 A\n", + "Diameter in 2.86 A\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "Density = 2.7;\t\t\t#(in g/cm**3)\n", + "n = 4;\n", + "m = 26.98;\t\t\t#atomic weight of Al\n", + "\n", + "# Calculation and Results\n", + "N_a = 6.023*10**(23);\t\t\t #avogadro number\n", + "a = ((n*m/(Density*N_a))**(1./3));\t\t\t#Lattice parameter(in Cm)\n", + "A = a*10**(8);\t\t\t #Lattice parameter(in A)\n", + "print 'radius in = %.3f A'%A\n", + "r = A/(2*1.414);\t\t\t#radius for fcp structure\n", + "print 'Diameter in %.2f A'%(2*r)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.13 Page No : 92" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "interplaner distance of (200) plane of nickel crystal in = 1.76 A\n", + "interplaner distance of (111) plane of nickel crystal in = 2.03 A\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "r = 1.245;\t\t\t#radius of nickel (in A)\n", + "a = 4*r/(2)**(1./2);\t\t\t#Lattice consmath.tant(in A)\n", + "#Miller indices of plane 200\n", + "h_1 = 2;\n", + "k_1 = 0;\n", + "l_1 = 0;\n", + "#Miller indices of plane 111\n", + "h_2 = 1;\n", + "k_2 = 1;\n", + "l_2 = 1;\n", + "\n", + "# Calculation\n", + "d_200 = a/((h_1**2)+(k_1**2)+(l_1**2))**(1./2);\n", + "d_111 = a/((h_2**2)+(k_2**2)+(l_2**2))**(1./2);\n", + "\n", + "# Results\n", + "print 'interplaner distance of (200) plane of nickel crystal in = %.2f A'%d_200\n", + "print 'interplaner distance of (111) plane of nickel crystal in = %.2f A'%d_111\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.14 Page No : 92" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number of atoms in the (100) plane of a simple cubic structure(in per mm**2) = 1.09e+13\n", + "Number of atoms in the (110) plane of a simple cubic structure(in per mm**2) = 7.7e+12\n", + "Number of atoms in the (111) plane of a simple cubic structure(in per mm**2) = 6.3e+12\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "a = 3.03*10**(-7);\t\t\t#lattice consmath.tant(in mm)\n", + "\n", + "# Calculation\n", + "N_100 = 1/(a**2);\t\t\t#Number of atoms in the (100) plane of a simple cubic structure\n", + "N_110 = 0.707/(a**2);\t\t\t#Number of atoms in the (110) plane of a simple cubic structure\n", + "N_111 = 0.58/(a**2);\t\t\t#Number of atoms in the (111) plane of a simple cubic structure\n", + "\n", + "# Results\n", + "print 'Number of atoms in the (100) plane of a simple cubic structure(in per mm**2) = %.2e'%N_100\n", + "print 'Number of atoms in the (110) plane of a simple cubic structure(in per mm**2) = %.1e'%N_110\n", + "print 'Number of atoms in the (111) plane of a simple cubic structure(in per mm**2) = %.1e'%N_111\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.15 Page No : 92" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the planer density of Ni (in atoms per mm**2) = 1.6e+13\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "r = 1.245*10**(-7);\t\t\t#Radius of the Ni atom(in mm)\n", + "\n", + "# Calculation\n", + "NA_100 = 1+(1./4)*4;\t\t\t#Numbers of atom in (100) plane\n", + "a = 4*r/(2)**(1./2);\t\t\t#Lattice consmath.tant(in mm)\n", + "Area = a**2;\n", + "P_density = NA_100/Area;\n", + "\n", + "# Results\n", + "print 'the planer density of Ni (in atoms per mm**2) = %.1e'%P_density\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.16 Page No : 93" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Planar density of plane 100(in atoms/mm**2) = 8.2e+12\n", + "Planar density of plane 110(in atoms/mm**2) = 5.8e+12\n", + "Planar density of plane 111(in atoms/mm**2) = 9.4e+12\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N_a1 = 4*(1./4)+1;\t\t\t#Number of atoms contained in (100) plane\n", + "r = 1.75*10**(-7);\t\t\t#radius of lead atom (in mm)\n", + "a_1 = 2*2**(1./2)*r;\t\t\t#edge of unit cell in case of (100) plane\n", + "PD_100 = N_a1/(a_1**2);\t\t\t#Planar density of plane (100)\n", + "\n", + "# Calculation\n", + "N_a2 = 4*(1./4)+2*(1./2);\t\t\t#Number of atoms contained in (110) plane\n", + "a_21 = 4*r;\t\t\t#top edge of the plane (110)\n", + "a_22 = 2*2**(1./2)*r;\t\t\t#vertical edge of the plane (110)\n", + "PD_110 = N_a2/(a_21*a_22);\t\t\t#Planar density of plane (110)\n", + "N_a3 = 3*(1./6)+3./2;\t\t\t#Number of atom contained in (111) plane\n", + "Ar_111 = 4*(3**(1./2))*r**2;\t\t\t#area of (111) plane\n", + "PD_111 = N_a3/Ar_111;\t\t\t#Planar density of plane (111)\n", + "\n", + "# Results\n", + "print 'Planar density of plane 100(in atoms/mm**2) = %.1e'%PD_100\n", + "print 'Planar density of plane 110(in atoms/mm**2) = %.1e'%PD_110\n", + "print 'Planar density of plane 111(in atoms/mm**2) = %.1e'%PD_111\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.17 Page No : 94" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "linear atomic density along (110) of copper crystal lattice in = 3.92e+06 atoms/mm\n", + "linear atomic density along (111) of copper crystal lattice in = 1.60e+06 atoms/mm\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N_a1 = (1./2)+1+(1./2);\t\t\t#Number of diameters of atom along (110) direction\n", + "a = 3.61*10**(-7);\t\t\t#lattice consmath.tant of copper in mm\n", + "\n", + "# Calculation\n", + "L_d1 = 2**(1./2)*a;\t\t\t#length of the face diagonal in case of (110) direction\n", + "p_110 = N_a1/L_d1;\t\t\t#linear atomic density along (110) of copper crystal lattice(in atoms/mm)\n", + "N_a2 = (1./2)+(1./2);\t\t\t#Number of diameters of atom along (111) direction\n", + "L_d2 = 3**(1./2)*a;\t\t\t#length of the face diagonal in case of (111) direction\n", + "p_111 = N_a2/L_d2;\t\t\t#linear atomic density along (110) of copper crystal lattice(in atoms/mm)\n", + "\n", + "# Results\n", + "print 'linear atomic density along (110) of copper crystal lattice in = %.2e atoms/mm'%p_110\n", + "print 'linear atomic density along (111) of copper crystal lattice in = %.2e atoms/mm'%p_111\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.18 Page No : 95" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of lattice constant in = 2.867 A\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "A = 55.8;\t\t\t#atomic weight of Fe\n", + "n = 2;\t\t\t#number of atoms per unit cell\n", + "\n", + "# Calculation\n", + "N = 6.02*10**(26);\t\t\t#Avogadro's number\n", + "p = 7.87*10**3;\t\t\t#density of Fe(in kg/m**3)\n", + "a = ((A*n/(N*p))**(1./3))*10**10;\t\t\t#Value of lattice consmath.tant\n", + "\n", + "# Results\n", + "print 'Value of lattice constant in = %.3f A'%a\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.19 Page No : 95" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numbers of atoms per unit cell = 2.0\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "\n", + "# Variables\n", + "a = 2.9*10**(-10);\t\t\t#lattice parameter(in m)\n", + "A = 55.8;\t\t\t#atomic weight of Fe\n", + "\n", + "# Calculation\n", + "N = 6.02*10**(26);\t\t\t#Avogadro's number\n", + "p = 7.87*10**3;\t\t\t#density of Fe(in kg/m**3\n", + "n = (a**3)*N*p/A;\t\t\t#Numbers of atoms per unit cell\n", + "\n", + "# Results\n", + "print 'Numbers of atoms per unit cell = ',floor(n)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.20 Page No : 109" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "line energy of disslocation in = 2.47e-09 J/m\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "a = 2.87*10**(-10);\t\t\t#lattice parameter for bcc iron\n", + "b = a*(3**(1./2))/2;\t\t\t#Magnitude of burgers vector\n", + "\n", + "# Calculation\n", + "u = 80*10**9;\t\t\t#shear modulus\n", + "E = (1./2)*u*b**2;\t\t\t#line energy of disslocation\n", + "\n", + "# Results\n", + "print 'line energy of disslocation in = %.2e J/m'%E\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.22 Page No : 109" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of vacancies created during heating in = 6.54e+23 m**-3\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N = 6.023*10**23;\t\t\t#avogadro number\n", + "T = 1000.;\t\t\t#absolute temperature\n", + "R = 8.314;\t\t\t#consmath.tant\n", + "\n", + "# Calculation\n", + "H_f = 100*1000;\t\t\t#enthalpy of formation of vacancies(in J/mol)\n", + "n = N*math.exp(-(H_f)/(R*T));\t\t\t#number of vacancies created during heating(in per mol)\n", + "V = 5.5*10**(-6);\t\t\t#volume of 1 mole of the crystal in m**3\n", + "n_1 = n/V;\t\t\t#number of vacancies created during heating(in per m**3)\n", + "\n", + "# Results\n", + "print 'number of vacancies created during heating in = %.2e m**-3'%n_1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.23 Page No : 109" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Surface energy (enthalpy) of copper in = 2.49 J/m**2\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "#bond energy per atom of copper = bond energy per bond*numbers of bond per atom*(1/2)\n", + "A = 56.4*1000;\t\t\t#\n", + "N = 6.023*10**23;\t\t\t#avogadro number\n", + "n_1 = 12.;\t\t\t#numbers of bond per atom\n", + "n_2 = 3.;\t\t\t#bonds broken at the surface\n", + "\n", + "# Calculation and Results\n", + "E = A*n_1/(2*N);\t\t\t#Energy of total bonds\n", + "E_b = E*(n_2/n_1);\t\t\t#Energy of broken bonds on surface\n", + "n_a = 1.77*10**19;\t\t\t#no. of atoms on {111} planes in copper(in m**-2)\n", + "E_c = n_a*E_b;\t\t\t#Surface energy (enthalpy) of copper\n", + "print 'Surface energy (enthalpy) of copper in = %.2f J/m**2'%E_c\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.24 Page No : 110" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "equilibrium concentration of vacancies in aluminium at 300 K = 1.44e-12\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "H_f = 68.*1000;\t\t\t#enthalpy of formation of vacancies(in J/mol)\n", + "T_1 = 0;\t\t\t#temp (in K)\n", + "T_2 = 300.;\t\t\t#temp (in K)\n", + "R = 8.314;\t\t\t#consmath.tant\n", + "\n", + "# Calculation\n", + "\n", + "n = math.exp(-H_f/(R*T_2));\t\t\t#equilibrium concentration of vacancies in aluminium at 300 K\n", + "\n", + "# Results\n", + "print 'equilibrium concentration of vacancies in aluminium at 300 K = %.2e'%n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.25 Page No : 113" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the interplanar spacing between atomic plane in = 2.22 A\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "Wavelength = 1.54*10**(-10);\t\t\t#in meter\n", + "Angle = 20.3;\t\t\t#in degree\n", + "n = 1;\t\t\t#First order\n", + "\n", + "# Calculation\n", + "d = Wavelength*n/(2*math.sin(math.radians(Angle)));\t\t\t#the interplanar spacing(in Meter)\n", + "\n", + "# Results\n", + "print 'the interplanar spacing between atomic plane in = %.2f A'%(d/(10**-10))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.26 Page No : 113" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Size of unit cell in 3.51 Angstrom\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "wavelength = 0.58;\t\t\t#in Angstrom\n", + "angle = 9.5;\t\t\t#in degree\n", + "n = 1;\t\t\t#First order\n", + "\n", + "# Calculation\n", + "#d_200 = wavelength*n/(2*math.sin(math.radians(angle)));\t\t\t#interplanar spacing(in Angstrom)\n", + "d_200 = n/math.sqrt(2**2+0**2+0**2)\n", + "#Miller indices of plane\n", + "h = 2;\n", + "k = 0;\n", + "l = 0;\n", + "a = 0.58/(math.sin(math.radians(angle))*2*d_200);\t\t\t#Size of unit cell(in Angstrom)\n", + "# Results\n", + "print 'Size of unit cell in %.2f Angstrom'%a\n", + "\n", + "# book answer is wrong." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.27 Page No : 114" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bragg angle(in degree) = 7.527\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "#Miller indices of plane\n", + "h = 1.;\n", + "k = 1.;\n", + "l = 1.;\n", + "wavelength = 0.54;\t\t\t#in angstrom\n", + "a = 3.57;\t\t\t#size of a cube\n", + "n = 1;\n", + "\n", + "# Calculation\n", + "d_111 = a/(h**2+k**2+l**2)**(1./2);\t\t\t#interplanar spacing(in Angstrom)\n", + "sinangle = (n*wavelength)/(2*d_111)\n", + "angle = math.degrees(math.asin(sinangle))\n", + "\n", + "# Results\n", + "print 'Bragg angle(in degree) = %.3f'%angle\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.28 Page No : 114" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bragg reflection index for BCC crystal = 1.53\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "d = 1.181;\t\t\t #A\n", + "wavelength = 1.540;\t #in angstrom\n", + "angle = 90;\t\t\t #in degrees\n", + "\n", + "# Calculation\n", + "n = 2*d*math.sin(math.radians(angle))/(wavelength);\t\t\t#the bragg reflection index\n", + "\n", + "# Results\n", + "print 'Bragg reflection index for BCC crystal = %.2f'%n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.29 Page No : 114" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3rd order reflection angle = 31.40\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "n_1 = 1;\t\t\t#1st order reflection index\n", + "angle_1 = 10;\t\t\t#1st order reflection angle\n", + "n_3 = 3;\t\t\t#3rd order reflection index\n", + "\n", + "# Calculation\n", + "#math.math.sin(math.radians(angle_1)/math.math.sin(math.radians(angle_3) = n_1/n_3\n", + "sinangle_3 = n_3 * math.sin(math.radians(angle_1)/n_1);\t\t\t#\n", + "angle_3 = math.degrees(math.asin(sinangle_3))\n", + "\n", + "# Results\n", + "print '3rd order reflection angle = %.2f'%angle_3\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.30 Page No : 115" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "interplanar spacing of reflection plane 2.22 A\n", + "miller indices of the reflection plane 2.0\n", + "((110),(101),(011))\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "angle = 20.3;\t\t\t#in degree\n", + "wavelength = 1.54;\t\t\t#in angstrom\n", + "n = 1;\n", + "a = 3.16;\t\t\t#lattice parameter in angstrom\n", + "\n", + "# Calculation\n", + "d = n*wavelength/(2*math.sin(math.radians(angle)));\t\t\t#interplanar spacing\n", + "M_indices = a**2/(d**2);\n", + "\n", + "# Results\n", + "print 'interplanar spacing of reflection plane %.2f A'%d\n", + "print 'miller indices of the reflection plane',floor(M_indices)\n", + "print \"((110),(101),(011))\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.31 Page No : 115" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "interatomic spacing(in angstrom) = 3.46\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "#Miller indices of plane\n", + "n = 1;\n", + "h = 1;\n", + "k = 1;\n", + "l = 1;\n", + "angle = 30;\t\t\t#in degree\n", + "wavelength = 2;\t\t\t#in angstrom\n", + "\n", + "# Calculation\n", + "d = n*wavelength/(2*math.sin(math.radians(angle)));\t\t\t#interplanar spacing\n", + "a = d*(h**2+k**2+l**2)**(1./2);\t\t\t#interatomic spacing\n", + "\n", + "# Results\n", + "print 'interatomic spacing(in angstrom) = %.2f'%a\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch4.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch4.ipynb new file mode 100644 index 00000000..0ac988cf --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch4.ipynb @@ -0,0 +1,285 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:10485c06d3141b9088340f19ea6a7420664af7ae170cac60ae1844a81a9e618f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 :\n", + "Bonds in solid" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 Page No : 137" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "r_o = 2.8\t\t\t#interatomic distance in \u00c5\n", + "R_o = 2.8*10**(-10);#interatomic distance in m\n", + "u_o = 8.;\t\t\t#released energy in eV\n", + "e = 1.6*10**(-19);\t#charge of electron in C\n", + "U_o = 8.*e\t\t\t#released energy in Joule\n", + "\n", + "# Calculation\n", + "A = (5./4)*U_o*(R_o**2);\t\t\t#proportionality constant for attraction in J-m2\n", + "B = A*(R_o**8)/5;\t\t\t#proportionality constant for repulsion in J-m2\n", + "r_c = (110*B/(6*A))**(1./8);\t\t\t#interatomic distance at which the dissociation occurs in m\n", + "F = -(2/r_c**3)*(A-5*B/(r_c**8));\t\t\t#the force required to dissociate the molecule in N\n", + "\n", + "# Results\n", + "print 'proportionality constant for attraction = %.2e J-m2'%A\n", + "print 'proportionality constant for repulsion = %.2e J-m2'%B\n", + "print 'interatomic distance at which the dissociation occurs = %.2e m'%r_c\n", + "print 'the force required to dissociate the molecule = %.2e N'%F\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "proportionality constant for attraction = 1.25e-37 J-m2\n", + "proportionality constant for repulsion = 9.48e-115 J-m2\n", + "interatomic distance at which the dissociation occurs = 3.29e-10 m\n", + "the force required to dissociate the molecule = -5.11e-09 N\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 Page No : 138" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "r_o = 3.14;\t\t\t#nearest neighbour equilibrium distance in \u00c5\n", + "R_o = 3.14*10**(-10);\t\t\t#nearest neighbour equilibrium distance in m\n", + "K = 5.747*10**(-11);\t\t\t#compressibility of KCl in m2/N\n", + "M = 1.748;\t\t\t#Madelung constant\n", + "pi = 22./7;\n", + "\n", + "# Calculation\n", + "E_o = 8.854*10**(-12);\n", + "q = 1.6*10**(-19);\t\t\t#electron charge\n", + "n = 1+18*(R_o**4)*4*pi*E_o/(K*M*q**2);\n", + "\n", + "# Results\n", + "print 'repulsive exponent n = %.1f'%n\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "repulsive exponent n = 8.6\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 Page No : 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "F_1 = 3.02*10**(-9);\t\t\t#force of attraction b/w ions of Na+ and Cl-\n", + "Z_1 = +1;\n", + "Z_2 = -1;\n", + "e = 1.6*10**(-19);\n", + "E_o = 8.854*10**-12;\n", + "pi = 22./7;\n", + "r_Na = 0.95;\t\t\t#ionic radius of Na+ ion\n", + "\n", + "# Calculation\n", + "r = (-Z_1*Z_2*e**2/(4*pi*E_o*F_1))**(1./2);\t\t\t#Radius of ion in meter\n", + "R = r/10**(-10);\t\t\t#Radius of ion in Angstrom\n", + "r_Cl = (R-r_Na);\t\t\t#Radius of Cl- ion in Angstrom\n", + "\n", + "# Results\n", + "print 'Ionic Radius of Cl- ion in = %.2f Angstrom'%r_Cl\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Ionic Radius of Cl- ion in = 1.81 Angstrom\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 Page No : 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "Z_1 = +2;\n", + "Z_2 = -2;\n", + "r_Mg = 0.65;\t\t\t#radius of Mg++ ion\n", + "r_S = 1.84;\t\t\t#radius of S-- ion\n", + "r = r_Mg+r_S;\t\t\t#net radius(in Angstrom)\n", + "\n", + "# Calculation\n", + "R = r*10**(-10);\t\t\t#net radius(in meter)\n", + "e = 1.6*10**(-19);\n", + "E_o = 8.854*10**-12;\n", + "pi = 22./7;\n", + "F = -Z_1*Z_2*e**2/(4*pi*E_o*R**2);\t\t\t#force of attraction between ions(in Newton)\n", + "\n", + "# Results\n", + "print 'force of attraction between ions in = %.1e Newton'%F\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "force of attraction between ions in = 1.5e-08 Newton\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 Page No : 150" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "#Na atom requires +5.14 eV of energy. When this electron is transferred to a vacant position,it gives back \u20134.02 eV of energy\n", + "E_1 = +5.14;\t\t\t#in eV\n", + "E_2 = -4.02;\t\t\t#in eV\n", + "\n", + "# Calculation\n", + "NET_energy = E_1+E_2;\t\t\t#in eV\n", + "\n", + "# Results\n", + "print 'Net spent energy in whole process in = %.2f eV'%NET_energy\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net spent energy in whole process in = 1.12 eV\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 Page No : 150" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "Enthalpy = 6.02;\t\t\t#enthalpy of fusion of ice is 6.02 kJ/mol\n", + "E_h = 20.5;\t\t\t#Hydrogen bond energy (in kJ/mol)\n", + "#There are two moles of hydrogen bonds per mole of H2O in ice.\n", + "\n", + "# Calculation\n", + "H_b = Enthalpy/(2*E_h);\t\t\t#the fraction of hydrogen bonds that are broken when ice melts\n", + "\n", + "# Results\n", + "print 'fraction of hydrogen bonds that are broken when ice melts = %.2f'%H_b\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fraction of hydrogen bonds that are broken when ice melts = 0.15\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch5.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch5.ipynb new file mode 100644 index 00000000..fcdb72de --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch5.ipynb @@ -0,0 +1,465 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b05ef4cea534c7f22454c6c7a4371d685f8afba36752efd7c83922caa2a73609" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 :\n", + "Electron Theory of Metals" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 Page No : 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "\n", + "# Variables\n", + "#The probability that a particular quantum state at energy E is filled, is given by\n", + "#f(E) = 1/(1+exp(E-E_f)/kT)\n", + "e = 1.6*10**(-19);\t\t\t#charge on the electron\n", + "dE = 0.5*e;\t\t\t#E-E_f in joule\n", + "\n", + "# Calculation\n", + "#0.01 = 1/(1+exp(x))\n", + "#1+exp(x) = 100\n", + "x = math.log(99);\n", + "k = 1.38*10**(-23);\t\t\t#consmath.tant\n", + "T = dE/(x*k);\t\t\t#temperature\n", + "\n", + "# Results\n", + "print 'temperature at which there is one per cent probability that a state with an energy\\\n", + " 0.5 eV above the Fermi energy will be \\noccupied by an electron in = %.0f K'%round(T)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "temperature at which there is one per cent probability that a state with an energy 0.5 eV above the Fermi energy will be \n", + "occupied by an electron in = 1262 K\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 Page No : 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "n = 10**19;\t\t\t#electrons per m**3\n", + "V = 0.017;\t\t\t#applied voltage \n", + "d = 0.27*10**-2;\t\t\t#dismath.tance with material\n", + "e = 1.602*10**-19;\t\t\t#in coulomb\n", + "m = 9.1*10**-31;\t\t\t#mass of an electron(in kg)\n", + "\n", + "# Calculation\n", + "conductivity = 0.01;\t\t\t#in mho.m**-1)\n", + "E = V/d;\t\t\t#Electric field(in V/m)\n", + "v = (conductivity*E/(n*e))*10**2;\t\t\t#drift velocity of carriers(in meter/sec)\n", + "\n", + "# Results\n", + "print 'drift velocity of carriers in = %.2f m/s'%v\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "drift velocity of carriers in = 3.93 m/s\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 Page No : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "T = 300;\t\t\t#Temperature(in Kelevin)\n", + "t = 2*10**-14;\t\t\t#time(in sec)\n", + "V_c = 8.9;\t\t\t#volume of 63.54gm of copper(in cc)\n", + "Aw_c = 63.54;\t\t\t#Atomic weight of copper(in a.m.u)\n", + "e = 1.6*10**(-19);\n", + "m = 9.1*10**-31;\n", + "N_a = 6.023*10**23;\t\t\t#avogadro's number\n", + "\n", + "# Calculation\n", + "n = (N_a/(Aw_c/V_c))*10**6;\t\t\t#Number of electrons per m**3\n", + "conductivity = (e**2)*n*t/m;\t\t\t#conductivity of copper at 300K(in mho/m)\n", + "\n", + "# Results\n", + "print 'conductivity of copper at 300K in = %.2e mho/m'%conductivity\n", + "\n", + "# note : answer in book is wrong.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "conductivity of copper at 300K in = 4.75e+07 mho/m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 Page No : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "t = 10**(-14);\t\t\t#mean free time between the collisions(in second)\n", + "e = 1.6*10**-19;\n", + "m = 9.1*10**-31;\n", + "\n", + "# Calculation\n", + "Mobility = e*t/m;\t\t\t#in m**2/V-s\n", + "\n", + "# Results\n", + "print 'mobility of condution electron in = %.2e m**2/V-s'%Mobility\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "mobility of condution electron in = 1.76e-03 m**2/V-s\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5 Page No : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "n = 6.*10**23;\t\t\t#conduction electron per m**3\n", + "conductivity = 6.5*10**7;\t\t\t#in mho/m\n", + "E = 1.;\t\t\t#electric field intensity (in V/m)\n", + "e = 1.602*10**-19;\n", + "m = 9.1*10**-31;\n", + "\n", + "# Calculation\n", + "Mobility = conductivity/(n*e);\t\t\t#in m**2/V-s\n", + "v = Mobility*E;\t\t\t#drift velocity(in m/sec)\n", + "\n", + "# Results\n", + "print 'mobility of condution electron in = %.2e m**2/V-s'%Mobility\n", + "print 'drift velocity in = %.2e m/sec'%v\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "mobility of condution electron in = 6.76e+02 m**2/V-s\n", + "drift velocity in = 6.76e+02 m/sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6 Page No : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "d = 10.5;\t\t\t#density of silver(in gm/cc)\n", + "At_w = 107.9; #atomic weight\n", + "e = 1.6*10**-19;\n", + "conductivity = 6.8*10**5;\t\t\t#in mho/centimeter\n", + "\n", + "# Calculation\n", + "N = 6.023*10**23;\n", + "n = N*d/At_w;\t\t\t#number of free electrons\n", + "Mobility = conductivity/(n*e);\t\t\t#mobility of electrons(in cm**2/V-s);\n", + "\n", + "# Results\n", + "print 'number of free electrons = %.2e'%n\n", + "print 'mobility of electrons in = %.2f cm**2/V-s'%Mobility\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "number of free electrons = 5.86e+22\n", + "mobility of electrons in = 72.51 cm**2/V-s\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "E_f = 3.75;\t\t\t#Fermi energy(in eV)\n", + "e = 1.602*10**-19;\n", + "W_f = e*E_f;\t\t\t#fermi energy in joules\n", + "t = 10**-14;\t\t\t#mean free time between the collisions(in second)\n", + "\n", + "# Calculation\n", + "m = 9.1*10**-31;\t\t\t#mass of electron\n", + "v_f = ((2*W_f)/m)**(1./2);\t\t\t#maximum velocity of an electron in a metal(in m/s)\n", + "mobility = e*t/m;\t\t\t#mobility of electrons(in m**2/V-s)\n", + "\n", + "# Results\n", + "print 'maximum velocity of an electron in a metal in = %.2e m/s'%v_f\n", + "print 'mobility of electrons in = %.2e m**2/V-s'%mobility\n", + "\n", + "# incorrect answer in the textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximum velocity of an electron in a metal in = 1.15e+06 m/s\n", + "mobility of electrons in = 1.76e-03 m**2/V-s\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "E_f = 2.1;\t\t\t#fermi energy(in eV)\n", + "e = 1.602*10**-19;\n", + "m = 9.1*10**-31;\n", + "\n", + "# Calculation\n", + "W_f = e*E_f;\t\t\t#fermi energy in joules\n", + "v_f = (2*W_f/m)**(1./2);\t\t\t#velocity of an electrons at fermi level(in m/sec)\n", + "\n", + "# Results\n", + "print 'velocity of an electrons at fermi level in = %.1e m/sec'%v_f\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "velocity of an electrons at fermi level in = 8.6e+05 m/sec\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.9 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "t = 10**-9;\t\t\t#collision time(in seconds)\n", + "E_f = 7;\t\t\t#fermi energy(in eV)\n", + "e = 1.6*10**-19;\n", + "m = 9.1*10**-31;\n", + "\n", + "# Calculation\n", + "W_f = E_f*e;\t\t\t#fermi energy(in joules)\n", + "v_f = (2*W_f/m)**(1./2);\t\t\t#velocity of an electrons at fermi level(in m/sec)\n", + "P = v_f*t;\t\t\t#Mean free path(in meter)\n", + "\n", + "# Results\n", + "print 'Mean free path in = %.2e m'%P\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean free path in = 1.57e-03 meter\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.10 Page No : 173" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N_a = 6.023*10**23;\n", + "V_c = 8.9;\t\t\t#volume of 63.54gm of copper(in cc)\n", + "Aw_c = 63.54;\t\t\t#Atomic weight of copper(in a.m.u)\n", + "\n", + "# Calculation\n", + "n = (N_a/(Aw_c/V_c))*10**6;\t\t\t#Number of electrons per m**3\n", + "e = 1.6*10**-19;\n", + "m = 9.1*10**-31;\n", + "t = 2*10**-14;\t\t\t#collision time\n", + "conductivity = n*(e**2)*t/m;\t\t\t#conductivity of copper\n", + "\n", + "# Results\n", + "print 'conductivity of copper in = %.1e ohm**-1/m'%conductivity\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "conductivity of copper in = 4.7e+07 ohm**-1/m\n" + ] + } + ], + "prompt_number": 17 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch6.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch6.ipynb new file mode 100644 index 00000000..5cb066fa --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch6.ipynb @@ -0,0 +1,328 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c0c85d5a39a8e445759e5cb8d2f67d6ba3787632cdef1705d098045c10def4f6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 :\n", + "Photoelectric Effect" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 Page No : 191" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.62*10**-34; #Planck's constant(in m2*kg/s)\n", + "c = 3*10**8; #speed of light (in m/s)\n", + "e = 1.6*10**-19; #electron charge(in coulomb)\n", + "Wavelength_1 = 2300*10**-10;\n", + "Wavelength_2 = 1800*10**-10;\n", + "\n", + "# Calculation\n", + "W = h*c/Wavelength_1;\t\t\t#Work function\n", + "E_in = h*c/Wavelength_2;\n", + "E = E_in-W;\t\t\t#kinetic energy of the ejected electron(in Joules)\n", + "E_1 = E/e;\t\t\t#kinetic energy of the ejected electron(in eV)\n", + "\n", + "# Results\n", + "print 'kinetic energy of the ejected electron in = %.1f eV'%E_1\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "kinetic energy of the ejected electron in = 1.5 eV\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 Page No : 191" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.625*(10**(-34));\t#Planck's constant(in m2*kg/s)\n", + "c = 3*10**8;\t\t\t#speed of light (in m/s)\n", + "e = 1.602*10**-19;\t\t#electron charge(in coulomb)\n", + "W = 2.3;\t\t\t #work (in eV)\n", + "\n", + "# Calculation\n", + "W_1 = W*e;\t\t\t#work (in joules)\n", + "v_o = W_1/h;\t\t\t#threshold frequency(in Hz)\n", + "Wavelength = (h*c/W_1)/10**(-10);\t\t\t#Wavelength in Angstrom\n", + "\n", + "# Results\n", + "print 'threshold frequency(Hz) = %.2e'%v_o\n", + "print 'Wavelength in %.0f Angstrom'%(round(Wavelength,-1))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "threshold frequency(Hz) = 5.56e+14\n", + "Wavelength in 5390 Angstrom\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 Page No : 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.625*(10**(-34));\t\t\t#Planck's constant(in m2*kg/s)\n", + "c = 3*10**8;\t\t\t#speed of light (in m/s)\n", + "e = 1.602*10**-19;\t\t\t#electron charge(in coulomb)\n", + "\n", + "# Calculation\n", + "wavelength = 6800*10**-10;\t\t\t#wavelength of radiation\n", + "v_o = c/wavelength;\t\t\t#frequency\n", + "W = h*v_o;\t\t\t#Work function\n", + "\n", + "# Results\n", + "print 'threshold frequency in = %.2e Hz'%v_o\n", + "print 'work function of metal in = %.2e joule'%W\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "threshold frequency in = 4.41e+14 Hz\n", + "work function of metal in = 2.92e-19 joule\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 Page No : 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.625*(10**(-34));\t\t\t#Planck's constant(in m2*kg/s)\n", + "c = 3.*10**8;\t\t\t#speed of light (in m/s)\n", + "\n", + "# Calculation\n", + "L_r = 150*8./100;\t\t\t#Lamp rating(in joule)\n", + "wavelength = 4500.*10**-10;\t\t\t#in meter\n", + "W = h*c/wavelength;\t\t\t#work function\n", + "N = L_r/W;\t\t\t#number of photons emitted by lamp per second\n", + "\n", + "# Results\n", + "print 'number of photons emitted by lamp per second = %.1e'%N\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "number of photons emitted by lamp per second = 2.7e+19\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.6*(10**(-34));\t\t\t#Planck's constant(in m2*kg/s)\n", + "c = 3*10**8;\t\t\t#speed of light (in m/s)\n", + "e = 1.6*10**-19;\t\t\t#electron charge(in coulomb)\n", + "W = 2.24;\t\t\t#work function(in eV)\n", + "\n", + "# Calculation\n", + "W_1 = W*e;\t\t\t#work function(in joule)\n", + "v = (W_1/h)*10**-10;\t\t\t#frequency\n", + "wavelength = c/v;\t\t\t#region of electrons spectrum is less than(in angstrom)\n", + "\n", + "# Results\n", + "print 'region of electrons spectrum is less than %d angstrom'%round(wavelength,-1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "region of electrons spectrum is less than 5520 angstrom\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "h = 6.625*(10**(-34));\t\t\t#Planck's constant(in m2*kg/s)\n", + "c = 3*10**8;\t\t\t#speed of light (in m/s)\n", + "P_o = 10*10**3;\t\t\t#Power of radio receiver (in Watt)\n", + "\n", + "# Calculation\n", + "v = 440*10**3;\t\t\t#Operating frequency\n", + "E = h*v;\t\t\t#Energy of each electron\n", + "N = P_o/E;\t\t\t#Number of photons emitted/sec\n", + "\n", + "# Results\n", + "print 'Number of photons emitted/sec by radio receiver = %.1e'%N\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Number of photons emitted/sec by radio receiver = 3.4e+31\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "W_t = 4.52;\t\t\t#Work function for tungesten(in eV)\n", + "W_b = 2.5;\t\t\t#Work function for barrium(in eV)\n", + "h = 6.62*(10**(-34));\t\t\t#Planck's constant(in m2*kg/s)\n", + "c = 3*10**8;\t\t\t#speed of light (in m/s)\n", + "\n", + "# Calculation\n", + "e = 1.6*10**-19;\t\t\t#electron charge(in coulomb)\n", + "W_T = W_t*e;\t\t\t#Work function for tungesten(in Joule)\n", + "W_B = W_b*e;\t\t\t#Work function for barrium(in Joule)\n", + "Wavelength_T = (h*c/W_T)*10**10;\t\t\t#wavelength of light which can just eject electron from tungsten\n", + "Wavelength_B = (h*c/W_B)*10**10;\t\t\t#wavelength of light which can just eject electron from barrium\n", + "\n", + "# Results\n", + "print 'wavelength of light which can just eject electron from tungsten in = %.0f Angstrom'%Wavelength_T\n", + "print 'wavelength of light which can just eject electron from barrium in = %.0f Angstrom'%Wavelength_B\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "wavelength of light which can just eject electron from tungsten in = 2746 Angstrom\n", + "wavelength of light which can just eject electron from barrium in = 4965 Angstrom\n" + ] + } + ], + "prompt_number": 12 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch7.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch7.ipynb new file mode 100644 index 00000000..f9d4c4b4 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch7.ipynb @@ -0,0 +1,209 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7 : Diffusion in Solids" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1 Page No : 207" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time required for carburization in 142.8 min\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "from scipy.special import erfinv\n", + "\n", + "# Variables\n", + "D = 1.28*10**(-11);\t\t\t#diffusion coefficient of carbon in given steel in m2/s\n", + "c_s = 0.9;\t\t\t#Surface concentration of diffusion element in the surface\n", + "c_o = 0.2;\t\t\t#Initial uniform concentration of the element in the solid\n", + "c_x = 0.4;\t\t\t#Concentration of the diffusing element at a distance x from thesurface\n", + "x = 0.5*10**(-3);\t\t\t#depth from the surface in m\n", + "\n", + "# Calculation\n", + "#(c_s-c_x)/(c_s-c_o) = erf(x/(2*(D*t)**(1/2)))\n", + "t = (x/(2*erfinv((c_s-c_x)/(c_s-c_o))*D**(1./2)))**2;\t\t\t#time required for carburization(in sec)\n", + "\n", + "# Results\n", + "print 'time required for carburization in %.1f min'%(t/60)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2 Page No : 208" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " C1 = 0.0\n", + "time required to get a boron content of 1023 atoms per m3 at a depth of 2 micro meter is = 3845 sec\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "from scipy.special import erfinv\n", + "\n", + "# Variables\n", + "D = 4*10**(-17);\t\t\t#diffusion coefficient of carbon in given steel in m2/s\n", + "c_s = 3*10**26;\t\t\t#Surface concentration of boron atoms in the surface\n", + "c_1 = 0;\t\t\t#Initial uniform concentration of the element in the solid\n", + "c_x = 10**23;\t\t\t#Concentration of the diffusing element at a distance x from thesurface\n", + "x = 2*10**(-6);\t\t\t#depth from the surface in m\n", + "\n", + "# Calculation and Results\n", + "#(c_s-c_x)/(c_s-c_1) = erf(x/(2*(D*t)**(1/2)))\n", + "a = (erfinv((c_s-c_x)/(c_s-c_1)));\n", + "print ' C1 = ',a\n", + "t = (x**2/(D*4*(2.55)**2));\t\t\t#time required to get a boron content of 1023 atoms per m3 at a depth of 2 micro meter\n", + "print 'time required to get a boron content of 1023 atoms per m3 at a depth of 2 micro meter is = %.0f sec'%t\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3 Page No : 208" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "activation energy = 2.93e-19 J\n", + "constant of the equation = 2.68e-04 m2/s\n", + "diffusion coefficient at 500°C = 3.27e-16 m2/s\n" + ] + } + ], + "source": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "t_1 = 736.;\t\t\t#Temperature in °C\n", + "t_2 = 782.;\t\t\t#Temperature in °C\n", + "T_1 = t_1+273;\t\t\t#Temperature in K\n", + "T_2 = t_2+273;\t\t\t#Temperature in K\n", + "D_1 = 2.*10**(-13);\t\t\t#Coefficient of diffusion at T_1 (in m2/s)\n", + "D_2 = 5.*10**(-13);\t\t\t#Coefficient of diffusion at T_2 (in m2/s)\n", + "k = 1.38*10**(-23);\t\t\t#in J/K\n", + "\n", + "# Calculation and Results\n", + "#math.log(d_1) = math.log(d_o)-E/(k*T_1)\n", + "#math.log(d_2) = math.log(d_o)-E/(k*T_2)\n", + "E = (math.log(D_1)-math.log(D_2))/((1/(k*T_1))-(1/(k*T_2)));\t\t\t#\n", + "print 'activation energy = %.2e J'%-E\n", + "D_o = 2.*10**(-13)/math.exp(E/(k*T_1));\n", + "print 'constant of the equation = %.2e m2/s'%D_o\n", + "t_4 = 500.;\t\t\t#Temperature in °C\n", + "T_4 = t_4+273;\t\t\t#Temperature in °K\n", + "D_4 = D_o*math.exp(E/(k*T_4));\t\t\t#diffusion coefficient at 500°C\n", + "print 'diffusion coefficient at 500°C = %.2e m2/s'%D_4\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4 Page No : 210" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time at 500*C that will produce the same diffusion as in 600*C in 110.4 Hours\n" + ] + } + ], + "source": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "D_500 = 4.8*10**(-14);\t\t\t#Diffusion coefficient for copper in aluminimum at 500*C(in m**2/s)\n", + "D_600 = 5.3*10**(-13);\t\t\t#Diffusion coefficient for copper in aluminimum at 600*C(in m**2/s)\n", + "t_600 = 10;\t\t\t#time of diffussion at 600*C(in Hours)\n", + "\n", + "# Calculation\n", + "#D_500*t_500 = D_600*t_600\n", + "t_500 = D_600*t_600/D_500;\t\t\t#time of diffussion at 500*C\n", + "\n", + "# Results\n", + "print 'Time at 500*C that will produce the same diffusion as in 600*C in %.1f Hours'%t_500\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch8.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch8.ipynb new file mode 100644 index 00000000..403c2c76 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch8.ipynb @@ -0,0 +1,241 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8d9d7c620087dc26d3b736b06237bc35091ff6c91c27f59b3c7ac61a9f3126bd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :\n", + "Mechanical Properties of\n", + "Materials and Mechanical Tests" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 Page No : 269" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "# Variables\n", + "Y = 180*10**9;\t\t\t#Young's modulus of a certain material(in N/m**2)\n", + "E = 1.8;\t\t\t#true surface energy (in J/m**2)\n", + "c = (5./2)*10**-6;\t\t\t#Crack (in meter)\n", + "\n", + "# Calculation\n", + "F_strength = math.sqrt((2*Y*E/(math.pi*c)))\n", + "p = 1000*math.pi*c/(2*Y) - 1.8\n", + "\n", + "# Results\n", + "print 'fracture strength = %.2f MN/m**2'%(F_strength*10**-6)\n", + "print \"plastic work required to propogate the crack : %.1f \"%p\n", + "\n", + "# book answer is wrong\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fracture strength = 287.24 MN/m**2\n", + "plastic work required to propogate the crack : -1.8 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 Page No : 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "# Variables\n", + "d_o = 12.7;\t\t\t#tensile test specimen diameter (in mm)\n", + "d = 12;\t\t\t#tensile test specimen diameter after load (in mm)\n", + "P = 76*10**3;\t\t\t#load(in N)\n", + "pi = 22./7;\n", + "A_o = (pi/4)*(d_o**2);\t\t\t#Initial area of cross section(in mm**2)\n", + "A = (pi/4)*(d**2);\t\t\t#area of cross section after load of 76 kN\n", + "\n", + "# Calculation\n", + "E_stress = P/A_o;\t\t\t#engineering stress\n", + "T_stress = P/A;\t\t\t#true stress\n", + "T_strain = math.log(A_o/A);\t\t\t#true strain\n", + "E_strain = math.exp(T_strain)-1;\t\t\t#engineering strain\n", + "\n", + "# Results\n", + "print 'engineering stress in = %.f N/mm**2'%E_stress\n", + "print 'true stress in = %.2f N/mm**2'%T_stress\n", + "print 'engineering strain = %.2f'%E_strain\n", + "print 'true strain = %.2f'%T_strain\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "engineering stress in = 600 N/mm**2\n", + "true stress in = 671.72 N/mm**2\n", + "engineering strain = 0.12\n", + "true strain = 0.11\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 Page No : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "Y = 210.*10**9;\t\t\t#Young's modulus of a certain material(in N/m**2)\n", + "E = 10.;\t\t\t#true surface energy (in J/m**2)\n", + "c = (100./2)*10**-6;\t\t\t#Crack (in meter)\n", + "pi = 3.14;\n", + "\n", + "# Calculation\n", + "F_strength = (2*Y*E/(pi*c))**(1/2.);\n", + "\n", + "# Results\n", + "print 'fracture strength in %.1e Newton/m**2'%F_strength\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fracture strength in 1.6e+08 Newton/m**2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 Page No : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "l_o = 305.*10**-3;\t\t\t#length of copper piece(in meter)\n", + "E = 110.*10**9;\t\t\t#surface energy\n", + "stress = 276.*10**6;\t\t\t#in Pa\n", + "\n", + "# Calculation\n", + "dl = stress*l_o/E;\t\t\t#resultant elongation(in meter)\n", + "\n", + "# Results\n", + "print 'resultant elongation in = %.2f mm'%(dl*10**3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "resultant elongation in = 0.77 mm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 Page No : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "T_stress = 415.;\t\t\t#True stress (in Megapascal)\n", + "T_strain = 0.10;\t\t\t#True strain \n", + "K = 1035.;\t\t\t#(in Megapascal)\n", + "\n", + "# Calculation\n", + "n = (math.log(T_stress)-math.log(K))/math.log(T_strain);\t\t\t#\n", + "\n", + "# Results\n", + "print 'Strain hardening exponent for an alloy = %.2f'%n\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Strain hardening exponent for an alloy = 0.40\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/ch9.ipynb b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch9.ipynb new file mode 100644 index 00000000..a7247f31 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/ch9.ipynb @@ -0,0 +1,155 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c6e5e1c4294a719070d1412094c85ff6cd99718ea66c74abcd23864bb9db9fd5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 :\n", + "Alloys Systems Phase Diagrams\n", + "and Phase Transformations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 Page No : 317" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Calculation\n", + "#Fulcrum is at 0.5% carbon\n", + "#from lever rule\n", + "Pro_f = ((0.80-0.5)/(0.80-0.0))*100;\t\t\t# % Proeutectoid ferrite\n", + "Pea_f = 100-Pro_f;\t\t\t# % Pearlite ferrite\n", + "\n", + "# Results\n", + "print 'Proeutectoid ferrite = %.1f %%'%Pro_f\n", + "print 'Pearlite ferrite = %.1f %%'%Pea_f\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Proeutectoid ferrite = 37.5 %\n", + "Pearlite ferrite = 62.5 %\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 Page No : 317" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "N = 2;\n", + "C = 2;\n", + "\t\t\t#F = C-P+N\n", + "P_1 = 1;\n", + "P_2 = 2;\n", + "P_3 = 3;\n", + "P_4 = 4;\n", + "\n", + "# Calculation\n", + "F_1 = C-P_1+N;\n", + "F_2 = C-P_2+N;\n", + "F_3 = C-P_3+N;\n", + "F_4 = C-P_4+N;\n", + "\n", + "# Results\n", + "print 'Degrees of freedom for 1 phase = ',F_1\n", + "print 'Degrees of freedom for 2 phases = ',F_2\n", + "print 'Degrees of freedom for 3 phases = ',F_3\n", + "print 'Degrees of freedom for 4 phases = ',F_4\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Degrees of freedom for 1 phase = 3\n", + "Degrees of freedom for 2 phases = 2\n", + "Degrees of freedom for 3 phases = 1\n", + "Degrees of freedom for 4 phases = 0\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 Page No : 318" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "import math \n", + "\n", + "# Variables\n", + "P = 4;\t\t\t#Number of phases exhibit by a material\n", + "F = 0;\t\t\t#Minimum degrees of freedom\n", + "\n", + "# Calculation\n", + "#modified form of the phase rule F = C-P+1\n", + "C = F+P-1;\t\t\t#minimum number of components in the system\n", + "\n", + "# Results\n", + "print 'the minimum number of components in the system = ',C\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the minimum number of components in the system = 3\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/10.png b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/10.png Binary files differnew file mode 100644 index 00000000..e23d6998 --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/10.png diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/16.png b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/16.png Binary files differnew file mode 100644 index 00000000..ddf5c27d --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/16.png diff --git a/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/7.png b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/7.png Binary files differnew file mode 100644 index 00000000..ec00abfc --- /dev/null +++ b/Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/7.png diff --git a/Thermodynamics_by_K._M._Gupta/README.txt b/Thermodynamics_by_K._M._Gupta/README.txt new file mode 100644 index 00000000..b35d8ac8 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/README.txt @@ -0,0 +1,10 @@ +Contributed By: Jatin Pavagadhi +Course: mca +College/Institute/Organization: C-DEC , Pune +Department/Designation: Developer +Book Title: Thermodynamics +Author: K. M. Gupta +Publisher: Umesh Publications, Daryaganj, Delhi +Year of publication: 2010 +Isbn: Umesh Publications, Daryaganj, Delhi +Edition: 1
\ No newline at end of file diff --git a/Thermodynamics_by_K._M._Gupta/ch1.ipynb b/Thermodynamics_by_K._M._Gupta/ch1.ipynb new file mode 100644 index 00000000..135a091a --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch1.ipynb @@ -0,0 +1,502 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1 : Fundamentals Concepts and Definitions of Thermodynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.2 Page No : 16" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Absolute pressure in in = 0.0789 kg/cm**2\n", + "Absolute pressure in = 0.0800 bar\n", + "Absolute pressure in in = 7.999 kPa\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "Pvacc = 700.;\t\t\t# mm of hg\n", + "Patm = 760.; \t\t\t# mm of hg\n", + "\n", + "# Calculations\n", + "Pabs = Patm - Pvacc;\t\t\t# mm of hg\n", + "\n", + "# Results\n", + "print \"Absolute pressure in in = %.4f kg/cm**2\"%(Pabs/760)\n", + "print \"Absolute pressure in = %.4f bar\"%(Pabs*1.01325/760)\n", + "print \"Absolute pressure in in = %.3f kPa\"%(Pabs*1.01325/760*10**2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.3 Page No : 16" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Total pressure in tank in = 0.434 Mpa\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Patm = 101;\t\t\t# kpa\n", + "Rho = 13.6 * 10**3;\t\t\t# in kg per m**3\n", + "h = 250;\t\t\t# in cm\n", + "h = h*10**-2;\t\t\t# in m\n", + "g = 9.806;\n", + "\n", + "# Calculations\n", + "p = Rho * g * h;\t\t\t# in N/m**2\n", + "p= p*10**-3;\t\t\t# in kPa\n", + "# Total pressure in tank\n", + "p = p + Patm;\t\t\t# in kpa\n", + "p = p*10**-3;\t\t\t# in Mpa\n", + "\n", + "# Results\n", + "print \"Total pressure in tank in = %.3f Mpa\"%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.4 Page No : 21" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done in kJ is : -251.63\n", + "The -ve sign indicates work is done on the system, hence\n", + "The work done by the piston in kJ is : 251.63\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "m = 1.5;\t\t\t # in kg\n", + "pi = 0.1;\t\t\t # in MPa\n", + "pi= pi*10**6;\t\t\t# in Pa\n", + "pf = 0.7;\t\t\t # in MPa\n", + "pf= pf*10**6;\t\t\t# in Pa\n", + "rho_i = 1.16;\t\t\t# kg per m**3\n", + "\n", + "# Calculations and Results\n", + "vi = m/rho_i \t\t\t# in m**3\n", + "WorkDone= pi*vi*math.log(pi/pf);\t\t\t# in J\n", + "print \"Work done in kJ is : %.2f\"%(WorkDone*10**-3)\n", + "\n", + "if WorkDone<0:\n", + " print (\"The -ve sign indicates work is done on the system, hence\");\n", + " print \"The work done by the piston in kJ is : %.2f\"%abs(WorkDone*10**-3)\n", + " \n", + " \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.5 Page No : 25" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done by the pump upon the water in an hour in MJ is : 90.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "p = 1.0; \t\t\t# in Mpa\n", + "p = p*10**6;\t\t\t# in N per m**2\n", + "del_v = 1.5;\t\t\t#m**3 per min\n", + "\n", + "# Calculations\n", + "del_v = del_v*60;\t\t\t# m**3 per h\n", + "W = p * del_v; \t\t\t# W standard for work done in J\n", + "W = W*10**-6;\t \t\t# in MJ\n", + "\n", + "# Results\n", + "print \"Work done by the pump upon the water in an hour in MJ is : \",W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.6 Page No : 25" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The height from the mass should be fall in meter is : 89.63\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "g = 9.81;\n", + "J = 4.1868*10**3;\n", + "\n", + "# Calculations\n", + "# W = 2*g*h\n", + "# due to stirring of water\n", + "\n", + "m = (0.2+10*10**-3)*10**3;\t\t\t# in gm\n", + "s= 1; \t\t\t# in cal per gm°C\n", + "del_T = 2;\t\t\t # in ° C\n", + "H = m * s * del_T \t\t\t# in cal\n", + "H = H*10**-3;\t\t\t # in kcal\n", + "# W = JH and W= 2*g*h\n", + "h = J*H/(2 * g);\t\t\t # in m\n", + "\n", + "# Results\n", + "print \"The height from the mass should be fall in meter is : %.2f\"%h\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.7 Page No : 26" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power required for the feed pump in kW is : 0.192\n" + ] + } + ], + "source": [ + "\n", + "\n", + "# Variables\n", + "# mass of 1 litr of water is 1 kg. so\n", + "m = 5000;\t\t\t# in kg\n", + "h = 10-1;\t\t\t# in m\n", + "g= 9.81;\t\t\t#\n", + "\n", + "# Calculations\n", + "PE = m * g * h;\t\t\t# in N m\n", + "PE = PE*10**-3;\t\t\t# in kj\n", + "Eta = 0.85;\n", + "# Eta = energy output/energy input\n", + "E_input = PE/Eta;\t\t\t# in Kj\n", + "E_input = E_input*10**3;\t\t\t# in J\n", + "t = 45;\t\t\t# time in min\n", + "t = t*60;\t\t\t# in sec\n", + "P = E_input/t;\t\t\t# in J/s\n", + "P = P*10**-3;\t\t\t# in kW\n", + "\n", + "# Results\n", + "print \"Power required for the feed pump in kW is : %.3f\"%P\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.11 Page No : 29" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power of the engine of a car in kW is : 12.5\n", + "Heat equivalent of work per minute in kJ is 750.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "V = 50.;\t\t\t# km per hr\n", + "V = V * (1000./3600);\t\t\t# in m per sec\n", + "F = 900.;\t\t\t# in N\n", + "\n", + "# Calculations and Results\n", + "P = F * V \t\t\t# in watt\n", + "P = P *10**-3;\t\t\t# in kW\n", + "print \"Power of the engine of a car in kW is : \",P\n", + "\n", + "H = P * 60 \t\t\t# in kJ \n", + "print \"Heat equivalent of work per minute in kJ is\",H\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.12 Page No : 29" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power required for an air mass flowin kJ/s is : 70.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "E_air = 200-100;\t\t\t# in kJ/kg\n", + "E_lost = 40; \t\t\t# in kJ/kg\n", + "\n", + "# Calculations\n", + "E_total = E_air + E_lost;\t\t\t# in kJ per kg\n", + "M = 0.5;\t\t\t# mass flow rate in kg per s\n", + "P = M * E_total;\t\t\t# in kJ/s\n", + "\n", + "# Results\n", + "print \"Power required for an air mass flowin kJ/s is :\",P\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.13 Page No : 30" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Specific heat of metal block in kJ/kg-K is 4.18\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "m_b = 1.;\t\t\t# in kg\n", + "t_ib = 80;\t\t\t#in degree c\n", + "m_w = 10.;\t\t\t# in kg\n", + "t_iw = 25;\t\t\t# in degree c\n", + "del_t = 5.;\t\t\t# in degree c\n", + "S_w = 4.18;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations\n", + "t_equ = (t_iw + del_t);\t\t\t# in degree c\n", + "# Heat loss by metal = Heat gained by water\n", + "S_b = m_w * S_w * (t_equ - t_iw)/(m_b * (t_ib - t_equ));\t\t\t# in kJ/kg-K\n", + "\n", + "# Results\n", + "print \"Specific heat of metal block in kJ/kg-K is\",S_b\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.15 Page No : 31" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reading of pressure in kPa is 221.304\n", + "Reading of pressure in Kpa 47.99 \n", + "Reading of pressure in kPa 113.092\n" + ] + } + ], + "source": [ + "\n", + "\n", + "# Variables\t\t\t\n", + "P_gauge = 90;\t\t\t# in cm of hg\n", + "P_atm = 760;\t\t\t# in mm of hg\n", + "P_atm = 76;\t\t\t# in cm of hg\n", + "\n", + "# Calculations and Results\n", + "P_abs = P_gauge + P_atm;\t\t\t# in cm of hg\n", + "P_abs = P_abs * (101.32/76);\t\t\t# in kPa\n", + "print \"Reading of pressure in kPa is %.3f\"%P_abs\n", + "\n", + "# Part (b)\n", + "P_vacuum = 40;\t\t\t# in cm of hg\n", + "P_abs = P_atm - P_vacuum;\t\t\t# in cm of hg\n", + "P_abs = P_abs * (101.32/76);\t\t\t# in kpa\n", + "print \"Reading of pressure in Kpa %.2f \"%P_abs\n", + "\n", + "# Part (c)\n", + "Rho = 1000;\t\t\t# in kg per m**3\n", + "g = 9.81;\t\t\t# \n", + "h = 1.2;\t\t\t# in m \n", + "P_gauge = Rho * g * h;\t\t\t# in N m**2\n", + "P_gauge= P_gauge*10**-3;\t\t\t# in kPa\n", + "P_atm = 101.32;\t\t\t# in kPa\n", + "P_abs = P_gauge + P_atm;\t\t\t# in kpa\n", + "print \"Reading of pressure in kPa\",P_abs\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.16 Page No : 32" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of H in km is : 12.61\n" + ] + } + ], + "source": [ + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "\t\t\t\n", + "g=9.81; \t\t\t# in m/s**2\n", + "P=1.0332*10**5;\t\t\t# in kN/m**2\n", + "\n", + "def f4(p): \n", + "\t return (1./p)**(1/1.4)\n", + "\n", + "H= 1/g*(2.3*10**4)**(1/1.4)* quad(f4,0,P)[0]\n", + "\n", + "print \"The value of H in km is : %.2f\"%(H*10**-3)\n", + "\n", + "# Note: There is calculation error in the book, so the answer differs.\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch10.ipynb b/Thermodynamics_by_K._M._Gupta/ch10.ipynb new file mode 100644 index 00000000..9f505a7b --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch10.ipynb @@ -0,0 +1,344 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10 : Steam Power Plant and Rankine Cycle" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.1 Page No : 244" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Carnot efficiency of an engine when the steam is 0.87 dry in % is : 21.75\n", + "Carnot efficiency of an engine when the steam is dry saturated in % is : 21.75\n", + "Carnot efficiency of an engine when the steam is superheated in % is : 29.53\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p1 = 10;\t\t\t# in bar\n", + "p2 = 0.5;\t\t\t# in bar\n", + "T1 = 179.9;\t\t\t# in °C\n", + "T1 = T1 +273;\t\t\t# in K\n", + "T2 = 81.4;\t\t\t# in °C\n", + "\n", + "# Calculations and Results\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "Eta_carnot = (T1 - T2)/T1*100;\t\t\t# in %\n", + "print \"Carnot efficiency of an engine when the steam is 0.87 dry in %% is : %.2f\"%Eta_carnot\n", + "print \"Carnot efficiency of an engine when the steam is dry saturated in %% is : %.2f\"%Eta_carnot\n", + "\n", + "T1 = T1 + 50;\t\t\t# in K\n", + "Eta_carnot1 = (T1 - T2) / T1*100;\t\t\t# in %\n", + "print \"Carnot efficiency of an engine when the steam is superheated in %% is : %.2f\"%Eta_carnot1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.2 Page No : 247" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat supplied to the boiler in kJ/kg is 2900.05\n", + "Work developed by turbine in kJ/kg is : 689.0\n", + "Work absorbed by pump in kJ/kg is : 1.95\n", + "Efficiency of flow system in % is : 23.69\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h1 = 3015.;\t \t\t# in kJ/kg\n", + "h2 = 2326.;\t \t\t# in kJ/kg\n", + "h3 = 113;\t\t \t# in kJ/kg\n", + "h4 = 114.95;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "Q = h1 - h4;\t\t\t# in kJ/kg\n", + "print \"Heat supplied to the boiler in kJ/kg is\",Q\n", + "\n", + "W_T = h1 - h2;\t\t\t#/ in kJ/kg\n", + "print \"Work developed by turbine in kJ/kg is : %.1f\"%W_T\n", + "\n", + "W_P = ( h1 - h3) - Q;\t\t\t# in kJ/kg\n", + "print \"Work absorbed by pump in kJ/kg is : \",W_P\n", + "\n", + "Eta = (W_T - W_P)/Q*100;\t\t\t# in %\n", + "print \"Efficiency of flow system in %% is : %.2f\"%Eta\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3 Page No : 248" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rankine efficiency in % is : 20.09\n", + "Percentage drop in Rankine efficiency in % is : 1.01\n", + "Percentage increase in rankine efficiency in % is : 1.51\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "# Variables\n", + "phi_s = 6.583;\n", + "phi_w = 1.091;\n", + "phi_s1 = 6.504;\n", + "C_p = 2.25;\n", + "T_sat =179.9; \t\t\t# in °C\n", + "T_sat = T_sat + 273;\t\t\t# in K\n", + "T_sup = T_sat + 50;\t\t\t# in K\n", + "x2 = (phi_s - phi_w)/phi_s1;\n", + "H1 = 2776.2; \t\t\t# in kJ/kg\n", + "H_w2 = 340.6;\t\t\t# in kJ/kg\n", + "L2 = 2305.;\n", + "\n", + "# Calculations and Results\n", + "H2 = H_w2 + (x2 * L2);\t\t\t# in kJ/kg\n", + "Eta_rankine = (H1 - H2)/(H1 - H_w2)*100;\t\t\t# in %\n", + "print \"Rankine efficiency in %% is : %.2f\"%Eta_rankine\n", + "\n", + "phi_w1 = 2.138;\n", + "x1 = 0.87;\n", + "phi_s1 = 4.445;\n", + "phi_w2 = 1.091;\n", + "phi_s2 = 6.504;\n", + "x2 = (phi_w1 + (x1 * phi_s1) - phi_w2) / phi_s2;\n", + "H1 = 762.6 + (x1 * 2013.6);\t\t\t# in kJ/kg\n", + "H2 = 340.6 + (x2 * 2305);\t\t\t# in kJ/kg\n", + "Eta_rankine1 = (H1 - H2) / (H1 - H_w2)*100;\t\t\t# in %\n", + "PerDropInRankine= (Eta_rankine - Eta_rankine1)/Eta_rankine * 100;\t\t\t# in %\n", + "print \"Percentage drop in Rankine efficiency in %% is : %.2f\"%PerDropInRankine\n", + "\n", + "phi_s1 = 6.583;\n", + "phi_w1 = 1.091;\n", + "phi_s2 = 6.504;\n", + "x2 = (phi_s1 + C_p * math.log(T_sup/T_sat) - phi_w1)/phi_s2;\n", + "H_s1 = 2776.2;\n", + "H1 = H_s1 + C_p * (T_sup - T_sat);\t\t\t# in kJ/kg\n", + "H2 = 340.6 + (0.88 * 2305);\t\t\t# in kJ/kg\n", + "H_w2 = 340.6;\n", + "Eta_rankine2 = (H1 - H2) / (H1 - H_w2);\n", + "Eta_rankine2 = Eta_rankine2 * 10**2;\t\t\t# in percentage\n", + "PerIncInRank = ((Eta_rankine2 - Eta_rankine)/Eta_rankine2) * 100;\t\t\t# in percentage\n", + "print \"Percentage increase in rankine efficiency in %% is : %.2f\"%PerIncInRank\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4 Page No : 253" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Thermal effienciency of the cycle in % is : 15.70\n", + "Heat removed in condenser in kJ/kg is : 2101.9\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "H2 = 2776.2;\t\t\t# in kJ/kg\n", + "p1 = 10.;\t\t\t# in bar\n", + "p_2 = 1.;\t\t\t# in bar\n", + "p_3 = 0.25;\t\t\t# in bar\n", + "p_4 = p_3;\t\t\t# in bar\n", + "# w = (H2 - H_2) + ((p_2 - p_3) * v_2);\t\t\t# work done in kJ/kg\n", + "phi_2 = 6.583;\n", + "phi_d2 = 1.303;\n", + "L = 6.057;\n", + "x_2 = (phi_2 - phi_d2) / L;\n", + "H2_desh = 417.5 + (x_2* 2257.9);\t\t\t# in kJ/kg\n", + "v_s = 1.694;\n", + "\n", + "# Calculations and Results\n", + "v_2 = x_2 * v_s;\t\t\t# in m**3 per kg\n", + "w = (H2 - H2_desh) + ((p_2 - p_3) * v_2);\t\t\t# in kJ/kg\n", + "H4 = 282.7;\t\t\t# in kJ/kg\n", + "H_w4 =H4;\t\t\t# in kJ/kg\n", + "HeatSupplied = H2 - H4;\t\t\t# kJ/kg\n", + "Eta_modifiedRankine = w / HeatSupplied*100;\t\t\t# in %\n", + "print \"Thermal effienciency of the cycle in %% is : %.2f\"%Eta_modifiedRankine\n", + "\n", + "HeatRemoved = HeatSupplied - w;\t\t\t# in kJ/kg\n", + "print \"Heat removed in condenser in kJ/kg is : %.1f\"%HeatRemoved\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.13 Page No : 256" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work output per kg in kW is : 1110.0\n", + "flow rate in kg/hr is : 3567.57\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q = 1100;\t\t\t# in kW\n", + "m = 1; \t\t\t# in kg\n", + "p1 = 15;\t\t\t# in bar\n", + "p1 = p1 * 10**5;\t\t\t# in Pa\n", + "p1 = p1 * 10**-3;\t\t\t# in kPa\n", + "p2 = 0.05 * 10**2;\t\t\t# in kPa\n", + "v1 = 0.16;\t\t\t# m**3 per kg\n", + "v2 = 26;\t\t\t# in m**3 per kg\n", + "V1 = 110;\t\t\t# in m per s\n", + "V2 = 120;\t\t\t# in m per s\n", + "u1 = 2935;\t\t\t# in kJ per kg\n", + "u2 = 1885;\t\t\t# in kJ per kg\n", + "g = 9.8;\n", + "z1 = 0;\n", + "z2 = 0; \n", + "\n", + "# Calculations and Results\n", + "# Formula Q-W= m*{(u2 - u1) + (p2*v2-p1*v1)+1/2*(V2**2-V1**2)+g*(z2 - z1)}\n", + "W =Q-m*((u2 - u1) + (p2*v2-p1*v1)+1./2*(V2**2-V1**2)+g*(z2 - z1));\t\t\t# in kW\n", + "print \"Work output per kg in kW is : \",W\n", + "\n", + "SteamFlowRate = Q / W;\t\t\t# in kg/sec\n", + "SteamFlowRate = SteamFlowRate * 3600;\t\t\t# in kg per hr\n", + "print \"flow rate in kg/hr is : %.2f\"%SteamFlowRate\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.14 Page No : 257" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Ratio of mass flow rate of cooling water to condensing steam is : 36.24\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h_sen = 191.9;\t\t\t# in kJ/kg\n", + "L = 2392;\t\t\t# in kJ/kg\n", + "x = 0.95;\n", + "t_o = 35;\t\t\t# in °C\n", + "t_i = 20;\t\t\t# in °C\n", + "C = 4.18;\n", + "\n", + "# Calculations\n", + "H_totalwet = h_sen + (x * L);\t\t\t#in kJ/kg\n", + "# m_steam * (H_totalwet - h_sen) = m_water * C * (t_o - t_i)\n", + "msBYmw = (H_totalwet - h_sen) / ( C * (t_o - t_i));\t\t\t#\n", + "\n", + "# Results\n", + "print \"The Ratio of mass flow rate of cooling water to condensing steam is : %.2f\"%msBYmw\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch11.ipynb b/Thermodynamics_by_K._M._Gupta/ch11.ipynb new file mode 100644 index 00000000..ff50986c --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch11.ipynb @@ -0,0 +1,68 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:47f72be1b9c6cd56213869831cb1984e5af98a10c08e54d4fdad5c35b07de8a5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Introduction to Working of IC Engines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 Page No : 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "n = 3;\n", + "l = 80;\t\t\t# in mm\n", + "d = 76;\t\t\t# in mm\n", + "r = 8.5;\n", + "\n", + "# Calculations and Results\n", + "V_s = (math.pi/4.) * d * d * l;\t\t\t# in mm**3\n", + "V_s = V_s * 10**-3;\t\t\t# in cm**3\n", + "# r = 1+ (V_s/V_c)\n", + "V_c = (1/(r - 1)) * V_s;\t\t\t# in cm**3\n", + "print \"volume of cylinder in mm**3 is : \",round(V_c*10**3) #incorrect answer in the textbook\n", + "\n", + "C = V_s * n;\t\t\t# C s math.radians(numpy.tan(s for capacity of engine in cm**3\n", + "C = C * 10**-3;\t\t\t# in litre\n", + "print \"Capacity of the engine in litre is : %.3f\"%C\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "volume of cylinder in mm**3 is : 48389.0\n", + "Capacity of the engine in litre is : 1.089\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_K._M._Gupta/ch2.ipynb b/Thermodynamics_by_K._M._Gupta/ch2.ipynb new file mode 100644 index 00000000..ab6e43b2 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch2.ipynb @@ -0,0 +1,627 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 : Gas Laws Ideal and Real Gases" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1 Page No : 41" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The air pressure in the tyre in bar is : 1.8\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p1= 2.;\t\t\t# in bar\n", + "v1= 30.;\t\t\t# in litre\n", + "T1= 27.+273;\t\t\t# in K\n", + "T2= -3.+273;\t\t\t# in K\n", + "v2= v1;\t\t\t# in litre\n", + "\n", + "# Calculations\n", + "# Gas law p1*v1/T1= p2*v2/T2\n", + "p2= p1*v1*T2/(T1*v2);\t\t\t# in bar\n", + "\n", + "# Results\n", + "print \"The air pressure in the tyre in bar is :\",p2\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2 Page No : 42" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The mass of Nitrogen gas stored in the vessel in kg is : 333.64\n", + "The mass of Oxygen gas stored in the vessel in kg is : 381.08\n", + "The mass of Carbon dioxide gas stored in the vessel in kg is : 524.00\n", + "Molar volume of the gas mixture in m**3 is : 2.10\n", + "density of the gas mixture in kg/m**3 is : 49.55\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p= 12.;\t\t\t# in bar\n", + "p=p*10**5;\t\t\t# in N/m**2\n", + "v= 25.;\t\t\t# in m**3\n", + "T= 30.+273;\t\t\t# in K\n", + "# Part (a) Mass of each gas\n", + "#Formula p*v=m*R*T\n", + "R_U= 8314.;\t\t\t# in J/kg-mole K\n", + "M_N2= 28.016;\t\t\t# in mole\n", + "M_O2= 32.;\t\t\t# in mole\n", + "M_CO2= 44.;\t\t\t# in mole\n", + "\n", + "# Calculations and Results\n", + "R_N2= R_U/M_N2;\t\t\t# in J/kg K\n", + "R_O2= R_U/M_O2;\t\t\t# in J/kg K\n", + "R_CO2= R_U/M_CO2;\t\t\t# in J/kg K\n", + "m_of_N2= p*v/(R_N2*T);\t\t\t# in kg\n", + "m_of_O2= p*v/(R_O2*T);\t\t\t# in kg\n", + "m_of_CO2= p*v/(R_CO2*T);\t\t\t# in kg\n", + "print \"The mass of Nitrogen gas stored in the vessel in kg is : %.2f\"%(m_of_N2)\n", + "print \"The mass of Oxygen gas stored in the vessel in kg is : %.2f\"%m_of_O2\n", + "print \"The mass of Carbon dioxide gas stored in the vessel in kg is : %.2f\"%round(m_of_CO2)\n", + "\n", + "# Part (b) Molar Volume\n", + "# Formula v_molar= M*R*T/p= R_U*T/p\n", + "v_molar= R_U*T/p;\t\t\t# in m**3\n", + "print \"Molar volume of the gas mixture in m**3 is : %.2f\"%v_molar\n", + "\n", + "# Part (c) Average density\n", + "# rho_avg= total mass/total volume\n", + "rho_avg= (m_of_N2+m_of_O2+m_of_CO2)/v;\t\t\t# in kg/m**3\n", + "print \"density of the gas mixture in kg/m**3 is : %.2f\"%rho_avg\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3 Page No : 47" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of Cp in kJ/kg°C 15.375\n", + "The value of Cv in kJ/kg°C 9.9375\n", + "The value of R in kJ/kg°C 5.4375\n", + "Molecular weight of the gas is : 1.529\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Qp = 1230.;\t\t\t# kJ/kg\n", + "Qv = 795.; \t\t\t# kJ/kg\n", + "t1 = 16.;\t\t\t# in °C\n", + "t2 = 96.;\t\t\t# in °C\n", + "R_U = 8.314;\n", + "\n", + "# Calculations and Results\n", + "delta_T= t2-t1;\t\t\t# in °C\n", + "Cp= Qp/delta_T;\t\t\t# in kJ/kg °C\n", + "print \"The value of Cp in kJ/kg°C\",Cp\n", + "\n", + "Cv= Qv/delta_T;\t\t\t# in kJ/kg °C\n", + "print \"The value of Cv in kJ/kg°C\",Cv\n", + "\n", + "R= Cp-Cv;\t\t\t# in kJ/kg °C\n", + "print \"The value of R in kJ/kg°C\",R\n", + "\n", + "molecular_weight= R_U/R;\n", + "print \"Molecular weight of the gas is : %.3f\"%molecular_weight\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4 Page No : 48" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in enthalpy in MJ is : 204.137\n", + "change in internal energy in MJ is : 136.092\n" + ] + } + ], + "source": [ + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "# Variables\n", + "a= 0.85;\n", + "b= 0.00004;\n", + "c= 5*10**-5;\n", + "T1= 300;\t\t\t# in K\n", + "T2= 2300;\t\t\t# in K\n", + "gama= 1.5;\t\t\t# the ratio of specific heats\n", + "m=1;\t\t\t# in kg\n", + "\n", + "# Calculations and Results\n", + "def f1(T): \n", + " return a+b*T+c*T**2\n", + "\n", + "delta_H= m* quad(f1,T1,T2)[0]\n", + "\n", + "print \"Change in enthalpy in MJ is : %.3f\"%(delta_H*10**-3)\n", + "\n", + "# Formula delta_U= integration of m*Cv = integration of m*Cp/gama= delta_H/gama\n", + "delta_U= delta_H/gama;\t\t\t# in kJ\n", + "print \"change in internal energy in MJ is : %.3f\"%(delta_U*10**-3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5 Page No : 52" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Using perfect gas law the pressure for unit mass of hydrogen in bar is : 54.457\n", + "Using Van der waals equation, the pressure in bar is : 56.246\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "v= 0.9/3;\t\t\t# in m**3/kg\n", + "v= 2*v;\t\t\t# in m**3/kg mole (as M_hydrogen = 2)\n", + "T=120+273;\t\t\t# in K\n", + "R=8314;\t\t\t# in J/kg mole K\n", + "a=2.51*10**4;\t\t\t# in Nm**4/(kg mole)**2\n", + "b= 0.0262;\n", + "\n", + "# Calculations and Results\n", + "# Part (a)\n", + "p= R*T/v;\t\t\t# in N/m**2\n", + "p= p*10**-5;\t\t\t# in bar\n", + "print \"Using perfect gas law the pressure for unit mass of hydrogen in bar is : %.3f\"%p\n", + "\n", + "# Part (b)\n", + "p= R*T/(v-b)-a/v**2;\t\t\t# N/m**2\n", + "p= p*10**-5;\t\t\t# in bar\n", + "print \"Using Van der waals equation, the pressure in bar is : %.3f\"%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6 Page No : 55" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "density of the gas under the changed condition in kg/m**3 is : 1.36\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p1= 0.98;\t\t\t# in bar\n", + "p2= 0.6;\t\t\t# in bar\n", + "v1= 0.45;\t\t\t# in m**3/kg\n", + "\n", + "# Calculations\n", + "# Applying Boyle's law\n", + "v2= p1*v1/p2;\t\t\t# in m**3/kg\n", + "rho2= 1/v2; \t\t\t# in kg/m**3\n", + "\n", + "# Results\n", + "print \"density of the gas under the changed condition in kg/m**3 is : \",round(rho2,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 2.7 Page No : 55" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Payload that can be lifted along with the balloon in kg is : 580.67\n" + ] + } + ], + "source": [ + "# Exa 2.7\n", + "import math \n", + "\n", + "# Variables\n", + "r=5;\t\t\t # in cm\n", + "R_U= 8314\n", + "T= 27+273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "V= 4./3*math.pi*r**3;\t\t\t# volume of balloon in cm**3\n", + "# atmPressure= 75 cm off mercury = 75/76*1.01325 \n", + "atmPressure= round(75./76*1.01325) ;\t\t\t# in bar\n", + "p= atmPressure;\t\t\t# pressure of hydrogen in balloon in bar\n", + "p=p*10**5;\t\t\t# in N/m**2\n", + "R= R_U/2;\t\t\t# in J/kg K\n", + "m1= p*V/(R*T);\t\t\t# in kg\n", + "# The volume of air print laced = the volume of balloon, so\n", + "R=287;\n", + "T=20+273;\t\t\t# in K\n", + "m2= p*V/(R*T);\t\t\t# in kg\n", + "payload= m2-m1;\t\t\t# in kg\n", + "\n", + "# Results\n", + "print \"Payload that can be lifted along with the balloon in kg is : %.2f\"%payload\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.12 Page No : 57" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The pressure in the space is 7.148 aPa\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "AvogadroNo= 6.023*10**23;\n", + "n= 5/AvogadroNo;\t\t\t# number of moles\n", + "v=10**-6;\t\t\t# in m**3\n", + "T= -270+273;\t\t\t# in K\n", + "R= 0.287;\n", + "\n", + "# Calculations\n", + "p= n*R*T/v;\t\t\t# in kPa\n", + "p= p*10**18;\t\t\t# in aPa\n", + "\n", + "# Results\n", + "print \"The pressure in the space is %.3f aPa\"%p;\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.13 Page No : 57" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in enthalpy in kJ/kg is : 1934.8\n" + ] + } + ], + "source": [ + "# Exa 2.13\n", + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "# Variables\n", + "T1 = 300;\t\t\t# in K\n", + "T2 = 900;\t\t\t# in K\n", + "m = 2; \t\t\t# in kg\n", + "\n", + "# Calculations\n", + "def f3(T): \n", + " return 40-600/math.sqrt(T)+7000/T\n", + "\n", + "delta_H=m* quad(f3,T1,T2)[0]\n", + "\n", + "delta_H= delta_H/17.03;\t\t\t# in kJ/kg\n", + "\n", + "# Results\n", + "print \"Change in enthalpy in kJ/kg is : %.1f\"%delta_H\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.14 Page No : 58" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Molecular weight is : 38.84\n", + "Gas constant in kJ/kg K is : 0.214\n", + "The pressure of the gas in bar is : 0.569\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "m = 12.;\t\t\t# in kg mol\n", + "v = 723.7;\t\t\t# in m**3\n", + "T = 140.;\t\t\t# in °C\n", + "T = T+273;\t\t\t# in K\n", + "rho = 0.644;\t\t\t# in kg/m**3\n", + "Ro = 8314;\t\t\t# in J/kg-mole K\n", + "\n", + "# Calculations and Results\n", + "# rho= m/v, where m in Kg , so rho= m*M/v\n", + "M = rho*v/m;\n", + "m = m*M;\t\t\t# in kg\n", + "print \"Molecular weight is : %.2f\"%M\n", + "\n", + "# Part (b)\n", + "R = Ro/M;\t\t\t# in J/kg K\n", + "print \"Gas constant in kJ/kg K is : %.3f\"%(R*10**-3)\n", + "\n", + "# Part(c)\n", + "p = m*R*T/v;\t\t\t# in N/m**2\n", + "p = p*10**-5;\t\t\t# in bar\n", + "print \"The pressure of the gas in bar is : %.3f\"%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.15 Page No : 58" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The load that can be lifted with the air of aerostat in N is : 770.11\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p = 0.98; \t\t\t# in bar\n", + "p = p*10**5;\t\t\t# in N/m**2\n", + "v = 1000;\t \t\t# in m**3\n", + "T = 27+273;\t\t \t# in K\n", + "g = 9.8;\n", + "M = 2;\n", + "Ro = 8314;\t\t\t # in J/kg-mole K\n", + "\n", + "# Calculations\n", + "R = Ro/M;\t\t \t# in kg K\n", + "m = p*v/(R*T);\t\t\t# in kg\n", + "W = m*g;\t\t\t # in N\n", + "\n", + "# Results\n", + "print \"The load that can be lifted with the air of aerostat in N is : %.2f\"%W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.16 Page No : 59" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in enthalpy in kcal/kg mole is : 7459.40\n" + ] + } + ], + "source": [ + "import math \n", + "from scipy.integrate import quad \n", + "\n", + "# Variables\n", + "T1= 500;\t\t\t# in K\n", + "T2= 2000;\t\t\t# in K\n", + "m=1;\t\t\t# in kg\n", + "\n", + "# Calculations\n", + "def f2(T): \n", + " return 11.515-172/math.sqrt(T)-1530/T\n", + "\n", + "delta_H=m* quad(f2,T1,T2)[0]\n", + "\n", + "# Results\n", + "print \"Change in enthalpy in kcal/kg mole is : %.2f\"%delta_H\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.17 Page No : 59" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of Cv in kJ/kg-K is : 0.178\n", + "The value of Cp in kJ/kg-K is : 1.005\n" + ] + } + ], + "source": [ + "from scipy.misc import derivative\n", + "\n", + "# Variables\t\t\t\n", + "duBydt= 0.718;\n", + "\n", + "# Calculations\n", + "\n", + "def f1(t):\n", + " return 196. + 0.178 * t\n", + "\n", + "Cv = round(derivative(f1,1.0, dx=1e-6),3)\n", + "\n", + "def f2(t):\n", + " return 273.351 + 1.005*t\n", + "\n", + "Cp = round(derivative(f2,1.0, dx=1e-6),3)\n", + "# Results\n", + "print \"The value of Cv in kJ/kg-K is : \",Cv\n", + "print \"The value of Cp in kJ/kg-K is : \",Cp\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch3.ipynb b/Thermodynamics_by_K._M._Gupta/ch3.ipynb new file mode 100644 index 00000000..6e8007f9 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch3.ipynb @@ -0,0 +1,212 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3 : Zeroth Law of Thermodynamics and Temperature Scales" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1 Page No : 72" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When the temperature is 303 K then the thermometer reading in °F is : 86\n", + "The absolute value of the temperature in Rankine scale in °R is : 546\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "t_c = 303-273;\t\t\t# in °C\n", + "\n", + "# Calculations and Results\n", + "t_f = 9./5* t_c+32;\t\t\t# in °F\n", + "print \"When the temperature is 303 K then the thermometer reading in °F is : %.0f\"%t_f\n", + "\n", + "T_R = 460 + t_f;\t\t\t# °R\n", + "print \"The absolute value of the temperature in Rankine scale in °R is : %.0f\"%T_R\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2 Page No : 73" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Temperature in kelvin is : 274.29\n", + "Temperature in °R is : 460.81\n", + "Temperature in °C is : 1.14\n", + "Temperature in °F is : 1.14\n" + ] + } + ], + "source": [ + "\n", + "\n", + "# Variables\n", + "# t_C= t_F or T_K-T_R= -186.52 (i)\n", + "# T_R/T_K = 1.68 (ii)\n", + "# From eq (i) and (ii)\n", + "T_K= -186.52/(1-1.68);\t\t\t# temp. in kelvin in K\n", + "\n", + "# Calculations\n", + "T_R= 1.68*T_K;\t\t\t # in temp. in rankine in °R\n", + "t_C= T_K-273.15;\t\t\t# in °C\n", + "t_F= T_R-459.67;\t\t\t# in °F\n", + "\n", + "# Results\n", + "print \"Temperature in kelvin is : %.2f\"%T_K\n", + "print \"Temperature in °R is : %.2f\"%T_R\n", + "print \"Temperature in °C is : %.2f\"%t_C\n", + "print \"Temperature in °F is : %.2f\"%t_F\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9 Page No : 75" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The temperature at p=2.5 in °unit is : 73.014\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "p0 = 1.86;\n", + "p100 = 6.81;\n", + "T1=32;\n", + "T2= 212;\n", + "\n", + "# Calculations\n", + "# Relation of T in terms of p for ice point T1= a*math.log(p0)+b (i)\n", + "# Relation of T in terms of p for steam point T2= a*math.log(p100)+b (ii)\n", + "# From eq(i) and (ii)\n", + "a= (T2-T1)/math.log(p100/p0);\n", + "b= T1-a*math.log(p0);\n", + "# The temp at \n", + "p=2.5;\n", + "T= a*math.log(p)+b;\t\t\t# in °unit\n", + "\n", + "# Results\n", + "print \"The temperature at p=2.5 in °unit is : %.3f\"%T\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10 Page No : 76" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "When P reads 20°C, then the readings of Q in °C are 18.76 C \n", + "The realistic value of Tq in °C is : 18.76\n" + ] + } + ], + "source": [ + "\n", + "from numpy import roots\n", + "\n", + "# Variables\t\t\t\n", + "Tp0=0.;\t\t\t#in °C (at ice point)\n", + "Tq0=0.;\t\t\t#in °C (at ice point)\n", + " # Putting these values in relation, we get\n", + "a=0.;\n", + "Tp100=100.;\t\t\t#in °C ( at steam point)\n", + "Tq100=100.;\t\t\t#in °C ( at steam point)\n", + " # Tp100= b*Tq100+lamda*Tq100**2 (i)\n", + "Tp=45.;\t\t\t# in °C (in oil path)\n", + "Tq=43.;\t\t\t# in °C (in oil path)\n", + "\n", + "# Calculations\n", + "# Tp= b*Tq+lamda*Tq**2 (ii)\n", + "b= (Tp100-Tp*Tq100**2/Tq**2)/(Tq100-Tq100**2/Tq);\t\t\t# From eq (i) and (ii)\n", + "lamda= (Tp-b*Tq)/Tq**2;\n", + "Tp=20;\n", + "\n", + "#lamda*Tq**2+b*Tq-Tp=0\n", + "P= [lamda, b, -Tp];\n", + "Tq= roots(P);\t\t\t# in °C\n", + "\n", + "# Results\n", + "print \"When P reads 20°C, then the readings of Q in °C are %.2f C \"%(Tq[1])\n", + "print \"The realistic value of Tq in °C is : %.2f\"%Tq[1]\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch4.ipynb b/Thermodynamics_by_K._M._Gupta/ch4.ipynb new file mode 100644 index 00000000..2fc9d1fd --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch4.ipynb @@ -0,0 +1,640 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4 : First Law of Thermodynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1 Page No : 80" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work done by the pump upon the water in MJ is : 90\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\t\t\t\n", + "p = 1.0;\t\t\t# in MPa\n", + "p = p * 10**6;\t\t\t# in N per m**2\n", + "del_v = 1.5;\t\t\t# in m**3 per min\n", + "\n", + "# Calculations\n", + "del_v = del_v * 60;\t\t\t# in m**3 per h\n", + "W = p * del_v;\t\t\t# in J\n", + "W = W * 10**-6;\t\t\t# in MJ\n", + "\n", + "# Results\n", + "print \"Work done by the pump upon the water in MJ is : %.0f\"%W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2 Page No : 81" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Height from which the mass should fall in meter is : 89.63\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "# w = 2*g*h\n", + "g = 9.81;\n", + "m =(0.2+10./1000)*10**3 ;\t\t\t# in gm\n", + "s = 1;\t\t\t# in cal/gm°C\n", + "del_T = 2;\t\t\t# in °C\n", + "\n", + "# Calculations\n", + "H = m * s * del_T;\t\t\t# in cal\n", + "H = H * 10**-3;\t\t\t# kcal\n", + "J = 4.1868 * 1000;\n", + "# W= 2*g*h= J*H\n", + "h = J*H/(2 * g);\t\t\t# in m\n", + "\n", + "# Results\n", + "print \"Height from which the mass should fall in meter is : %.2f\"%h\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3 Page No : 83" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Third Heat transfer in kJ is -5\n", + "That is Third Heat transfer is of 5 kJ from the fluid\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "W1 = -25;\t\t\t# in kJ\n", + "W2 = 45;\t\t\t# in kJ\n", + "Q1 = 65;\t\t\t# in kJ\n", + "Q2 = -40;\t\t\t# in kJ\n", + "\n", + "# Calculations\n", + "# del_U = Q - W and but for a cycle del_U = 0, So\n", + "# Q = W\n", + "# Q1 + Q2 +Q3 = W1 +W2\n", + "Q3 = W1 + W2 - Q1 - Q2;\t\t\t# in kJ\n", + "\n", + "# Results\n", + "print \"Third Heat transfer in kJ is \",Q3\n", + "print \"That is Third Heat transfer is of \",abs(Q3),\" kJ from the fluid\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5 Page No : 98" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The external work done in kcal is : 14.2\n" + ] + } + ], + "source": [ + "\n", + "# Variables\t\t\t\n", + "m = 1.5;\t\t\t# in kg\n", + "T1 = 90;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t#in K\n", + "T2 = 225;\t\t\t# in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "C_p = 0.24;\n", + "C_v = 0.17;\n", + "\n", + "# Calculations\n", + "Q = (m * C_p * (T2-T1));\t\t\t# in kcal\n", + "del_U = (m * C_v * (T2-T1));\t\t\t# in kcal\n", + "W = Q - del_U;\t\t\t# in kcal\n", + "\n", + "# Results\n", + "print \"The external work done in kcal is : %.1f\"%W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7 Page No : 98" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mass of gas in mole is : 24.20\n", + "Temperature at the end of compression in °C is : 286.5\n", + "Value of index n of compression is : 1.3\n", + "Increase in internal energy of gas in kJ is : 56.2\n", + "Heat interaction in kJ is : -72.24\n", + "The -ve sign indicates heat rejection during the process\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "v1 = 0.5;\t\t\t# in m**3\n", + "v2 = 0.125;\t\t\t# in m**3\n", + "p1 = 1.5;\t\t\t# in bar\n", + "p1 = p1 * 10**5;\t\t\t# in N per m**2\n", + "p2 = 9.;\t\t\t#in bar\n", + "p2 = p2 * 10**5;\t\t\t# in N per m**2\n", + "T1 = 100.;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "R = 8.31;\n", + "\n", + "# Calculations and Results\n", + "# Formula p1*v1= n*R*T1\n", + "n= p1*v1/(R*T1);\t\t\t# in mole\n", + "print \"Mass of gas in mole is : %.2f\"%n\n", + "\n", + "# Part (b)\n", + "# Formula p1*v1/T1 = p2*v2/T2\n", + "T2 = (p2 * v2 * T1)/(p1 * v1);\t\t\t# in K\n", + "print \"Temperature at the end of compression in °C is : %.1f\"%(T2-273)\n", + "\n", + "# Part (c)\n", + "# Formula p1*v1**n = p2*v2**n\n", + "n1= math.log(p2/p1)/math.log(v1/v2)\n", + "print \"Value of index n of compression is :\",round(n1,1)\n", + "\n", + "# Part (d)\n", + "F = 3;\n", + "C_v =1./2*R*F;\n", + "del_U = (n * C_v * (T2-T1));\t\t\t# in J\n", + "print \"Increase in internal energy of gas in kJ is : %.1f\"%(del_U*10**-3)\n", + "\n", + "# Part(e)\n", + "Gamma = 1.67;\n", + "Q_12 = n*(Gamma-n1)/(1-n1)*R*(T2-T1)/(Gamma-1);\t\t\t# in J\n", + "Q_12 = Q_12 * 10**-3;\t\t\t # in kJ\n", + "print \"Heat interaction in kJ is : %.2f\"%Q_12\n", + "\n", + "if Q_12<0:\n", + " print \"The -ve sign indicates heat rejection during the process\"\n", + "\n", + "# Note: There is some difference between the answer of book and coding . Both the answer is right but accurate answer is of coding.\n", + "# Because in the book, the intermediate values taken are appox. and in the coding the values taken are accurate\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8 Page No : 99" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Part (a) The value of n is : 1.34\n", + "The process followed during air compression is POLYTROPIC\n", + "Part (b) The law of the process is 1.34 p*v** = constant\n", + "Part (c) Work done during the process in kJ is : -73.5\n", + "The -ve sign indicates that the work has been done on the system\n", + "Part (d) Heat transfer during the process in kJ is : -11.029\n", + "The -ve sign indicates that the heat is rejected from the system\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "p1 = 0.01;\t\t\t# in N/mm**2\n", + "p1 = p1 * 10**3;\t\t\t# in kN/m**2\n", + "p2 = 50.;\t\t\t# in kN/m**2\n", + "v1 = 5.;\t\t\t# in m**3\n", + "v2 = 1.5;\t\t\t# in m**3\n", + "Gamma = 1.4;\n", + "\n", + "# Calculations and Results\n", + "# Formula p1*v1**n = p2*v2**n\n", + "n= round(math.log(p2/p1)/math.log(v1/v2),2)\n", + "print \"Part (a) The value of n is : %.2f\"%n\n", + "print (\"The process followed during air compression is POLYTROPIC\");\n", + "\n", + "# Part (b)\n", + "print \"Part (b) The law of the process is %.2f p*v**\"%n,\" = constant\"\n", + "\n", + "# Part (c)\n", + "W= (p1*v1-p2*v2)/(n-1);\t\t\t# in kNm or (kJ)\n", + "print \"Part (c) Work done during the process in kJ is : %.1f\"%W\n", + "print (\"The -ve sign indicates that the work has been done on the system\")\n", + "\n", + "# Part (d)\n", + "Q = ((Gamma - n)/(Gamma - 1) * W);\t\t\t# in kJ\n", + "print \"Part (d) Heat transfer during the process in kJ is : %.3f\"%Q\n", + "print (\"The -ve sign indicates that the heat is rejected from the system\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9 Page No : 101" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in internal energy in kJ is 60.0\n", + "The value of a in kN/m**2 is 1160.0\n", + "The value of b in kN/m**2 is -800.0\n", + "Work done in kJ is : 600.0\n", + "The net heat transfer in kJ is : 660.0\n" + ] + } + ], + "source": [ + "from scipy.integrate import quad \n", + "\n", + "\n", + "# Variables\n", + "# Relation of specific internal energy of the gas\n", + "# U= 1.5*p*v-85 kJ/kg\n", + "p1 = 1000;\t\t\t# in kpa\n", + "p2 = 200;\t\t\t# in pa\n", + "v1 = 0.20;\t\t\t# in m**3\n", + "v2 = 1.20;\t\t\t# in m**3\n", + "m = 1.5;\t\t\t# in kg\n", + "\n", + "# Calculations and Results\n", + "U1= 1.5*p1*v1-85;\t\t\t# kJ/kg\n", + "U2= 1.5*p2*v2-85;\t\t\t# kJ/kg\n", + "delU= U2-U1;\t \t\t# in kJ\n", + "print \"Change in internal energy in kJ is\",delU\n", + "# p1= a+b*v1 (i)\n", + "# p2= a+b*v2 (ii)\n", + "# From eq(i) and (ii)\n", + "b= (p1-p2)/(v1-v2);\t\t\t# in kN/m**2\n", + "a= p1-b*v1; \t\t\t# in kN/m**2 \n", + "print \"The value of a in kN/m**2 is \",a\n", + "print \"The value of b in kN/m**2 is \",b\n", + "\n", + "# Part (c)\n", + "# Work done = integration of p w.r.t. v and p = a+b*v1\n", + "\n", + "def f5(v): \n", + " return a+b*v\n", + "\n", + "W= quad(f5,v1,v2)[0]\n", + "print \"Work done in kJ is :\",W\n", + "\n", + "# Part (d)\n", + "Q= delU+W;\t\t\t# in kJ\n", + "print \"The net heat transfer in kJ is : \",Q\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10 Page No : 102" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The maximum internal energy of the gas in kJ/kg is : 818.625\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "a= 1160.;\t\t\t# in kN/m**2\n", + "b= -800.;\t\t\t# in kN/m**2\n", + "\n", + "# Calculations\n", + "v= -a/(2*b)\n", + "Umax= 1.5*(a*v+b*v**2)-85;\t\t\t# in kJ/kg\n", + "# For 1.5 kg mass of gas it is\n", + "Umax= Umax*1.5;\t\t\t# in kJ/kg\n", + "\n", + "# Results\n", + "print \"The maximum internal energy of the gas in kJ/kg is : \",Umax\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11 Page No : 103" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The exit velocity of air in m/s is : 594.094\n", + "Inlet area of the nozzle in square milimeter is : 31.89\n", + "Exit area of nozzel in square milimeter is : 43.35\n" + ] + } + ], + "source": [ + "# Exa 4.11\n", + "import math \n", + "\n", + "# Variables\n", + "T1 = 127.;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "R = 287.;\n", + "V1 = 300.;\t\t\t# in m/s\n", + "p1 = 2.;\t\t\t# in MPa\n", + "p2 = 0.5;\t\t\t# in MPa\n", + "p1 = p1 * 10**6;\t\t\t# in Pa\n", + "p2 = p2 * 10**6;\t\t\t# in Pa\n", + "C_P = 1.005*10**3;\t\t\t# in J/ kg-K\n", + "Gamma = 1.4;\n", + "\n", + "# Calculations and Results\n", + "V2 = math.sqrt(2 * C_P *T1 *(1-(p2/p1)**((Gamma-1)/Gamma)) + V1**2);\t\t\t# in m/s\n", + "print \"The exit velocity of air in m/s is : %.3f\"%V2\n", + "\n", + "m = 600.;\t\t\t# in kg/hr\n", + "m = m / 3600;\t\t\t# in kg/sec\n", + "v1 = (R * T1)/p1;\t\t\t# in m**3 per kg\n", + "# m = (A1*V1)/v1 = (A2* V2)/v2\n", + "A1 = (m * v1)/V1;\t\t\t# in m**2\n", + "A1 = A1 * 10**6;\t\t\t# in mm**2\n", + "print \"Inlet area of the nozzle in square milimeter is : %.2f\"%A1\n", + "\n", + "T2 = T1*(p2/p1)**((Gamma-1)/Gamma);\t\t\t# in K\n", + "v2 = (R * T2)/(p2);\t\t\t# in m**3/kg\n", + "A2 = (m * v2)/V2;\t\t\t# in m**2\n", + "A2 = A2 * 10**6;\t\t\t# in mm**2\n", + "print \"Exit area of nozzel in square milimeter is : %.2f\"%A2\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.17 Page No : 106" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Net heat transfer for the system in MJ is : -8.6\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "W = -1;\t\t\t# in kWh\n", + "W = W * 10**3 * 3600;\t\t\t# in J\n", + "del_U = -5000;\t\t\t# in kj\n", + "\n", + "# Calculations\n", + "del_U = del_U * 10**3;\t\t\t# in J\n", + "Q = del_U + W;\t\t\t# in J\n", + "Q = Q * 10**-6;\t\t\t# in MJ\n", + "\n", + "# Results\n", + "print \"Net heat transfer for the system in MJ is : \",Q\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.20 Page No : 107" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat flows into the system along the path a b d in kJ is : 62.5\n", + "Heat liberated by the system in kJ is : -73\n", + "Heat absorbed in processes ad in kJ is : 52.5\n", + "Heat absorbed in processes bd in kJ is : 10\n", + "Heat absorbed in processes in ad and db in kJ is : 10.5\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q_acb = 84;\t\t\t#in kJ\n", + "W_acb = 32;\t\t\t# in kJ\n", + "\n", + "# Calculations and Results\n", + "#Formula Q_acb = del_U+W_acb where del_U = U_b - U_a;\n", + "del_U = Q_acb - W_acb;\t\t\t# in kJ\n", + "# Part (a) Path a b d\n", + "W_abd = 10.5;\t\t\t# in kJ\n", + "Q_abd = del_U + W_abd;\t\t\t# in kJ\n", + "print \"Heat flows into the system along the path a b d in kJ is : \",Q_abd\n", + "\n", + "# Part (b) curved path b a\n", + "W_ba = -(21);\t\t\t# in kJ\n", + "Q_ba = -(del_U) + W_ba;\t\t\t# in kJ\n", + "print \"Heat liberated by the system in kJ is : \",(Q_ba)\n", + "\n", + "# Part (c) process a b and d b\n", + "W_ad = 10.5;\t\t\t# in kJ\n", + "del_U1 = 42;\t\t\t# in kJ\n", + "Q_ad = del_U1 + W_ad;\t\t\t# in kJ\n", + "print \"Heat absorbed in processes ad in kJ is : \",Q_ad\n", + "\n", + "W_db = -(42);\t\t\t# in kJ\n", + "del_U2 = 52;\t\t\t# in kJ\n", + "Q_bd = del_U2 + W_db;\t\t\t# in kJ\n", + "print \"Heat absorbed in processes bd in kJ is : \",Q_bd\n", + "\n", + "W_db = 0;\n", + "W_abd = W_ad + W_db;\t\t\t# in kJ\n", + "print \"Heat absorbed in processes in ad and db in kJ is : \",W_abd\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.21 Page No : 108" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "net work done in kJ is : -94.02\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "v1 = 5.;\t\t\t# in m**3\n", + "p1 = 2.;\t\t\t# in bar\n", + "p2 = 6.;\t\t\t# in bar\n", + "p3 = 2.;\t\t\t# in bar\n", + "\n", + "# Calculations\n", + "p1 = p1 * 10**5;\t\t\t# in N/m**2\n", + "p2 = p2 * 10**5;\t\t\t# in N/m**2\n", + "p3 = p3 * 10**5;\t\t\t# in N/m**2\n", + "n = 1.3;\n", + "v2 = v1 * ((p1/p2)**(1/1.3));\t\t\t# in m**3\n", + "W1_2 = ((p2 * v2)-(p1 * v1))/(1-n);\t\t\t# in J\n", + "Gamma = 1.4;\n", + "v3 = v2 * ((p2/p3)**(1/Gamma));\t\t\t# in m**3\n", + "W2_3 = ((p3 * v3) - (p2 * v2))/(1-Gamma);\t\t\t# in J\n", + "W_net = W1_2 + W2_3;\t\t\t# in J\n", + "W_net = W_net * 10**-3;\t\t\t# in kJ\n", + "\n", + "# Results\n", + "print \"net work done in kJ is : %.2f\"%W_net\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch5.ipynb b/Thermodynamics_by_K._M._Gupta/ch5.ipynb new file mode 100644 index 00000000..e71a7edd --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch5.ipynb @@ -0,0 +1,284 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5 : First Law of Thermodynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1 Page No : 115" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The mass flow rate of air in kg/min is : 20.0\n", + "The change in the work flow in kJ/min is : 740.0\n", + "Change in velocity of the air flow in m/min is : -13.32\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "v1_total = 7;\t\t\t# in m**3/min\n", + "v_s1 = 0.35;\t\t\t# in m**3/kg\n", + "v_s2 = 0.12;\t\t\t# in m**3/kg\n", + "p1 = 1;\t\t\t# in bar\n", + "p1 = p1 * 10**5;\t\t\t# in N/m**2\n", + "p2 = 6;\t\t\t# in bar\n", + "p2 = p2 * 10**5;\t\t\t# in N/m**2\n", + "D1 = 110;\t\t\t# in mm\n", + "D1 = D1 * 10**-3;\t\t\t# in m\n", + "D2 = 65;\t\t\t# in mm\n", + "D2 = D2 * 10**-3;\t\t\t# in m\n", + "\n", + "# Calculations and Results\n", + "Af1 = math.pi/4*D1**2;\t\t\t# in m**2\n", + "Af2 = math.pi/4*D2**2;\t\t\t# in m**2\n", + "# v1_total = m1 * v_s1\n", + "m1 = v1_total / v_s1;\t\t\t#in kg/min\n", + "print \"The mass flow rate of air in kg/min is :\",m1\n", + "\n", + "m2 = m1;\t\t\t# in kg/min\n", + "v2_total = m2 * v_s2;\t\t\t# in m**3/min\n", + "del_W_flow = (p2 * v2_total) - (p1 * v1_total);\t\t\t# in J/min\n", + "print \"The change in the work flow in kJ/min is : \",del_W_flow*10**-3\n", + "\n", + "v_f1 = v1_total/Af1;\t\t\t# in m/min\n", + "v_f2 = v2_total /Af2;\t\t\t#in m/min\n", + "del_v = v_f2 - v_f1;\t\t\t# in m/min\n", + "print \"Change in velocity of the air flow in m/min is : %.2f\"%del_v\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2 Page No : 118" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of heat transfer to the water jacket in kJ/sec 16.67\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "m = 2.;\t\t\t# in kg per min\n", + "m = m / 60;\t\t\t# in kg per sec\n", + "W = 20;\t\t\t# in kW\n", + "h1 = 1400;\t\t\t# in kJ/kg\n", + "h2 = 1300;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations\n", + "Q = (m * (h2 - h1)) + W;\t\t\t# in kJ/s\n", + "\n", + "# Results\n", + "print \"Rate of heat transfer to the water jacket in kJ/sec %.2f\"%Q\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3 Page No : 127" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The power output of the turbine in MW is : -1.471\n", + "Total error introduced in % is : 0.4\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "g= 9.81;\n", + "p1 = 3;\t\t\t# in Mpa\n", + "p2 = 10;\t\t\t# in kPa\n", + "T1 = 350;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "m = 1;\t\t\t# in kg per sec\n", + "v1 = 50;\t\t\t# in m per sec\n", + "v2 = 120;\t\t\t# in m per sec\n", + "z1 = 2;\t\t\t# in m\n", + "z2 = 5;\t\t\t# in m\n", + "C_p = 1.005;\t\t\t# in kJ per sec\n", + "Q = 5;\t\t\t# in kJ per sec\n", + "\n", + "# Calculations and Results\n", + "Q = -(Q) * 10**3;\t\t\t# in J per sec\n", + "T2 = (p2 * T1)/p1;\t\t\t# in K\n", + "del_h = C_p * (T2-T1);\t\t\t# in kJ\n", + "del_h = del_h * 10**3;\t\t\t# in J\n", + "t = m * ( del_h +(v2**2-v1**2)/2 + (g * (z2 - z1)));\t\t\t# t is variable taken for calculation\n", + "W_s = Q - t;\t\t\t# in J per sec\n", + "W_s = W_s * 10**-6;\t\t\t# in MW\n", + "print \"The power output of the turbine in MW is : %.3f\"%W_s\n", + "\n", + "# If kinetic and potential energy are ignored then\n", + "W_s2 = Q -(m * del_h);\t\t\t# in J per sec\n", + "W_s2 = W_s2 * 10**-6;\t\t\t# in MW\n", + "errorIntroduced= (abs(W_s)-abs(W_s2))/abs(W_s)*100;\t\t\t# in %\n", + "print \"Total error introduced in %% is : %.1f\"%errorIntroduced\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4 Page No : 128" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quantity of water circulated through the pipe in kg/hr is : 2189.69\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h1 = 246.6;\t\t\t# in kJ/kg\n", + "h2 = 198.55;\t\t\t# in kJ/kg\n", + "W = 0;\n", + "g= 9.8;\n", + "Q= -(105000);\t\t\t# in kJ per hr\n", + "\n", + "# Calculations\n", + "# m * (h1 + ((v1***2)/(2*1000)) + ((g * z1)/1000)) + Q = m * (h2 + ((v2**2)/(2*1000)) + ((g * z2)/1000)) + W\n", + "# v1 and v2 is change in velocity is neglected and z2 = z1 + 10\n", + "m = Q/( (h2-h1) + ((g * 10)/1000) );\t\t\t# kg per hr\n", + "\n", + "# Results\n", + "print \"Quantity of water circulated through the pipe in kg/hr is : %.2f\"%m\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5 Page No : 128" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power of the motor required to drive the compressor in kW is : 45.17\n", + "Ratio of inlet pipe diameter to outlet pipe diameter is : 2.24\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "#Given data \n", + "m=15.;\t\t\t # in kg/min\n", + "m= m/60;\t\t\t# in kg/sec\n", + "H1= 5;\t \t\t# in kJ/kg\n", + "H1= H1*10**3;\t\t\t# in J/kg\n", + "H2= 173;\t\t\t# in kJ/kg\n", + "H2= H2*10**3;\t\t\t# in J/kg\n", + "V1= 5;\t\t \t# in m/s\n", + "V2= 7.5;\t\t\t# in m/s\n", + "Q= 760;\t\t\t # in kJ/min\n", + "Q= Q*10**3/60;\t\t\t# in J/s\n", + "\n", + "# Calculations and Results\n", + "# Formula (H1+V1**2/2)+(-Q)= (H2+V2**2/2)+W\n", + "W= (H1+V1**2/2)+(-Q)-(H2+V2**2/2);\t\t\t# in W/kg\n", + "W= W*10**-3;\t\t\t# in kW/kg\n", + "# The work done will be\n", + "W= m*W;\t\t\t# in kW\n", + "P= abs(W);\t\t\t# in kW\n", + "print \"Power of the motor required to drive the compressor in kW is : %.2f\"%P\n", + "\n", + "# Part (b)\n", + "v1= 0.5;\t\t\t# in m**3/kg\n", + "v2= 0.15;\t\t\t# in m**3/kg\n", + "# A1/A2= rho2*V2/(rho1*V1) = v1*V2/(v2*V1)\n", + "ratioOFA1andA2= v1*V2/(v2*V1);\n", + "radioOFd1andd2= math.sqrt(ratioOFA1andA2);\n", + "print \"Ratio of inlet pipe diameter to outlet pipe diameter is : %.2f\"%radioOFd1andd2\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch6.ipynb b/Thermodynamics_by_K._M._Gupta/ch6.ipynb new file mode 100644 index 00000000..256d5117 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch6.ipynb @@ -0,0 +1,709 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6 : Second Law of Thermodynamics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1 Page No : 138" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Temperature of the source in °C is : 37.0\n", + "Temperature of the math.sink in °C is : 99.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "# In first case (T1-T2)/T1=1/6 or T1= 1.2*T2 (i)\n", + "# In seond case (T1-(T2-62))/T1= 2/6 or 2*T1 -3*(T2-62)=0 (ii)\n", + "# From eq (i) and (ii)\n", + "T2= 186/0.6;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "T1= 1.2*T2;\t\t\t# in K\n", + "\n", + "# Results\n", + "print \"Temperature of the source in °C is : \",T2-273\n", + "print \"Temperature of the math.sink in °C is : \",T1-273\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2 Page No : 138" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power rquired for operating the pump in kW is : 1.074\n", + "The value of T1 in °C is : 49.00\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "T1 = 25.;\t\t\t# in °C\n", + "T2 = 1.; \t\t\t# in °C\n", + "T1 = T1 + 273.;\t\t\t# in K\n", + "T2 = T2 + 273.;\t\t\t# in K\n", + "HT= 2.;\t \t\t# heat transfer across the wall and the roof in MJ/hr\n", + "\n", + "# Calculations and Results\n", + "HT= HT*10**6; \t\t\t# in J/hr\n", + "Q = HT* (T1-T2);\t\t\t# in J/hr\n", + "COP_heat = T1/(T1-T2);\n", + "W_net = Q/COP_heat;\t\t\t# in J/hr\n", + "print \"Power rquired for operating the pump in kW is : %.3f\"%(W_net*10.**-3./3600)\n", + "\n", + "# Part (b)\n", + "T2= 25.;\t\t\t# in °C\n", + "T2=T2+273;\t\t\t# in K\n", + "# COP= T2/(T1-T2) (i)\n", + "# COP= HT*(T1-T2)/W_net (ii)\n", + "# From (i) and (ii)\n", + "T1= math.sqrt(W_net*T2/HT)+T2;\t\t\t# in K\n", + "T1= T1-273;\t\t\t# in °C\n", + "print \"The value of T1 in °C is : %.2f\"%T1\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3 Page No : 142" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ratio of heat trasferred to the circulating water to heat trasferred to the engine is : 2.28\n" + ] + } + ], + "source": [ + "\n", + "\n", + "# Variables\n", + "heatEngineEffi= 32./100;\t\t\t# heat engine efficiency\n", + "COP= 5. \t\t\t# COP of heat pump\n", + "\n", + "# Calculations\n", + "# heat engine efficiency = Wnet/Q1 = (Q1-Q2)/Q1\n", + "Q1byWnet= 1/heatEngineEffi;\n", + "Q2byWnet= (1-heatEngineEffi)*Q1byWnet;\n", + "# COP = Q4/Wnet = Q4/(Q4-Q3)\n", + "Q4byWnet= COP;\n", + "ratio= (Q2byWnet+Q4byWnet)/Q1byWnet;\t\t\t# ratio of heat transferred to the circulating water to heat trasferred to the engine\n", + "\n", + "# Results\n", + "print \"Ratio of heat trasferred to the circulating water to heat trasferred to the engine is : \",ratio\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4 Page No : 147" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of Carnot Power in kWh is : 10.823\n", + "As the actual power produced by the invented engine is more than the Carnot Power, \n", + "so inverter claim is not true\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q = 88;\t\t\t# in MJ\n", + "Q=Q*10**3;\t\t\t# in kJ\n", + "T1 = 190.;\t\t\t# in °C\n", + "\n", + "# Calculations\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T3 = -15;\t\t\t# in °C\n", + "T3 = T3 + 273;\t\t\t# in K\n", + "Eta_carnot = (T1 - T3)/T1;\n", + "Wnet= Eta_carnot * Q;\t\t\t# in kJ\n", + "CarnotPower= Wnet/3600.;\t\t\t# in kWh\n", + "\n", + "# Results\n", + "print \"The value of Carnot Power in kWh is : %.3f\"%CarnotPower\n", + "print (\"As the actual power produced by the invented engine is more than the Carnot Power, \");\n", + "print (\"so inverter claim is not true\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5 Page No : 148" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The theoretical minimum power required to drive the heat pump in kW is : 2.058\n", + "The theoretical power required to drive the heat pump when it is used as a refrigerator in kW is : 2.22\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "T1 = 24.;\t\t \t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 2;\t\t \t# in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "Q = 100; \t\t\t#in MJ/h\n", + "Q = Q * 10**3;\t\t\t#in kJ/h\n", + "\n", + "# Calculations and Results\n", + "COP_heatPump = T1/(T1-T2);\n", + "W = Q/COP_heatPump;\t\t\t#in kJ/h\n", + "W = W/3600.;\t\t\t # in kW\n", + "print \"The theoretical minimum power required to drive the heat pump in kW is : %.3f\"%W\n", + "\n", + "COP_refrigerator = T2/(T1-T2);\n", + "W = Q/COP_refrigerator;\t\t\t# in kJ/h\n", + "W = W/3600.; \t\t\t# in kW\n", + "print \"The theoretical power required to drive the heat pump when it is used as a refrigerator in kW is : %.2f\"%W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6 Page No : 150" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Part (a)\n", + "The cycle is irreversible\n", + "Part (b)\n", + "Reversible or irreversible cycle is not possible and the result is impossible\n", + "Part (c)\n", + "The cycle is reversible\n" + ] + } + ], + "source": [ + "# Variables\n", + "Q1= 278.;\t\t\t# in kJ/s\n", + "T1= 283.+273;\t\t\t# in K\n", + "T2= 50.+273;\t\t\t# in K\n", + "print (\"Part (a)\")\n", + "Q2= 208.;\t\t\t# in kJ/s\n", + "\n", + "# Calculations and Results\n", + "# By Clausius inequality \n", + "V= Q1/T1-Q2/T2;\n", + "if V<0:\n", + " print (\"The cycle is irreversible\")\n", + "elif V>0:\n", + " print (\"Reversible or irreversible cycle is not possible and the result is impossible\")\n", + "else:\n", + " print (\"The cycle is reversible\")\n", + "\n", + "print (\"Part (b)\")\n", + "Q2= 139.;\t\t\t# in kJ/s\n", + "V= Q1/T1-Q2/T2;\n", + "if V<0:\n", + " print (\"The cycle is irreversible\")\n", + "elif V>0:\n", + " print (\"Reversible or irreversible cycle is not possible and the result is impossible\")\n", + "else:\n", + " print (\"The cycle is reversible\")\n", + "\n", + "print (\"Part (c)\")\n", + "Q2= 161.5;\t\t\t# in kJ/s\n", + "V= Q1/T1-Q2/T2;\n", + "if V<0:\n", + " print (\"The cycle is irreversible\")\n", + "elif V>0:\n", + " print (\"Reversible or irreversible cycle is not possible and the result is impossible\")\n", + "else:\n", + " print (\"The cycle is reversible\")\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.16 Page No : 155" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The heat rejected in MJ/h is : 60.8\n", + "Irreversibility in kJ/h is : 8.114\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Wnet_compresser= 3.;\t \t\t# in kW\n", + "Wnet_compresser=Wnet_compresser*3600.;\t\t\t# in kJ/h\n", + "Qabsorbed= 50.;\t \t\t # in MJ/h\n", + "Qabsorbed=Qabsorbed*10**3;\t\t\t # in kJ/h\n", + "\n", + "# Calculations and Results\n", + "T1 = 46+273;\t\t\t# in K\n", + "T2 = 1+273; \t\t\t# in K\n", + "Qrejected= Wnet_compresser+Qabsorbed;\t\t\t# in kJ/h\n", + "print \"The heat rejected in MJ/h is : \",Qrejected*10**-3\n", + "\n", + "I= -(-Qrejected/T1+Qabsorbed/T2);\t\t\t# in kJ/h\n", + "print \"Irreversibility in kJ/h is : %.3f\"%I\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.17 Page No : 156" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time taken by the heater to raise the temperature in sec is : 3.34\n", + "Entrophy generated during the process in kJ/K is : 20.72\n" + ] + } + ], + "source": [ + "#Exa 6.17\n", + "import math \n", + "\n", + "\n", + "# Variables\n", + "T1 = 12.; \t\t\t# in °C\n", + "T2 = 92.;\t \t\t# in °C\n", + "T1 = T1 + 273.;\t\t\t# in K\n", + "T2 = T2 + 273.;\t\t\t# in K\n", + "del_T = T2 - T1;\t\t\t# in K\n", + "m = 20;\t\t\t # in kg\n", + "C_v = 4.187;\n", + "s= 1;\n", + "\n", + "# Calculations and Results\n", + "Q = m * s * del_T;\t\t\t# in cal\n", + "Q = Q * 4.18;\t \t\t# in J\n", + "H = 2;\t \t \t# heat given by the heater in kw\n", + "H = H * 10**3;\t\t \t# in J/sec\n", + "t = Q/H;\t\t\t #time taken by the heater to raise the temp. in sec\n", + "print \"Time taken by the heater to raise the temperature in sec is : %.2f\"%t\n", + "\n", + "del_phi = m * C_v * math.log(T2/T1);\t\t\t# in kJ/K\n", + "print \"Entrophy generated during the process in kJ/K is : %.2f\"%del_phi\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.18 Page No : 156" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Carnot efficiency in % is : 50.18\n", + "Efficiency of the heat engine in % is : 50.8\n", + "As the efficiency of heat engine cannot be more than Carnot efficiency, Hence engine cannot execute irreversible cycle.\n" + ] + } + ], + "source": [ + "# Exa 6.18\n", + "import math \n", + "\n", + "# Variables\n", + "Q1 = 1000.;\t\t\t# in kW\n", + "Q2 = 492.;\t\t\t# in kW\n", + "T1 = 285.;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 5.;\t\t\t # in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "\n", + "# Calculations and Results\n", + "Eta_carnot = (T1-T2)/T1*100;\t\t\t# in percentage\n", + "print \"Carnot efficiency in %% is : %.2f\"%Eta_carnot\n", + "\n", + "Eta_heat = (Q1 - Q2)/Q1*100;\t\t\t# in percentage\n", + "print \"Efficiency of the heat engine in % is : \",Eta_heat\n", + "if Eta_heat>Eta_carnot:\n", + " print (\"As the efficiency of heat engine cannot be more than Carnot efficiency, Hence\\\n", + " engine cannot execute irreversible cycle.\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.19 Page No : 156" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of the engine in watt is 36.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "n = 1080.;\t\t\t# in cycle/min\n", + "Q_s = 57.;\t\t\t# in J/cycle\n", + "T1 = 12.;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 2.;\t\t\t# in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "# 1-(Q_r/Q_s) = 1- (T2/T1)\n", + "Q_r = (T2/T1)*Q_s;\t\t\t# in J/cycle\n", + "W = Q_s - Q_r;\t\t\t# in J/cycle\n", + "P_o = W * n;\t\t\t# in J/min\n", + "P_o = P_o/60;\t\t\t# in W\n", + "\n", + "# Results\n", + "print \"The output of the engine in watt is\",P_o\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.20 Page No : 157" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Minimum power required in kW is : 2.354\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q2 = 10.**5;\t\t\t# in kJ/hr\n", + "T1 = -3.;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 22.;\t\t\t# in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "COP_heat = 1./(1-T1/T2);\n", + "W = Q2/COP_heat;\t\t\t# in kJ/hr\n", + "W = W/3600.; \t\t\t# in kW\n", + "\n", + "# Results\n", + "print \"Minimum power required in kW is : %.3f\"%W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.21 Page No : 158" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "engine efficiency in % is : 66.7\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "T_A= 927.+273;\t\t\t# in K\n", + "T_B= 127.+273;\t\t\t# in K\n", + "T_C= T_B;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "# Q_A= Q_B+Q_C+W = 2*Q_B+W (math.since Q_B=Q_C) (i)\n", + "# Q_A/T_A= Q_B/T_B+Q_C/T_C or\n", + "# Q_A= 2*Q_B*T_A/T_B (ii)\n", + "# From eq (i) and (ii)W= 2*Q_B*(T_A/T_B-1) (iii)\n", + "# Dividing (iii) by (ii)\n", + "WbyQ_A= (T_A/T_B-1)/(T_A/T_B);\n", + "\n", + "# Results\n", + "print \"engine efficiency in %% is : %.1f\"%(WbyQ_A*100)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.22 Page No : 158" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The heat rejected at B in kJ is : 142.86\n", + "The heat rejected at C in kJ is : 857.14\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "T_A= 700.;\t\t\t# in K\n", + "T_B= 600.;\t\t\t# in K\n", + "T_C= 500.;\t\t\t# in K\n", + "Q_A= 1200.;\t\t\t# in kJ\n", + "\n", + "# Calculations\n", + "# Q_B+Q_C= Q_A-200 (i)\n", + "# Q_A/T_A = Q_B/T_B+Q_C/T_C (ii)\n", + "# From eq(i) and (ii)\n", + "Q_B= (Q_A*(1/T_B-1/T_A)-200/T_B)/(1/T_B-1/T_C);\t\t\t# in kJ\n", + "Q_C= Q_A-Q_B-200;\t\t\t# in kJ\n", + "\n", + "# Results\n", + "print \"The heat rejected at B in kJ is : %.2f\"%Q_B\n", + "print \"The heat rejected at C in kJ is : %.2f\"%Q_C\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.23 Page No : 159" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "intermediate temperature in °C is : 100\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "T1= 180+273;\t\t\t# in K\n", + "T2= 20+273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "# W_A/Q1= 1-T3/T1 (i)\n", + "# W_B/QB= 1-T2/T3 (ii)\n", + "# W_A= W_B (iii)\n", + "# Q1= Q_B+W_A (iv)\n", + "# From eq(i),(ii),(iii) and (iv)\n", + "T3= (T1+T2)/2;\t\t\t# in K\n", + "\n", + "# Results\n", + "print \"intermediate temperature in °C is : \",T3-273\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.24 Page No : 160" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Least power required in kW is : 0.305\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q2 = 1.75;\t\t\t# in kJ/sec\n", + "T1 = -15;\t\t\t# in °C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 30;\t\t\t# in °C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "del_T = T2 - T1;\t\t\t# in K\n", + "# Q2/W_net = T2/(del_T)\n", + "W_net = Q2 * del_T/T1;\t\t\t# in kW\n", + "\n", + "# Results\n", + "print \"Least power required in kW is : %.3f\"%W_net\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch7.ipynb b/Thermodynamics_by_K._M._Gupta/ch7.ipynb new file mode 100644 index 00000000..2804115d --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch7.ipynb @@ -0,0 +1,298 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3e3cc60dc2a7aa47248e51781bc474e34ce30f23ed528c32391da2267db7146e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Entropy" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 Page No : Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "v1 = 0.05;\t\t \t# in m**3\n", + "v2 = 8. * v1;\t\t\t# in m**3\n", + "T1 = 280.;\t\t \t# in \u00b0C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 25.;\t\t # in \u00b0C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "p1 = 8.;\t \t\t# in bar\n", + "C_p = 1.005;\t\t\t# in kJ/kgK\n", + "C_v = 0.712;\t\t\t# in kJ/kgK\n", + "\n", + "# Calculations\n", + "R = C_p - C_v;\t\t\t# in kJ/kgK\n", + "del_phi = (R * ( math.log(v2/v1)) ) + (C_v * (math.log(T2/T1)) );\t\t\t# in kJ/kgK\n", + "\n", + "# Results\n", + "print \"The change in entrophy of air during the process in kJ/kgK is : %.3f\"%del_phi\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The change in entrophy of air during the process in kJ/kgK is : 0.169\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 5.; \t\t\t# in kg\n", + "T1 = 50.;\t \t\t# in \u00b0C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 250.;\t\t\t # in \u00b0C\n", + "T2 = T2 + 273;\t \t# in K\n", + "C_p = 1.0;\n", + "C_v = 0.72;\n", + "T3 = 50.; \t\t\t# in \u00b0C\n", + "T3 = T3 + 273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "del_phi = m * C_p * (math.log(T2/T1));\t\t\t# in kJ/ K (this is increase in entrophy)\n", + "del_phi1 = m * C_v * (math.log(T3/T2));\t\t\t# in kJ/K (this is decrease in entrophy)\n", + "phi_net = del_phi - abs(del_phi1);\t\t\t # in kJ/K\n", + "\n", + "# Results\n", + "print \"net change in entrophy in kJ/K is : %.3f\"%phi_net\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "net change in entrophy in kJ/K is : 0.675\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 Page No : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Q1 = 1600.;\t\t\t# in kJ\n", + "Q2 = 1600.;\t\t\t# in kJ\n", + "T1 = 800.;\t\t\t# in K\n", + "T2 = 127.;\t\t\t# in \u00b0C\n", + "\n", + "# Calculations\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "d1_phi = Q1/T1;\t\t\t# in kJ per K\n", + "d2_phi = Q2/T2;\t\t\t# in kJ per K\n", + "net_phi = d2_phi - d1_phi;\t\t\t# in kJ per K\n", + "\n", + "# Results\n", + "print \"entrophy generated during the process in kJ/K is : \",net_phi\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "entrophy generated during the process in kJ/K is : 2.0\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 Page No : 175" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T_A = 50.+273;\t\t\t# in K\n", + "T_B = 13.+273;\t\t\t# in K\n", + "P_A = 130.;\t\t\t# in kPa\n", + "P_B = 100.;\t\t\t# in kPa\n", + "Cp = 1.005;\t\t\t# in kJ/kg-K\n", + "pvByT = 0.287;\t\t\t# p in kPa, v in m**3/kg, T in K\n", + "\n", + "# Calculations\n", + "del_S_system = Cp*math.log(T_B/T_A)-pvByT*math.log(P_B/P_A);\t\t\t# in kJ/kg-K\n", + "del_S_surrounding = 0;\n", + "del_S_universe = del_S_system+del_S_surrounding;\t\t\t# in kJ/kg-K\n", + "\n", + "# Results\n", + "print \"change in entropy in kJ/kg-K is : %.3f\"%del_S_universe\n", + "print (\"But a negative change in entropy is not possible,\");\n", + "print (\"therefore the flow of air must be from B to A\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in entropy in kJ/kg-K is : -0.047\n", + "But a negative change in entropy is not possible,\n", + "therefore the flow of air must be from B to A\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 Page No : 176" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 5.\t \t\t# in kg\n", + "s= 4.18 \n", + "T1 = 0.\t \t\t# in \u00b0C\n", + "T2 = 20.\t\t\t# in \u00b0C\n", + "dt = T2 - T1;\t\t\t# in \u00b0C\n", + "Q = m * s * dt;\t\t\t# in kJ\n", + "L = 335.;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations\n", + "# Q = m_i * l\n", + "m_i = Q/L;\t\t\t# in kg\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "del_S = ((m_i * L)/T1) - (m * s * (math.log(T1/T2)));\t\t\t# in kJ per K\n", + "\n", + "# Results\n", + "print \"change in entropy of the adiabatic system in kJ/K is %.3f\"%del_S\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in entropy of the adiabatic system in kJ/K is 3.009\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "p1 = 1. * 10**5;\t\t\t# in N/m**2\n", + "C_p = 1.005;\t\t\t# in kJ/kg k\n", + "R = 287.;\t\t\t# in j/kg k\n", + "T1 = 290.;\t\t\t# in K\n", + "T2 = 580.;\t\t\t# in K\n", + "v1 = 1.;\t\t\t# in m**3\n", + "\n", + "# Calculations\n", + "m = (p1 * v1)/(R * T1);\t\t\t# in kg\n", + "Q = m * R * (T2-T1);\t\t\t# in J\n", + "Q = Q * 10**-3;\t\t\t# in kJ\n", + "del_phi = m * C_p * (math.log(T2/T1));\t\t\t# in kJ per K\n", + "R = R * 10**-3;\t\t\t# in kJ/kg K\n", + "C_v = C_p - R;\t\t\t# in kJ/kg k\n", + "del1_phi = m * C_v * (math.log(T1/T2));\t\t\t# in kJ/K\n", + "net_phi = del_phi + del1_phi;\t\t\t# in kJ/K\n", + "\n", + "# Results\n", + "print \"Over all change in entrophy in kJ/K is : %.4f\"%net_phi\n", + "\n", + "# rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Over all change in entrophy in kJ/K is : 0.2390\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_K._M._Gupta/ch8.ipynb b/Thermodynamics_by_K._M._Gupta/ch8.ipynb new file mode 100644 index 00000000..47fbf577 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch8.ipynb @@ -0,0 +1,351 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8 : Availability and Irreversibility" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1 Page No : 185" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The available part of heat in kJ is 6784.0\n", + "The unavailable part of heat in kJ is : 9216.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q = 16.;\t\t\t# in MJ\n", + "Q = Q * 10**3;\t\t\t# in kJ\n", + "T_H = 227.;\t\t\t# in °C\n", + "T_H = T_H + 273;\t\t\t# in K\n", + "T_L = 15.;\t\t\t# in °C\n", + "T_L = T_L + 273;\t\t\t# in K\n", + "\n", + "# Calculations and Results\n", + "del_S = Q/T_H;\t\t\t# in kJ/K\n", + "A = Q - (T_L * del_S);\t\t\t# in kJ\n", + "print \"The available part of heat in kJ is \",A\n", + "\n", + "U_P_ofHeat = T_L * del_S;\t\t\t# unavailable part of heat in kJ\n", + "print \"The unavailable part of heat in kJ is :\",U_P_ofHeat\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2 Page No : 185" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Available work is in kJ 6000.0\n", + "Unavailable work is in kJ 6000.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "Q = 12000.;\t\t\t# in kJ\n", + "T_H = 600.;\t\t\t# in K\n", + "T_L = 300.;\t\t\t# in K\n", + "\n", + "# Calculations and Results\n", + "dS = Q / T_H;\t\t\t#in kJ/K\n", + "A = Q - (T_L * dS);\t\t\t#available work in kJ\n", + "print \"Available work is in kJ\",A\n", + "\n", + "UA = T_L * dS;\t\t\t#unavailable work in kJ\n", + "print \"Unavailable work is in kJ\",UA\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3 Page No : 185" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Available energy in MJ is : 190.0\n", + "Unavailable energy in MJ is : 110.0\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "m = 800.;\t\t\t# in kg\n", + "C_p = 0.5;\t\t\t# in kJ/kg K\n", + "T2 = 500.;\t\t\t# in K\n", + "T1 = 1250.;\t\t\t# in K\n", + "T_o = 300.;\t\t\t# in K\n", + "\n", + "# Calculations and Results\n", + "del_t = T1 - T2; \t\t\t# in K\n", + "Q = m * C_p * del_t; \t \t\t# in kJ\n", + "dS = abs(m * C_p * math.log(T2/T1));\t\t\t# in kJ/K\n", + "availableEnergy = Q - (T_o * dS);\t\t\t#in kJ\n", + "print \"Available energy in MJ is :\",round(availableEnergy*10**-3)\n", + "\n", + "unavailableEnergy = T_o * dS;\t\t\t# UA for unavailable energy in kJ\n", + "print \"Unavailable energy in MJ is :\",(round(unavailableEnergy*10**-3))\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4 Page No : 197" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The availablibity per kg of steam entering in kcl/kg is : 255.56\n", + "The availablibity per kg of steam leaving in kcl/kg is : 75.50\n", + "reversible work per kg of steam in kcl/kg is : 180.0598\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h_i = 726.1;\n", + "h_o = 25.03;\n", + "T_o = 298;\t\t\t# in K\n", + "s_i = 1.582;\n", + "s_o = 0.087;\n", + "h2 = 669.;\n", + "s2 = 1.677;\n", + "\n", + "# Calculations and Results\n", + "h3 = 52.17 + (0.9 * 567.7);\n", + "s3 = 0.1748 + (0.9 * 1.7448);\n", + "sai_i = (h_i - h_o) - (T_o * (s_i - s_o));\t\t\t# in kcl/kg\n", + "print \"The availablibity per kg of steam entering in kcl/kg is : %.2f\"%sai_i\n", + "\n", + "sai_e = (0.25 * ((h2 - h_o) - (T_o * (s2 - s_o)))) + (0.75 * ((h3 - h_o) - (T_o * (s3 - s_o)))) ;\t\t\t# in kcl/kg\n", + "print \"The availablibity per kg of steam leaving in kcl/kg is : %.2f\"%sai_e\n", + "\n", + "w_rev = sai_i - sai_e;\t\t\t# in kcl/kg\n", + "print \"reversible work per kg of steam in kcl/kg is : %.4f\"%w_rev\n", + "\n", + "# Note: There is calculation error in evaluating the value of availability per kg of \n", + "# steam leaving in kcl/kg . so the answer in the book is wrong and coding is right.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5 Page No : 198" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The irreversiblity in kcal/hr 43500566.0\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "T_o = 298;\t\t\t# in K\n", + "m2 = 25000;\n", + "s2 = 16775;\n", + "m3 = 75000;\n", + "s3 = 17448;\n", + "m1 = 1000000;\n", + "s1 = 1582;\n", + "Q = -16;\t\t\t# in MJ\n", + "\n", + "# Calculations\n", + "Q = Q * 10**3;\t\t\t# in kJ\n", + "I = (T_o * ((m2 * s2) + (m3 * s3) - (m1 * s1))) - Q;\t\t\t# in cal/hr\n", + "I=I*10**-3;\t\t\t# in kcal/hr\n", + "\n", + "# Results\n", + "print \"The irreversiblity in kcal/hr\",I\n", + "\n", + "# Note: There is calculation error in evaluating the value of the irreversibility\n", + "# in kcal/hr. so the answer in the book is wrong and coding is right.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6 Page No : 198" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The availablibity before adiabatic throttling in kcal/kg is : 267.49\n", + "The availablibity before adiabatic throttling in kcal/kg is : 245.61\n", + "Reversible work in kcal/kg is : 21.87\n", + "Irreversibility per kg of steam in kcal/kg is : 21.87\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h_i = 749.2;\n", + "h_o = 25.03;\n", + "T_o = 298;\t\t\t# in K\n", + "s_i = 1.6202;\n", + "s_o = 0.0877;\n", + "\n", + "# Calculations and Results\n", + "phi_i = (h_i - h_o)- (T_o * (s_i - s_o));\t\t\t# kcal/kg\n", + "print \"The availablibity before adiabatic throttling in kcal/kg is : %.2f\"%phi_i\n", + "\n", + "h_e = 749.2;\n", + "s_e = 1.6936;\n", + "phi_e = (h_e - h_o) - (T_o * (s_e - s_o));\t\t\t# in kcal/kg\n", + "print \"The availablibity before adiabatic throttling in kcal/kg is : %.2f\"%phi_e\n", + "\n", + "Wrev = phi_i - phi_e;\t\t\t# in kcal/kg\n", + "print \"Reversible work in kcal/kg is : %.2f\"%Wrev\n", + "\n", + "Wactual = 0;\n", + "i = Wrev-Wactual;\t\t\t# in kcal/kg\n", + "print \"Irreversibility per kg of steam in kcal/kg is : %.2f\"%i\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.7 Page No : 199" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Lost work in kcal/kg is 63.3567\n", + "Irreversebility per kg of air flow in kcal/kg is : 31.467\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "# del_W = T * ds - del_Q\n", + "T = 600;\t\t\t# in K\n", + "p_i = 7;\t\t\t#kgf/cm**2\n", + "p_e = 1.5;\t\t\t#kgf/cm**2\n", + "T_o = 298;\t\t\t# in K\n", + "\n", + "# Calculations and Results\n", + "R = 29.27/427;\n", + "del_W_lost = T * ( R *math.log(p_i/p_e));\t\t\t# in kcal/kg\n", + "print \"Lost work in kcal/kg is\",round(del_W_lost,4)\n", + "\n", + "i = T_o * (R * (math.log(p_i/p_e)));\t\t\t# in kcal/kg\n", + "print \"Irreversebility per kg of air flow in kcal/kg is : %.3f\"%i\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/ch9.ipynb b/Thermodynamics_by_K._M._Gupta/ch9.ipynb new file mode 100644 index 00000000..fb25cd57 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch9.ipynb @@ -0,0 +1,643 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9 : Properties of Steam and Thermodynamic Cycles" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1 Page No : 217" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Part (i) : For dry saturated steam at 17.8 bar\n", + "Part (i) : For dry saturated steam at 17.8 bar\n", + "The specific volume in litre/kg is : 0.11536\n", + "The enthalpy in kJ/kg is : 2796.28\n", + "The latent heat in kJ/kg is : 1914.4\n", + "The entropy in kJ/kg K 6.383\n", + "Part (ii) : For superheated steam at 16 bar and 340°C\n", + "The specific volume in m**3/kg is : 0.17114\n", + "The enthalpy in kJ/kg is : 3119.6\n", + "The entropy in kJ/kg K is : 7.0258\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "print (\"Part (i) : For dry saturated steam at 17.8 bar\")\n", + "p= 17.8;\t\t\t# in bar\n", + "p1= 17.5;\t\t\t# in bar\n", + "p2= 18.0;\t\t\t# in bar\n", + "Vs1= 0.1135;\t\t\t# in litre/kg\n", + "Vs2= 0.1104;\t\t\t# in litre/kg\n", + "Hs1= 2796.1;\t\t\t# in kJ/kg\n", + "Hs2= 2796.4;\t\t\t# in kJ/kg\n", + "L1= 1918;\t\t\t# in kJ/kg\n", + "L2= 1912;\t\t\t# in kJ/kg\n", + "phi_s1= 6.389;\t\t\t# in kJ/kg K\n", + "phi_s2= 6.379;\t\t\t# in kJ/kg K\n", + "\n", + "# Calculations and Results\n", + "Vs= Vs1-(Vs2-Vs1)/(p2-p1)*(p-p1);\t\t\t# in litre/kg\n", + "Hs= Hs1+(Hs2-Hs1)/(p2-p1)*(p-p1);\t\t\t# in kJ/kg\n", + "L= L1- (L1-L2)/(p2-p1)*(p-p1);\t\t\t# in kJ/kg\n", + "phi_s= phi_s1- (phi_s1-phi_s2)/(p2-p1)*(p-p1);\t\t\t# in kJ/kg K\n", + "print (\"Part (i) : For dry saturated steam at 17.8 bar\")\n", + "print \"The specific volume in litre/kg is : \",Vs\n", + "print \"The enthalpy in kJ/kg is : \",Hs\n", + "print \"The latent heat in kJ/kg is : \",L\n", + "print \"The entropy in kJ/kg K\",phi_s\n", + "print (\"Part (ii) : For superheated steam at 16 bar and 340°C\")\n", + "\n", + "T= 340.;\t\t\t# in K\n", + "T1= 300.;\t\t\t# in K\n", + "T2= 350.;\t\t\t# in K\n", + "Vsup1= 0.1585;\t\t\t# in m**3/kg\n", + "Vsup2= 0.1743;\t\t\t# in m**3/kg\n", + "Hsup1= 3030;\t\t\t# in kJ/kg\n", + "Hsup2= 3142;\t\t\t# in kJ/kg\n", + "phi_sup1= 6.877;\t\t\t# in kJ/kg K\n", + "phi_sup2= 7.063;\t\t\t# in kJ/kg K\n", + "Vsup= Vsup1+(Vsup2-Vsup1)/(T2-T1)*(T-T1);\t\t\t# in m**3/kg\n", + "Hsup= Hsup1+(Hsup2-Hsup1)/(T2-T1)*(T-T1);\t\t\t# in kJ/kg\n", + "phi_sup= phi_sup1+(phi_sup2-phi_sup1)/(T2-T1)*(T-T1);\t\t\t# in kJ/kg\n", + "print \"The specific volume in m**3/kg is : \",Vsup\n", + "print \"The enthalpy in kJ/kg is : \",Hsup\n", + "print \"The entropy in kJ/kg K is : \",phi_sup\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2 Page No : 219" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of x is : 0.941\n", + "Degree of superheat in °C is : 84.42\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h_sen = 798.43;\t\t\t# in kJ/kg\n", + "L = 1984.3;\t\t\t# in kJ/kg\n", + "H_total_wet = 2665.7;\n", + "\n", + "# Calculations and Results\n", + "# H_total_wet= h_sen+x*L\n", + "x = (H_total_wet - h_sen)/L;\n", + "print \"The value of x is : %.3f\"%x\n", + "\n", + "# Part (b)\n", + "h_total_sup= 2961;\t\t\t# in kJ/kg\n", + "Cps= 2.112;\t\t\t# in kJ/kg\n", + "H_total_dry= 2782.7;\t\t\t# in kJ/kg\n", + "# Let deltaT= T_sup-T_sat\n", + "# h_total_sup = h_sen+L+h_sup = H_total_dry +Cps*deltaT\n", + "deltaT= (h_total_sup-H_total_dry)/Cps;\t\t\t# in °C\n", + "print \"Degree of superheat in °C is : %.2f\"%deltaT\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3 Page No : 219" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Change in entropy during throttling process in kJ/kg-K is : 0.42\n", + "in enthalpy during isentropic process in kJ/kg is : 505\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "H2 = 3055;\t\t\t# in kj per kg\n", + "H3 = 2550;\t\t\t# in kj per kg\n", + "fie_1 = 7.15;\t\t\t# kj per kg k\n", + "fie_2 = 7.57;\t\t\t# kj per kg k\n", + "\n", + "# Calculations and Results\n", + "d_fie= fie_2 - fie_1;\t\t\t# in kj per kg k\n", + "print \"Change in entropy during throttling process in kJ/kg-K is :\",d_fie\n", + "\n", + "dH = H2 - H3;\t\t\t# in kj per kg\n", + "print \"in enthalpy during isentropic process in kJ/kg is : \",dH\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4 Page No : 227" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Part (i) The quantity of heat in case first in kJ is : 3753.0\n", + "Part (ii) The quantity of heat in case second in kJ is : 4170.0\n", + "Part (iii) The quantity of heat in case third in kJ is : 5397.6\n", + "(iv) The quantity of heat in case forth in kJ is : 4950.0\n" + ] + } + ], + "source": [ + "# Exa 9.4\n", + "import math \n", + "\n", + "# Variables\n", + "H_w = 670.4;\t\t\t# in kJ/kg\n", + "L = 2085;\t\t\t# kJ per kg\n", + "T_sat = 158.8;\t\t\t# in degree c\n", + "m = 4;\t\t\t# in kg\n", + "x = 0.5;\n", + "h_sen = 670.4;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations and Results\n", + "H_totalwet = m * ( h_sen + (x *L));\t\t\t# in kJ\n", + "x1 = 0.95\n", + "H_totalwet1 = m *( h_sen + (x1 *L));\t\t\t# in kJ\n", + "Q1 = H_totalwet1 - H_totalwet;\t\t\t# in kJ\n", + "print \"Part (i) The quantity of heat in case first in kJ is : \",Q1\n", + "\n", + "# Part (b)\n", + "x2 = 1;\n", + "H_totaldry = m *( h_sen + (x2 *L));\t\t\t# in kJ\n", + "Q2 = H_totaldry - H_totalwet;\t\t\t# in kJ\n", + "print \"Part (ii) The quantity of heat in case second in kJ is : \",Q2\n", + "\n", + "# Part (c)\n", + "H_totalsup = 3062.3;\t\t\t# in kJ per kg\n", + "H_totalsup = m * H_totalsup;\t\t\t# in kJ\n", + "Q3 = H_totalsup - H_totalwet;\t\t\t# in kJ\n", + "print \"Part (iii) The quantity of heat in case third in kJ is : \",Q3\n", + "\n", + "# Part (d)\n", + "H_totalsup = 2950.4;\t\t\t# in kj per kg\n", + "H_totalsup = m * H_totalsup;\t\t\t# in kj\n", + "Q4 = H_totalsup - H_totalwet;\t\t\t# in kj\n", + "print \"(iv) The quantity of heat in case forth in kJ is : \",Q4\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5 Page No : 228" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Isentropic efficiency in % is : 38.29\n", + "Turbine work is in kJ/kg is : 294.1\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p1 = 2.5; \t\t\t# Mpa\n", + "p1 = p1 * 10**6;\t\t\t# in pa\n", + "p1 = p1 * 10**-5;\t\t\t# in bar\n", + "p2 = 10;\t\t \t# in kpa\n", + "p2 = p2 * 10**3;\t\t\t# in pa\n", + "p2 = p2 * 10**-5;\t\t\t# in bar\n", + "H1 = 2878;\t\t \t# in kJ/kg at 25 bar and 250°C\n", + "H2 = 2583.9;\t\t \t# in kJ/kg at 0.1 bar for dry saturated steam\n", + "AHD= H1-H2;\t\t\t # actual heat drop in kJ/kg\n", + "H2_desh = 2110;\t\t\t # in kj per kg\n", + "\n", + "# Calculations and Results\n", + "IHD = H1 - H2_desh;\t\t\t# Isentropic heat drop in kJ/ kg\n", + "Eta_Isentropic = (AHD/IHD) * 100;\t\t\t# in %\n", + "print \"Isentropic efficiency in %% is : %.2f\"%Eta_Isentropic\n", + "\n", + "# H1 + v1**2/2 + g*z1 + Q = H2 + v2**2/2 + g*z2 + W\n", + "W = H1 - H2;\t\t\t# in kJ/kg (as v1=v2, z1= z2 and Q=0)\n", + "print \"Turbine work is in kJ/kg is :\",W\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6 Page No : 231" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dryness fraction of steam is : 0.97\n", + "Maximum dryness fraction of steam is : 0.951\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "p1 = 11;\t\t\t# in bar\n", + "p2 = 1.2;\t\t\t# in bar\n", + "H_w1 = 781.1;\t\t\t#in kJ/kg\n", + "L1 = 2000;\t\t\t# in kJ/kg\n", + "t1 = 120;\t\t\t# in degree c\n", + "t1 = t1 + 273;\t\t\t# in K\n", + "t2 = 104.81;\t\t\t# in degree c\n", + "t2 = t2 + 273;\t\t\t# in K\n", + "H_dry2 = 2683.4;\t\t\t# in kJ/kg\n", + "C_p = 2.607;\t\t\t# in kJ/kgK\n", + "\n", + "# Calculations and Results\n", + "# From Hw1+x*L1 = H_dry2+Cp*(t1-t2)\n", + "x = (H_dry2 + (C_p * (t1 - t2)) - H_w1) / L1;\n", + "print \"Dryness fraction of steam is : %.2f\"%x\n", + "\n", + "x1 = (H_dry2 - H_w1)/L1;\n", + "print \"Maximum dryness fraction of steam is : %.3f\"%x1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7 Page No : 234" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The dryness fraction for sample steam is : 0.875\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "W = 21.; \t\t\t# in kg\n", + "w_wp = 2.;\t\t\t# in kg\n", + "h1 = 781.15;\t\t\t# in kJ/kg\n", + "L1 = 1998.5;\t\t\t# in kJ/kg\n", + "m = 2.;\t \t\t# in kg\n", + "h2 = 420.5;\t\t\t# in kJ/kg\n", + "L = 2255.9;\t\t\t# in kJ/kg\n", + "t_sat = 100.4;\t\t\t# in degree c\n", + "t1 = 110.;\t\t\t# in degree c\n", + "C_ps = 2.;\t\t\t# in kJ/kgK\n", + "\n", + "# Calculations\n", + "x1 = W / (W + w_wp);\n", + "x2 = (h2 + L + m * (t1-t_sat) - h1)/ L1;\n", + "x = x1 * x2;\n", + "\n", + "# Results\n", + "print \"The dryness fraction for sample steam is : %.3f\"%x\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8 Page No : 235" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Heat transfered per kg in kJ/kg is : 22.58\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "h_sen = 417.4;\t\t\t# in kJ/kg\n", + "h_totaldry = 2675.4;\t\t\t# in kJ/kg\n", + "L = 2258;\t\t\t# in kJ/kg\n", + "v = 5;\t\t\t# in m**3\n", + "v_v = 4.95;\t\t\t# in m**3\n", + "\n", + "# Calculations\n", + "x = v_v/v;\n", + "Q = h_totaldry -(h_sen +x*L);\t\t\t# in kJ/kg\n", + "\n", + "# Results\n", + "print \"Heat transfered per kg in kJ/kg is : \",Q\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9 Page No : 235" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The work done during evaporation in kJ/kg is : 182.55\n", + "Internal latent heat in kJ/kg is : 1710.24\n", + "Internal energy in kJ/kg is : 2472.85\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "m = 1; \t\t\t# in kg\n", + "p = 10;\t\t \t# in bar\n", + "p = p * 10**2;\t\t\t# in kpa\n", + "x = 0.94;\n", + "h_sen = 762.61;\t\t\t# in kJ/kg\n", + "L = 2013.6;\t\t\t # in kJ/kg\n", + "v_s = 0.1942;\t\t\t# in m**3 per kg\n", + "\n", + "# Calculations and Results\n", + "w_ext = p * x * v_s * m;\t\t\t# in kJ/kg\n", + "print \"The work done during evaporation in kJ/kg is : %.2f\"%w_ext\n", + "\n", + "# Part (b)\n", + "L_internal = (x * L) - w_ext;\t\t\t# in kJ/kg\n", + "print \"Internal latent heat in kJ/kg is : %.2f\"%L_internal\n", + "\n", + "# Part (c)\n", + "U_wet = h_sen+x*L-p*x*v_s;\t\t\t# in kJ/kg\n", + "print \"Internal energy in kJ/kg is : %.2f\"%U_wet\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10 Page No : 236" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Entropy of wet steam in kJ/kg-K is : 4.063\n", + "Entropy of dry and saturated steam in kJ/kg-K is : 4.952\n", + "Entropy at 200°C in kJ/kg-K is : 5.053\n" + ] + } + ], + "source": [ + "import math \n", + "\n", + "# Variables\n", + "T_sat = 179.88;\t\t\t# in degree c\n", + "T_sat = T_sat + 273;\t\t\t# in k\n", + "T_sup = 200;\t\t\t# in degree c\n", + "T_sup = T_sup + 273;\t\t\t# in k\n", + "L = 2013.6; \t\t\t# in kJ/kg\n", + "C_ps = 2.326;\n", + "C_pw = 1;\n", + "x = 0.8;\n", + "\n", + "# Calculations and Results\n", + "phi_wet = C_pw *math.log(T_sat/273) + ( (x * L)/T_sat);\t\t\t# in kJ/kg-K\n", + "print \"Entropy of wet steam in kJ/kg-K is : %.3f\"%phi_wet\n", + "\n", + "# Part (b)\n", + "phi_dry =C_pw * math.log(T_sat/273)+L/T_sat;\t\t \t# in kJ/kg\n", + "print \"Entropy of dry and saturated steam in kJ/kg-K is : %.3f\"%phi_dry\n", + "\n", + "# Part (c)\n", + "phi_sup = phi_dry+C_ps *math.log(T_sup/T_sat);\t\t\t # in kJ/kg\n", + "print \"Entropy at 200°C in kJ/kg-K is : %.3f\"%phi_sup\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11 Page No : 236" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The internal energy in % is : 93.21\n", + "The volume of superheated steam in m**3/kg is : 0.1739\n", + "Change in internal energy in kJ is : 291.3\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "m = 1;\t\t\t # in kg\n", + "x = 0.9;\n", + "p = 1;\t \t\t# N/mm**2\n", + "p = p * 10**1;\t\t\t# in bar\n", + "p = p * 10**2;\t\t\t# in kPa\n", + "h_sen = 762.61;\t\t# in kJ/kg\n", + "L = 2013.6;\t\t\t # in kJ/kg\n", + "v_s = 0.1944;\t\t\t# in m**3 per kg\n", + "\n", + "# Calculations and Results\n", + "H_totalwet = h_sen + x*L;\t\t\t# in kJ/kg\n", + "U_wet = H_totalwet - (p * x * v_s);\t\t\t# in kJ/kg\n", + "I = U_wet / H_totalwet;\t\t\t# internal energy as a fraction of total heat\n", + "I = I * 10**2;\t\t\t# in %\n", + "print \"The internal energy in %% is : %.2f\"%I\n", + "\n", + "# Part (b)\n", + "v_s = 0.1542;\t \t\t# in m**3/kg\n", + "h_sen = 815;\t \t\t# in kJ/kg\n", + "L = 1972; \t \t\t# in kJ/kg\n", + "H_totaldry = 2787;\t\t\t# in kJ/kg\n", + "C_ps = 2.199;\n", + "t_sup = 250;\t\t \t# in °C\n", + "t_sup = t_sup + 273;\t\t# in K\n", + "t_sat = 190.74;\t\t\t # in °C\n", + "t_sat = t_sat + 273;\t\t# in K\n", + "p1 = 13 * 10**2;\t\t\t# in kPa\n", + "v_ssup = v_s*t_sup/t_sat;\t\t\t# in m**3/kg\n", + "print \"The volume of superheated steam in m**3/kg is : %.4f\"%v_ssup\n", + "\n", + "# Part (c)\n", + "t_sat = t_sat - 273;\t\t\t# in °C\n", + "t_sup = t_sup - 273;\t\t\t# in °C\n", + "U_sup =h_sen+L+C_ps*(t_sup-t_sat)-p1*v_ssup;\t\t\t# in kJ\n", + "del_U = U_sup - U_wet;\t\t\t# in kJ\n", + "print \"Change in internal energy in kJ is : %.1f\"%del_U\n", + "\n", + "\n", + "# rounding off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12 Page No : 238" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the dryness fraction of steam is : 0.8954\n" + ] + } + ], + "source": [ + "\n", + "# Variables\n", + "m = 0.5;\t\t\t# in kg\n", + "M = 6.6;\t\t\t# in kg\n", + "x1 = M / (M+m);\n", + "h_dry = 2683;\t\t\t#in kJ/kg\n", + "C_p = 2.1;\n", + "h_sen = 814.5;\t\t\t#in kJ/kg\n", + "L = 1973;\t\t\t# in kJ/kg\n", + "t_sup = 120;\t\t\t# in °C\n", + "t_sat = 104.8;\t\t\t# in °C\n", + "\n", + "# Calculations\n", + "x2 =(h_dry+C_p*(t_sup - t_sat)-h_sen)/ L;\n", + "x = x2 * x1;\n", + "\n", + "# Results\n", + "print \"the dryness fraction of steam is : %.4f\"%x\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Thermodynamics_by_K._M._Gupta/screenshots/1.png b/Thermodynamics_by_K._M._Gupta/screenshots/1.png Binary files differnew file mode 100644 index 00000000..ff0d9647 --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/screenshots/1.png diff --git a/Thermodynamics_by_K._M._Gupta/screenshots/2.png b/Thermodynamics_by_K._M._Gupta/screenshots/2.png Binary files differnew file mode 100644 index 00000000..f8a96a1d --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/screenshots/2.png diff --git a/Thermodynamics_by_K._M._Gupta/screenshots/3.png b/Thermodynamics_by_K._M._Gupta/screenshots/3.png Binary files differnew file mode 100644 index 00000000..c0265acc --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/screenshots/3.png |