{
 "metadata": {
  "name": "",
  "signature": "sha256:df5fbd8c032abd96a18eaa179ff1b33448892f4e62b9b9800c35cefba3950007"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Appendix Examples"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.1  Page No : 557"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T = 300.  # The given temperature in K\n",
      "R = 8.31  # Universal gas constant in J/mole-K\n",
      "\n",
      "# Calculations\n",
      "# The total random kinetic energy of one gram mole of oxygen in J\n",
      "U = (3. / 2) * R * T\n",
      "\n",
      "# Output\n",
      "print 'The total random kinetic energy of one gram mole of oxygen is U = %3.0f J ' % (U)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total random kinetic energy of one gram mole of oxygen is U = 3740 J \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.2  Page No : 560"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "a = 0.245  # Van der Waals constant in atoms-litre**2-mole**-2\n",
      "b = 2.67 * 10**-2  # Van der Waals constant in litre-mole**-1\n",
      "R = 8.314 * 10**7  # Universal gas constant in ergs/mole-K\n",
      "\n",
      "# Calculations\n",
      "# Van der Waals constant in dynes-cm**4-mole**-2\n",
      "a1 = a * 76 * 13.6 * 980 * 10**6\n",
      "b1 = b * 10**3  # Van der Waals constant in cm**3mole**-1\n",
      "Tc = (8. / 27) * (a1 / b1) * (1 / R)  # The critical temperature in K\n",
      "Tc1 = Tc - 273  # The critical temperature in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The critical temperature is Tc = %3.2f K  (or) %3.2f degree centigrade ' % (Tc, Tc1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The critical temperature is Tc = 33.12 K  (or) -239.88 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.3  Page No : 565"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = 0.  # The given temperature in degree centigrade\n",
      "E = 5.64 * 10**-21  # The mean kinetic energy of molecules of hydrogen in J\n",
      "R = 8.32  # Universal gas constant in J/mole-K\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The given temperature in K\n",
      "N = (3. / 2) * (R / E) * (T)  # Avogadros number\n",
      "\n",
      "# Output\n",
      "print 'The Avogadro number is N = %3.4g ' % (N)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Avogadro number is N = 6.041e+23 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.4  Page No : 570"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 2. * 10**-8  # The diameter of the molecule of a gas in cm\n",
      "k = 1.38 * 10**-23  # Boltzmanns constant in J/K\n",
      "T = 273.  # The temperature at NTP in K\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "d1 = d / 100  # The diameter of the molecule of a gas in m\n",
      "P = 0.76 * 13.6 * 9.8 * 1000  # The pressure at NTP\n",
      "n = P / (k * T)  # The number of molecules per cubic meter\n",
      "l = 1. / (pi * d1**2 * n)  # The mean free path in m\n",
      "\n",
      "# Output\n",
      "print 'The mean free path at NTP is %3.4g m ' % (l)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mean free path at NTP is 2.961e-07 m \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.6  Page No : 577"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 3. * 10**25  # The number of molecules per cubic metre\n",
      "d = 3.6 * 10**-10  # The diameter of oxygen molecule in m\n",
      "M = 32.  # Molecular weight of oxygen\n",
      "N = 6.023 * 10**26  # Avogadro number\n",
      "k = 1.38 * 10**-23  # Boltzmans constant in J/K\n",
      "T = 273.  # The temperature at NTP in K\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "m = M / N  # The mass of oxygen atom in kg\n",
      "# Average speed of oxygen molecule at 273K in m/s\n",
      "V = ((8 * k * T) / (pi * m))**(1. / 2)\n",
      "c = pi * d**2 * V * n  # The collision frequency of the molecules\n",
      "l = 1. / (pi * d**2 * n)  # The mean free path in m\n",
      "\n",
      "# Output\n",
      "print '(a)The collision frequency of the molecules is  %3.2g collisions/second \\n (b)The mean free path is  %3.4g m ' % (c, l)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The collision frequency of the molecules is  5.2e+09 collisions/second \n",
        " (b)The mean free path is  8.191e-08 m \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.7  Page No : 580"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 9000.  # The density of copper in kg/m**3\n",
      "w = 63.5  # The atomic weight of copper in kg\n",
      "N = 6.023 * 10**26  # Avogadros number\n",
      "pi = 3.14  # Mathematical constant of pi\n",
      "h = 6.624 * 10**-34  # Planks constant in Js\n",
      "\n",
      "# Calculations\n",
      "V = w / d  # The volume of copper in m**3\n",
      "Ef = ((h**2 / (8. * 9. * 10**-31)) * ((3 / pi) * (N / V)) **\n",
      "      (2. / 3)) / (1.6 * 10**-19)  # The fermi energy in eV\n",
      "# The pressure at absolute zero for copper in N/m**2\n",
      "P = (2. / 3) * (N / V) * Ef\n",
      "\n",
      "# Output\n",
      "print '(a)The Fermi energy is E = %3.3f eV \\n (b)The pressure at absolute zero for copper is P = %3.6g N/m^2 ' % (Ef, P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The Fermi energy is E = 7.163 eV \n",
        " (b)The pressure at absolute zero for copper is P = 4.07656e+29 N/m^2 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.8  Page No : 586"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "p1 = 80.  # The initial pressure of a gas in cm of Hg\n",
      "p2 = 60.  # The final pressure of a gas in cm of Hg\n",
      "v2 = 1190.  # The final volume occupied by a gas in cc\n",
      "v1 = 1000.  # The initial volume occupied by a gas in cc\n",
      "\n",
      "# Calculations\n",
      "g = (math.log10(p1 / p2)) / (math.log10(v2 / v1))  # The adiabatic index\n",
      "\n",
      "# Output\n",
      "print 'The adiabatic index is  %3.3f ' % (g)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The adiabatic index is  1.654 \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.9  Page No : 589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "t = 27.  # The given temperature in degree centigrade\n",
      "R = 8.3  # Universal gas constant in J/deg mole\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The given temperature in K\n",
      "v1 = 1.  # Let the original volume be in cc\n",
      "v2 = 2. * v1  # The final volume in cc\n",
      "W = R * T * math.log(v2 / v1)  # The work done in J\n",
      "\n",
      "# Output\n",
      "print 'The work done is W = %3.1f J ' % (W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work done is W = 1725.9 J \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.10  Page No : 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 27.  # The initial temperature of the gas in degree centigrade\n",
      "T1 = t1 + 273  # The initial temperature of the gas in K\n",
      "g = 1.5  # The adiabatic index\n",
      "p = 8.  # The ratio of final pressure to the initial pressure\n",
      "\n",
      "# Calculations\n",
      "T2 = ((p)**((g - 1) / g)) * T1  # The final temperature of the gas in K\n",
      "T21 = T2 - 273  # The final temperature of the gas in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The final temperature of the gas is T2 = %3.0f K  (or)  %3.0f degree centigrade ' % (T2, T21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final temperature of the gas is T2 = 600 K  (or)  327 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.11  Page No : 600"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 0.3  # The efficiency of a carnot engine\n",
      "t = 27.  # The temperature of the sinkk in degree centigrade\n",
      "n1 = 0.5  # The increased efficiency of a carnot engine\n",
      "\n",
      "# Calculations\n",
      "T2 = t + 273  # The temperature of the sinkk in K\n",
      "T1 = T2 / (1 - n)  # The temperature of the source for 0.3 efficiency in K\n",
      "T11 = T2 / (1 - n1)  # The temperature of the source for 0.5 efficiency in K\n",
      "T = T11 - T1  # The increase in temperature in K\n",
      "\n",
      "# Output\n",
      "print 'The increase in temperature is T = %3.2f K ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in temperature is T = 171.43 K \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.12  Page No : 602"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 2100.  # One of the operating temperature in K\n",
      "T2 = 700.  # One of the another operating temperature in K\n",
      "n1 = 40.  # The actual efficiency of the engine in percent\n",
      "\n",
      "# Calculations\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of the engine in percent\n",
      "# The percentage of actual efficiency to the maximum possible efficiency\n",
      "# in percent\n",
      "n2 = (n1 / n) * 100\n",
      "\n",
      "# Output\n",
      "print 'The percentage of actual efficiency to the maximum possible efficiency is %3.0f percent ' % (n2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of actual efficiency to the maximum possible efficiency is  60 percent \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.13  Page No : 609"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 600.  # The working temperature of the engine in K\n",
      "T2 = 300.  # The another working temperature of the engine in K\n",
      "n = 52.  # Efficiency of the engine claimed by the inventor in percent\n",
      "\n",
      "# Calculations\n",
      "n1 = (1 - (T2 / T1)) * 100  # The carnot efficiency of the engine in percent\n",
      "\n",
      "# Output\n",
      "print 'The efficiency of the engine claimed by inventor is n = %3.0f percent\\nThe carnot efficiency of the engine is n = %3.0f percent \\n (The efficiency claimed is more than the carnots engine efficiency \\n No engine can have efficiency more than carnots efficiency \\n Hence the claim is invalid)' % (n, n1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the engine claimed by inventor is n =  52 percent\n",
        "The carnot efficiency of the engine is n =  50 percent \n",
        " (The efficiency claimed is more than the carnots engine efficiency \n",
        " No engine can have efficiency more than carnots efficiency \n",
        " Hence the claim is invalid)\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.14  Page No : 612"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "H1 = 10.**4  # The heat absorbed by a carnots engine in calories\n",
      "t1 = 627.  # The temperature from a reservoir in degree centigrade\n",
      "t2 = 27.  # The temperature of the sinkk in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the reservoir in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of the engine in percent\n",
      "H2 = H1 * (T2 / T1)  # The heat rejected to the sinkk in calories\n",
      "W = (H1 - H2) * 4.2  # The work done by the engine in J\n",
      "\n",
      "# Output\n",
      "print 'The efficiency of the engine is n = %3.2f percent  The work done by the engine is W = %3.2g J ' % (n, W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the engine is n = 66.67 percent  The work done by the engine is W = 2.8e+04 J \n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.15  Page No : 619"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "w = 100.  # The given power of an engine in kW\n",
      "t1 = 117.  # The operating temperature of an engine in degree centigrade\n",
      "t2 = 17.  # The another operating temperature of an engine in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The operating temperature of an engine in K\n",
      "T2 = t2 + 273  # The another operating temperature of an engine in K\n",
      "W = w * 1000  # The given power of an engine in J/s\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of an engine in percent\n",
      "H = (T1 / T2)  # The amount of heat absorbed to the amount of heat rejected\n",
      "H2 = W / (H - 1)  # The amount of heat rejected per second in J/s\n",
      "H1 = H * H2  # The amount of heat absorbed per second in J/s\n",
      "\n",
      "# Output\n",
      "print '(i)The amount of heat absorbed is %3.0g J/s \\n (ii)The amount of heat rejected is %3.0g J/s \\n (iii)The efficiency of the engine is %3.1f percent ' % (H1, H2, n)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)The amount of heat absorbed is 4e+05 J/s \n",
        " (ii)The amount of heat rejected is 3e+05 J/s \n",
        " (iii)The efficiency of the engine is 25.6 percent \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.16  Page No : 626"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m1 = 10.  # The mass of water at 60 degree centigrade in g\n",
      "m2 = 30.  # The mass of water at 20 degree centigrade in g\n",
      "t1 = 60.  # The temperature of 10 g water in degree centigrade\n",
      "t2 = 20.  # The temperature of 30 g water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of 10g water in K\n",
      "T2 = t2 + 273  # The temperature of 30g water in K\n",
      "T = ((m1 * T1) + (m2 * T2)) / (m1 + m2)  # The final temperature of water in K\n",
      "# The change in entropy of 10g water from 333 to 303 K in cal/K\n",
      "s1 = m1 * math.log(T / T1)\n",
      "# The change in entropy of 30g water from 293 to 303 K in cal/K\n",
      "s2 = m2 * math.log(T / T2)\n",
      "s = s1 + s2  # The total gain in the entropy of the system in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.4f cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 0.0627 cal/K \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.17  Page No : 629"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# input data\n",
      "m = 10.  # The given amount of water in kg\n",
      "t1 = 100.  # The temperature of water in degree centigrade\n",
      "L = 540.  # The latent heat of vapourisation of steam in cal\n",
      "\n",
      "# Calculations\n",
      "m1 = m * 1000  # The given amount of water in g\n",
      "T1 = t1 + 273  # The temperature of water in K\n",
      "S = (m1 * L) / T1  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is %3.0f cal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is 14477 cal/K \n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.18  Page No : 634"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 50.  # The given amount of water in g\n",
      "t1 = 10.  # The initial temperature of water in degree centigrade\n",
      "t2 = 90.  # The final temperature of water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of water in K\n",
      "T2 = t2 + 273  # The final temperature of water in K\n",
      "S = m * math.log(T2 / T1)  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is %3.3f cal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is 12.448 cal/K \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.19  Page No : 640"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 10.  # The given amount of ice in g\n",
      "T1 = 273.  # The initial temperature of ice in K\n",
      "T2 = 373.  # The final temperature of steam in K\n",
      "L1 = 80.  # The latent heat of ice in cal/g\n",
      "L2 = 540.  # The latent heat of vapourisation of steam in cal\n",
      "\n",
      "# Calculations\n",
      "s1 = (m * L1) / T1  # Increase in entropy from ice at 273K to water at 273K in cal/K\n",
      "# Increase in entropy from water at 273K to water at 373K in cal/K\n",
      "s2 = (m) * math.log(T2 / T1)\n",
      "# Increase in entropy from water at 373K to steam at 373K in cal/K\n",
      "s3 = (m * L2) / T2\n",
      "s = s1 + s2 + s3  # The total increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is %3.2f cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is 20.53 cal/K \n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.20  Page No : 645"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 1.  # The given amount of nitrogen in g\n",
      "t1 = 50.  # The initial temperature of nitrogen in degree centigrade\n",
      "t2 = 100.  # The final temperature of nitrogen in degree centigrade\n",
      "Cv = 0.18  # Molar specific heat of nitrogen\n",
      "w = 28.  # Molecular weight of nitrogen\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of nitrogen in K\n",
      "T2 = t2 + 273  # The final temperature of nitrogen in K\n",
      "S = (Cv / w)  # The Specific heat of nitrogen\n",
      "s = m * S * math.log(T2 / T1)  # The change in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.4g cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 0.0009252 cal/K \n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.21  Page No : 650"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "p = 135.2  # The given increase in the pressure in atmospheres\n",
      "V = -0.091  # The given increase in the specific volume when 1g of water freezes into ice in cm**3\n",
      "L = 80.  # Latent heat of fusion of ice in cal/gram\n",
      "T = 273.  # The temperature of ice in K\n",
      "\n",
      "# Calculations\n",
      "L1 = L * 4.18 * 10**7  # The latent heat of fusion of ice in ergs/g\n",
      "P = p * 1.013 * 10**6  # The given increase in the pressure in dynes/cm**2\n",
      "# The temperature at which ice will freeze in degree centigrade\n",
      "t = (P * T * V) / L1\n",
      "t1 = t + 273  # The temperature at which ice will freeze in K\n",
      "\n",
      "# Calculations\n",
      "print 'The temperature at which ice will freeze is %3.0f degree centigrade (or) %3.0f K ' % (t, t1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature at which ice will freeze is  -1 degree centigrade (or) 272 K \n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.22  Page No : 655"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 1.  # The given amount of water in kg\n",
      "s = 1000.  # The specific heat of water in cal/kg-K\n",
      "T1 = 273.  # The initial temperature of water in K\n",
      "T2 = 373.  # The temperature of the heat reservoir in K\n",
      "\n",
      "# Calculations\n",
      "S = m * s * math.log(T2 / T1)  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in the entropy of water is %3.0f cal/K' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in the entropy of water is 312 cal/K\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.23  Page No : 661"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# input data\n",
      "m = 0.0273  # The given amount of ice in kg\n",
      "L = 80.  # The latent heat of fusion of ice in cal/gram\n",
      "T = 273.  # The temperature of ice in K\n",
      "\n",
      "# Calculations\n",
      "L1 = L * 1000  # The latent heat of fusion of ice in cal/kg\n",
      "S = (m * L1 * 4.2) / T  # The change in entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.1f J/K' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 33.6 J/K\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.24  Page No : 667"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t1 = 27.  # The given initial temperature in degree centigrade\n",
      "p = 50.  # The reduce in the pressure in atmospheres\n",
      "a = 13.2 * 10**-2  # Van der Waals constant in Nm**4mole**-2\n",
      "b = 31.2 * 10**-6  # Van der Waals constant in mole**-1m**3\n",
      "R = 8.3  # Universal gas constant in JK**-1(mole)**-1\n",
      "Cp = 3.5  # The specific heat at constant pressure\n",
      "M = 32.  # Molecular weight of oxygen\n",
      "\n",
      "# Calculations\n",
      "T = t1 + 273  # The given initial temperature in K\n",
      "P = p * 0.76 * 13.6 * 1000 * 9.8  # The reduce in the pressure in N/m**2\n",
      "# The drop in the temperature in K\n",
      "T1 = ((P) / (4.2 * M * Cp * R)) * (((2 * a) / (R * T)) - b)\n",
      "\n",
      "# Output\n",
      "print 'The drop in the temperature is %3.4f K ' % (T1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drop in the temperature is 0.0971 K \n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.25  Page No : 674"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T = 300.  # The temperature of the metallic copper disc in K\n",
      "Cp = 24.5  # The specific heat at constant pressure in J/mol K\n",
      "a = 50.4 * 10**-6  # The coefficient of thermal expansion in K**-1\n",
      "K = 7.78 * 10**-12  # Isothermal compressibility in N/m**2\n",
      "V = 7.06 * 10**-6  # The specific volume in m**3/mol\n",
      "\n",
      "# Calculations\n",
      "C = (T * V * a**2) / K  # The change in specific heats in J/mol K\n",
      "Cv = Cp - C  # The specific heat at constant volume in J/mol K\n",
      "\n",
      "# Output\n",
      "print 'The specific heat at constant volume is Cv = %3.4f J/mol-K ' % (Cv)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The specific heat at constant volume is Cv = 23.8085 J/mol-K \n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.26  Page No : 676"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "p = 50.  # The reduced pressure in atmospheres\n",
      "t = 27.  # The initial temperature of the gas in degree centigrade\n",
      "a = 1.32 * 10**12  # Van der Waal constant a in cm**4 dynes/mole**2\n",
      "b = 31.2  # Van der Waal constant b in cm**3/mole\n",
      "Cp = 7.  # The specific heat at constant pressure in cal/mole-K\n",
      "\n",
      "# Calculations\n",
      "P = p * 76 * 13.6 * 980  # The reduced pressure in dynes/cm**2\n",
      "Cp1 = Cp * 4.2 * 10**7  # The specific heat at constant pressure in ergs/mole-K\n",
      "T = t + 273  # The initial temperature of the gas in K\n",
      "R = 8.31 * 10**7  # The real gas constant in ergs/mole-K\n",
      "# The drop in temperature in K or degree centigrade\n",
      "dT = (P / Cp1) * (((2 * a) / (R * T)) - b)\n",
      "\n",
      "# Output\n",
      "print 'The drop in temperature produced by adiabatic throttling process is %3.3f K  (or) %3.3f degree centigrade ' % (dT, dT)\n",
      "\n",
      "# Error . There is a change in the result compared to the textbook because\n",
      "# the final calculations did in the textbook went wrong , so the final\n",
      "# result varied from the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drop in temperature produced by adiabatic throttling process is 12.868 K  (or) 12.868 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.27  Page No : 678"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t = 0.  # The initial temperature of mercury in degree centigrade\n",
      "p = 1.  # The initial pressure of mercury in atmospheres\n",
      "Cp = 28.  # The specific heat at constant pressure in J/mol K\n",
      "V = 1.47 * 10**-5  # The given specific volume in m**3/mol\n",
      "b = 1.81 * 10**-6  # The given volume expansivity in K**-1\n",
      "k = 3.89 * 10**-11  # The given compressibility in pa**-1\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The initial temperature of mercury in K\n",
      "# The specific heat at constant volume in J/mol K\n",
      "Cv = Cp - ((T * V * b**2) / k)\n",
      "g = Cp / Cv  # The adiabatic index\n",
      "\n",
      "# Output\n",
      "print 'The adiabatic index is %3.0f ' % (g)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The adiabatic index is   1 \n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.28  Page No : 681"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "K = 24. * 10**-3  # The coefficient of thermal conductivity of an oxygen molecule in J/m.s.K\n",
      "Cv = 20.9 * 10**3  # The specific heat at constant volume in J/kilo.mole.K\n",
      "k = 1.38 * 10**-23  # The boltzmanns constant in J/K\n",
      "m = 5.31 * 10**-26  # The mass of an oxygen molecule in kg\n",
      "T = 273.  # The temperature of the molecule in K\n",
      "pi = 3.142  # Mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "C = ((3 * k * T) / m)**(1. / 2)  # The velocity of the molecule in m\n",
      "r = (((3 * k * T * m)**(1. / 2) * Cv) / (3. * 2.**(1. / 2) * pi * K)\n",
      "     )**(1. / 2)  # The radius of an oxygen molecule in m\n",
      "\n",
      "# Output\n",
      "print 'The radius of an oxygen molecule is  %3.4g m ' % (r)\n",
      "\n",
      "# Error . There is a change in the result compared to the textbook because\n",
      "# the final calculations did in the textbook went wrong , so the final\n",
      "# result varied from the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The radius of an oxygen molecule is  1.265e-09 m \n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.29  Page No : 687"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "b = 0.3  # The given wiens constant in cm-K\n",
      "l = 5500.  # The given wavelength in A units\n",
      "\n",
      "# Calculations\n",
      "L = l * 10**-8  # The given wavelength in cm\n",
      "T = b / L  # The temperature of the sun in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature of the sun is  %3.0f K ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature of the sun is  5455 K \n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.30  Page No : 692"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "R = 1. * 10**4  # The rate at which black body loses thermal energy in watts/m**2\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "\n",
      "# Calculations\n",
      "T = (R / s)**(1. / 4)  # The temperature of the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature of the black body is  %3.0f K' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature of the black body is  648 K\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.31  Page No : 697"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T = 6174.  # The temperature of the black body in K\n",
      "l = 4700.  # The wavelength of the black body emitting in amstrong units\n",
      "l1 = 1.4 * 10**-5  # The wavelength to be emitted by the black body in m\n",
      "\n",
      "# Calculations\n",
      "L = l * 10**-10  # The wavelength of the black body emitted at 6174 K in m\n",
      "L1 = l1  # The wavelength to be emitted by the black body in m\n",
      "T1 = (L * T) / L1  # The temperature to be maintained by the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature to be maintained by the black body is %3.2f K ' % (T1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature to be maintained by the black body is 207.27 K \n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.32  Page No : 701"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "T = 5800.  # The temperature of the sun in K\n",
      "\n",
      "# Calculations\n",
      "r = 7. * 10**8  # The radius of the sun in m\n",
      "pi = 3.142  # The mathematical constant of pi\n",
      "A = 4. * pi * r**2  # The surface area of the sun in m**2\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "U = A * s * T**4  # The total energy emitted by sun per second in J\n",
      "r1 = 1.5 * 10**11  # The distance of the earths atmosphere from the sun in m\n",
      "# Energy reaching the top of earths atmosphere in kW/m**2\n",
      "R = (U / (4 * pi * r1**2)) / 1000\n",
      "\n",
      "# Output\n",
      "print 'The total radiant energy emitted by sun per second is  %3.4g J  \\\n",
      "\\nThe rate at which energy is reaching earths atmosphere is  %3.1f kW/m^2 ' % (U, R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total radiant energy emitted by sun per second is  3.953e+26 J  \n",
        "The rate at which energy is reaching earths atmosphere is  1.4 kW/m^2 \n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.33  Page No : 706"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 5.  # The molecules of ozone in grams\n",
      "t = 27.  # The temperature of ozone in degree centigrade\n",
      "R = 8.3  # The universal gas constant in J/g-mol/K\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The temperature of ozone in K\n",
      "U = n * ((3. / 2) * R * T)  # The energy of ozone in J\n",
      "\n",
      "# Output\n",
      "print 'The energy of 5 gms molecules of ozone at 27 degree centigrade is  %3.6g J ' % (U)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy of 5 gms molecules of ozone at 27 degree centigrade is  18675 J \n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.34  Page No : 708"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = -1  # The pressure required to lower the melting point of ice in K\n",
      "l = 79.6  # The latent heat of ice in cal/g\n",
      "V1 = 1.  # The specific volumes of water at 0 degree centigrade in cm**2\n",
      "V2 = 1.091  # The specific volumes of ice at 0 degree centigrade in cm**2\n",
      "p = 1.013 * 10**6  # One atmospheric pressure in dyne/cm**2\n",
      "\n",
      "# Calculations\n",
      "T = 273.  # The temperature of water in K\n",
      "L = l * 4.18 * 10**7  # The latent heat of ice in ergs/g\n",
      "p1 = (L * t) / (T * (V1 - V2))  # The obtained pressure in dynes/cm**2\n",
      "P = p1 / p  # The obtained pressure in atmospheres\n",
      "P1 = P + 1  # The required pressure in atmospheres\n",
      "\n",
      "# Output\n",
      "print 'The pressure required is  %3.2f atmospheres ' % (P1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The pressure required is  133.21 atmospheres \n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.35  Page No : 710"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 127.  # The temperature of the black body in degree centigrade\n",
      "t2 = 27.  # The temperature of the walls maintained in degree centigrade\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the black body in K\n",
      "T2 = t2 + 273  # The temperature of the walls maintained in K\n",
      "R = s * (T1**4 - T2**4)  # The net amount of energy lost by body in W/m**2\n",
      "\n",
      "# Output\n",
      "print 'The net amount of energy lost by body per sec per unit area is  %3.1f watts/m^2' % (R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net amount of energy lost by body per sec per unit area is  992.6 watts/m^2\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.36  Page No : 713"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t2 = 7.  # The low temperature of reservoir in degree centigrade\n",
      "n1 = 50.  # The efficiency of the carnots engine in percentage\n",
      "n2 = 70.  # The increased efficiency of the carnots engine in percentage\n",
      "\n",
      "# Calculations\n",
      "T2 = t2 + 273  # The low temperature of the reservoir in K\n",
      "T1 = T2 / (1 - (n1 / 100))  # The temperature of the source reservoir in K\n",
      "# The temperature to be maintained by the source reservoir in K\n",
      "T11 = T2 / (1 - (n2 / 100))\n",
      "T = T11 - T1  # The increase in temperature of the source in K or degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The increase in temperature of the source is  %3.1f K (or) %3.1f degree centigrade ' % (T, T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in temperature of the source is  373.3 K (or) 373.3 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.37  Page No : 717"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 6174.  # The temperature of the black body in K\n",
      "l1 = 4700.  # The wavelength emitted by the black body in amstrong units\n",
      "l2 = 1400.  # The wavelength to be emitted by the black body in amstrong units\n",
      "\n",
      "# Calculations\n",
      "T2 = (l1 * T1) / l2  # The temperature to be maintained by the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature to be maintained by the black body is  %3.0f K ' % (T2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature to be maintained by the black body is  20727 K \n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.38  Page No : 723"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "e = 8.5 * 10**28  # The given energy density of electrons in copper in electrons/m**3\n",
      "k = 1.38 * 10**-23  # The boltzmann constant in J/K\n",
      "h = 6.62 * 10**-34  # Planks constant in J.s\n",
      "m = 9.1 * 10**-31  # The given mass of electrons in kg\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "E = (((3 * e) / pi)**(2. / 3)) * (h**2) * (1. / 8) * \\\n",
      "    (1 / m)  # The fermi energy for copper in J\n",
      "EF = E / (1.6 * 10**-19)  # The fermi energy for copper in eV\n",
      "\n",
      "# Output\n",
      "print 'The fermi energy for copper at absolute zero is  %3.3f eV ' % (EF)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fermi energy for copper at absolute zero is  7.056 eV \n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.39  Page No : 725"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 100.  # The temperature of the source in degree centigrade\n",
      "t2 = 0.  # The temperature of the sinkk in degree centigrade\n",
      "P = 100.  # The power of the engine in watts (or) J/s\n",
      "l = 80.  # The latent heat of ice in cal/g\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the source in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "L = l * 4.2 * 10**3  # The latent heat of ice in ergs/kg\n",
      "W = P * 60  # The amount of work done in one minute in J\n",
      "H2 = (W * T2) / (T1 - T2)  # The amount of heat at the sinkk in J\n",
      "m = (H2 / L)  # The amount of ice melts in kg\n",
      "\n",
      "# Output\n",
      "print 'The amount of ice that will melt in one minute is  %3.5f kg ' % (m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of ice that will melt in one minute is  0.04875 kg \n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.40  Page No : 730"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "C1 = 1.84  # The RMS speed of molecules of hydrogen at NTP in km/s\n",
      "p1 = 2.  # The molecular weight of hydrogen\n",
      "p2 = 32.  # The molecular weight of oxygen\n",
      "\n",
      "# Calculations\n",
      "C2 = C1 * (p1 / p2)**(1. / 2)  # The RMS speed of oxygen at NTP in km/s\n",
      "C21 = C2 * 1000  # The RMS speed of oxygen at NTP in m/s\n",
      "\n",
      "# Output\n",
      "print 'The RMS speed of oxygen at NTP is  %3.2f km/s (or) %3.0f m/s ' % (C2, C21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The RMS speed of oxygen at NTP is  0.46 km/s (or) 460 m/s \n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.41  Page No : 737"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = 101.  # The temperature at which water boils in degree centigrade\n",
      "p = 787.  # The pressure maintained at water boils in mm of Hg\n",
      "t1 = 100.  # Normal boiling point of water in degree centigrade\n",
      "T = t1 + 273  # Normal boiling point of water in K\n",
      "p1 = 760.  # The normal maintained pressure in mm of Hg\n",
      "V2 = 1601.  # The specific volume of water evaporation in cm**3\n",
      "V1 = 1.  # The specific volume of water in cm**3\n",
      "\n",
      "# Calculations\n",
      "V = V2 - V1  # The change in specific volume in cm**3\n",
      "dT = t - t1  # The change in temperature in degree centigrade or K\n",
      "dP = (p - p1) / 10  # The change in pressure in cm of Hg\n",
      "L = (T * dP * 13.6 * 980 * V) / dT  # Latent heat of steam in ergs/g\n",
      "L1 = L / (4.2 * 10**7)  # The latent heat of steam in cal/g\n",
      "\n",
      "# Output\n",
      "print 'The latent heat of steam is  %3.4g ergs/g  (or) %3.2f cal/g ' % (L, L1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The latent heat of steam is  2.148e+10 ergs/g  (or) 511.34 cal/g \n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.42  Page No : 742"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 7.7 * 10**3  # The density of aluminium in kg/m**3\n",
      "w = 27.  # The atomic weight of Al in kg/k.mol\n",
      "N = 6.023 * 10**26  # The number of free electrons in Al\n",
      "k = 1.38 * 10**-23  # The boltzmann constant in J/K\n",
      "h = 6.62 * 10**-34  # Planks constant in J.s\n",
      "m = 9.1 * 10**-31  # The given mass of electrons in kg\n",
      "pi = 3.14  # The testematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "V = w / d  # The volume occupied by Al in m**3/k.mol\n",
      "E = (((3 * (N / V)) / pi)**(2. / 3)) * (h**2) * (1. / 8) * \\\n",
      "    (1 / m)  # The fermi energy for aluminium in J\n",
      "EF = E / (1.6 * 10**-19)  # The fermi energy for aluminium in eV\n",
      "# The pressure of electrons in aluminium at absolute zero in N/m**2\n",
      "p = (2. / 3) * (N / V) * (E)\n",
      "\n",
      "# Output\n",
      "print 'The fermi energy for aluminium at absolute zero is  %3.3f eV  \\\n",
      "\\nThe pressure of electrons in aluminium at absolute zero is  %3.4g N/m^2' % (EF, p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fermi energy for aluminium at absolute zero is  11.278 eV  \n",
        "The pressure of electrons in aluminium at absolute zero is  2.066e+11 N/m^2\n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.43  Page No : 747"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t2 = 20.  # The temperature of room in degree centigrade\n",
      "t1 = 37.  # The skin temperature of the boy in degree centigrade\n",
      "t = 10.  # The given time in min\n",
      "A = 3.  # The surface area of the student in m**2\n",
      "e = 0.9  # The emissivity of the student\n",
      "\n",
      "# Calculations\n",
      "T2 = t2 + 273  # The temperature of the room in K\n",
      "T1 = t1 + 273  # The skin temperature of the boy in K\n",
      "t1 = t * 60  # The given time in sec\n",
      "s = 5.67 * 10**-8  # Stefans constant in W/m**2-K**4\n",
      "R = e * A * s * (T1**4 - T2**4)  # Heat loss by the skin in one second in J/s\n",
      "Q = R * t1  # Total heat loss by the skin in 10 minutes in J\n",
      "\n",
      "# Output\n",
      "print 'The total heat loss by the skin in 10 minutes is  %3.4g J ' % (Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total heat loss by the skin in 10 minutes is  1.713e+05 J \n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.44  Page No : 751"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 20.  # The temperature of the air in the cylinder of a combustion engine in degree centigrade\n",
      "p1 = 1.  # The initial pressure of the air in atmospheres\n",
      "V1 = 8. * 10**-4  # The initial volume of the air in m**3\n",
      "V2 = 6. * 10**-5  # The final volume of the air in m**3\n",
      "g = 1.4  # The adiabatic index\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the air in K\n",
      "p2 = p1 * (V1 / V2)**(g)  # The final pressure of the gas in atmospheres\n",
      "T2 = (p2 / p1) * (V2 / V1) * T1  # The final temperature of the gas in K\n",
      "T21 = T2 - 273  # The final temperature of the gas in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The final pressure of the gas is  %3.1f atmospheres  \\\n",
      "\\nThe final temperature of the gas is  %3.1f K  (or) %3.1f degree centigrade ' % (p2, T2, T21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final pressure of the gas is  37.6 atmospheres  \n",
        "The final temperature of the gas is  825.7 K  (or) 552.7 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.47  Page No : 757"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 2. * 10**-10  # The molecular diameter of an ideal gas in m\n",
      "t = 20.  # The temperature of the gas in degree centigrade\n",
      "p = 1.  # The pressure of the gas in atmosphere\n",
      "pi = 3.142  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The temperature of the gas in K\n",
      "P = 1.01 * 10**5  # The pressure of the gas in N/m**2\n",
      "v = 511.  # The velocity of the molecules at 20 degree centigrade in m/s\n",
      "k = 1.38 * 10**-23  # Boltzman constant in J/K\n",
      "n = P / (k * T)  # The number of molecules per m**3\n",
      "l = 1. / (1.414 * pi * d**2 * n)  # The mean free path in m\n",
      "f = v / l  # The collision frequency in per second\n",
      "\n",
      "# Output\n",
      "print '(a)The mean free path is  %3.4g m  \\n (b)The collision frequency is  %3.4g per second ' % (l, f)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The mean free path is  2.253e-07 m  \n",
        " (b)The collision frequency is  2.268e+09 per second \n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.48  Page No : 760"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "l = 1.876 * 10**-7  # The mean free path of the gas in m\n",
      "v = 511.  # The average speed of the molecule in m/s\n",
      "\n",
      "# Calculations\n",
      "f = v / l  # The collision frequency in per second\n",
      "\n",
      "# Output\n",
      "print 'The collision frequency is  %3.4g per second ' % (f)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The collision frequency is  2.724e+09 per second \n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.49  Page No : 764"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "s = 1.  # The specific heat of water in k cal kg C\n",
      "m = 1.  # The mass of ice in kg\n",
      "H = 80.  # The latent heat of ice in kcal/kg\n",
      "H1 = 540.  # The latent heat of steam in kcal/kg\n",
      "T = 273.  # The temperature of the ice in K\n",
      "T1 = 373.  # The temperature of water at 100 degree centigrade in K\n",
      "\n",
      "# Calculations\n",
      "S1 = H / T  # The increase in entropy when 1 kg of ice at 273 K is converted into water at 273 K in kcal/K\n",
      "# The increase in entropy when 1 kg of water at 273 K is converted into\n",
      "# water at 373 K in kcal/K\n",
      "S2 = m * s * math.log(T1 / T)\n",
      "S3 = H1 / T1  # The increase in entropy when 1 kg of water at 373 K is converted into steam at 373 K in kcal/K\n",
      "S = S1 + S2 + S3  # The total increase in entropy in kcal/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is  %3.3f kcal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is  2.053 kcal/K \n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.50  Page No : 767"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 27.  # The initial temperature of the gas in degree centigrade\n",
      "g = 1.4  # The adiabatic index\n",
      "p1 = 1.  # Let the initial pressure in atmospheres\n",
      "p2 = 2. * p1  # The final pressure in atmospheres\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of the gas in K\n",
      "# The final temperature of the gas in K\n",
      "T2 = (((p2 / p1)**(g - 1)) * (T1)**g)**(1 / g)\n",
      "T = T2 - T1  # The rise in temperature of a gas in K or degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The rise in temperature is  %3.1f degree centigrade ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rise in temperature is  65.7 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.51  Page No : 770"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "V1 = 10.**-3  # One litre of monoatomic perfect gas at NTP in m**3\n",
      "V2 = (V1 / 2)  # The final volume in m**3\n",
      "g = 1.67  # The adiabatic index\n",
      "\n",
      "# Calculations\n",
      "# The work done on the gas in J\n",
      "W = (1 / (g - 1)) * ((1 / (V2)**(g - 1)) - (1 / (V1)**(g - 1)))\n",
      "\n",
      "# Output\n",
      "print 'The work done on the gas is  %3.1f J ' % (W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work done on the gas is  90.3 J \n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.52  Page No : 775"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T1 = 1200.  # The temperature at which first engine receives heat in K\n",
      "T2 = 300.  # The temperature at which second engine rejects to heat reservoir in K\n",
      "\n",
      "# Calculations\n",
      "# The temperature when the work outputs of two engines are equal in K\n",
      "Tw = (T1 + T2) / 2\n",
      "# The temperature when the efficiency of two engines are equal in K\n",
      "Te = (T1 * T2)**(1. / 2)\n",
      "\n",
      "# Output\n",
      "print '(a)The temperature when the work outputs of two engines are equal is  %3.0f K \\n (b)The temperature when the efficiency of two engines are equal is  %3.0f K ' % (Tw, Te)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The temperature when the work outputs of two engines are equal is  750 K \n",
        " (b)The temperature when the efficiency of two engines are equal is  600 K \n"
       ]
      }
     ],
     "prompt_number": 57
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.53  Page No : 777"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t1 = 27.  # The temperature of the source in degree centigrade\n",
      "t2 = -73  # The temperature of the sinkk in degree centigrade\n",
      "H2 = 300.  # The amount of heat released by the sinkk in cal\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the source in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "H1 = H2 * (T1 / T2)  # The amount of heat released by the source in cal\n",
      "W = H1 - H2  # The work performed per cycle in cal\n",
      "W1 = W * 4.2  # The work performed per cycle in J\n",
      "\n",
      "# Output\n",
      "print 'The work performed by the engine per cycle is  %3.0f J ' % (W1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work performed by the engine per cycle is  630 J \n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.54  Page No : 782"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "m = 3.  # The rate at which ice melts in kg/hour\n",
      "t = 28.  # The external temperature in degree centigrade\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "s = 4.2 * 10**3  # The specific heat in Jkg**-1.C\n",
      "\n",
      "# Calculations\n",
      "Q = (m * Li) + (m * s * t)  # The heat taken by the ice to melt into water in J\n",
      "P = Q / 3600  # To prevent melting of ice ,the refrigerator should have the power out in J/s\n",
      "\n",
      "# Output\n",
      "print 'The minimum power output of the motor is  %3.0f watts ' % (P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum power output of the motor is  373 watts \n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.55  Page No : 788"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "V1 = 1.090 * 10**-3  # The specific volume of one kg of ice in m**3\n",
      "V2 = 10.**-3  # The specific volume of one kg of water in m**3\n",
      "T = 273.  # The temperature maintained in K\n",
      "dP = 1.01 * 10**5  # The increase in pressure in N/m**2\n",
      "\n",
      "# Calculations\n",
      "# The depression in the melting point of ice in K (or) degree centigrade\n",
      "dT = -(dP * T * (V2 - V1)) / Li\n",
      "\n",
      "# Output\n",
      "print 'The depression of melting point of ice is  %3.2g K  (or) %3.2g degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The depression of melting point of ice is  0.0075 K  (or) 0.0075 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.56  Page No : 791"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "dp = 100.  # The change in mercury pressure in cm of Hg\n",
      "v2 = 1601.  # Specific volume of steam in cm**3/gram\n",
      "v1 = 1.  # Specific volume of water in cm**3/gram\n",
      "l = 536.  # Latent heat in cal/gram\n",
      "t = 100.  # The temperature of the steam in degree centigrade\n",
      "\n",
      "# calculations\n",
      "dP = 1. * 13.6 * 10**3 * 9.8  # The change in mercury pressure in N/m**2\n",
      "V2 = v2 * 10**-3  # Specific volume of steam in m**3/kg\n",
      "V1 = v1 * 10**-3  # Specific volume of water in m**3/kg\n",
      "L = l * 4.2 * 10**3  # Latent heat in J/kg\n",
      "T = t + 273  # The temperature of the steam in K\n",
      "# The increase in boiling point of water in K or degree centigrade\n",
      "dT = (dP * T * (V2 - V1)) / L\n",
      "\n",
      "# Output\n",
      "print 'The increase in boiling point of water is  %3.2f K  (or) %3.2f degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in boiling point of water is  35.33 K  (or) 35.33 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.57  Page No : 796"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "L = 80.  # The latent heat of fusion of ice in cal/gm\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "dp = 1.  # The increase in pressure in atmospheres\n",
      "t = 0.  # The given temperature in degree centigrade\n",
      "v = -0.1  # The change in specific volume in cm**3/gm\n",
      "\n",
      "# Calculations\n",
      "dP = 0.76 * 13.6 * 10**3 * 9.8  # The increase in pressure in N/m**2\n",
      "V = v * 10**-3  # The change in specific volume in m**3/kg\n",
      "T = t + 273  # The given temperature in K\n",
      "# The decrease in the melting point of ice with increase in the pressure\n",
      "# of one atmosphere in K\n",
      "dT = -(dP * T * (V)) / Li\n",
      "\n",
      "# Output\n",
      "print 'The decrease in melting point of ice is  %3.4f K  (or) %3.4f degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The decrease in melting point of ice is  0.0084 K  (or) 0.0084 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.58  Page No : 803"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "R = 8.4  # The universal gas constant in J.mol**-1.K**-1\n",
      "Cv = 21.  # The spacific heat at constant volume in J.mol**-1.K**-1\n",
      "P1 = 2. * 10**5  # The initial pressure of gas in N/m**2\n",
      "V1 = 20.  # The initial volume of the gas occupied in litres\n",
      "P2 = 5. * 10**5  # The final pressure of the gas in N/m**2\n",
      "V2 = 50.  # The final volume of the gas occupied in litres\n",
      "\n",
      "# Calculations\n",
      "# The ratio of final temperature to the initial temperature for perfect gas\n",
      "T = (P2 * V2) / (P1 * V1)\n",
      "V = V2 / V1  # The ratio of final volume to the initial volume for perfect gas\n",
      "S = (Cv * math.log(T)) + (R * math.log(V))  # The change of entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is  46.18 J/K \n"
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.59  Page No : 807"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "s = 4.2 * 10**3  # The specific heat of water is J/kg.C\n",
      "m1 = 0.1  # The mass of water at 15 degree centigrade in kg\n",
      "m2 = 0.16  # The mass of water at 40 degree centigrade in kg\n",
      "t1 = 15.  # The temperature of the first water in degree centigrade\n",
      "t2 = 40.  # The temperature of the second water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the first water in K\n",
      "T2 = t2 + 273  # The temperature of the second water in K\n",
      "T = ((m1 * T1) + (m2 * T2)) / (m1 + m2)  # The final mixed temperature in K\n",
      "# The change in entropy for 0.1 kg of water in J/K\n",
      "s1 = m1 * s * 2.3026 * math.log10(T / T1)\n",
      "# The change in entropy for 0.16 kg of water in J/K\n",
      "s2 = m2 * s * 2.3026 * math.log10(T / T2)\n",
      "S = s1 + s2  # The net change in the entropy of the system in J/K\n",
      "\n",
      "# Output\n",
      "print 'The net increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net increase in entropy is  0.89 J/K \n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.60  Page No : 811"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 12.5 * 10**-3  # The amount of ice in kg\n",
      "li = 80.  # Latent heat of ice in cal/gram\n",
      "l = 536.  # Latent heat of steam in cal/gram\n",
      "si = 0.5  # Specific heat of ice in cal/gram-K\n",
      "sw = 1.  # Specific heat of water in cal/gram-K\n",
      "T1 = -24 + 273  # The initial temperature of ice in K\n",
      "T2 = 0. + 273  # The final temperature of ice in K\n",
      "T3 = 100. + 273  # The final temperature of water in K\n",
      "\n",
      "# Calculations\n",
      "Li = li * 10**3 * 4.2  # The latent heat of ice in J/kg\n",
      "Ls = l * 10**3 * 4.2  # The latent heat of water in J/kg\n",
      "Si = si * 10**3 * 4.2  # The specific heat of ice in J/kg-K\n",
      "Sw = sw * 10**3 * 4.2  # The specific heat of water in J/kg-K\n",
      "# The increase in entropy of ice from 249 K to 273 K in J/K\n",
      "s1 = m * Si * math.log(T2 / T1)\n",
      "s2 = (m * Li) / T2  # The increase in entropy from 273 K ice to 273 K water in J/K\n",
      "# The increase in entropy of water from 273 K to 373 K in J/K\n",
      "s3 = m * Sw * math.log(T3 / T2)\n",
      "# The increase in entropy from water at 373 K to steam at 373 K in J/K\n",
      "s4 = (m * Ls) / T3\n",
      "S = s1 + s2 + s3 + s4  # The total increase in entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is  109.63 J/K \n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.61  Page No : 813"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "x1 = 20.  # The initial thickness of the layer in cm\n",
      "x2 = 30.  # The final thickness of the layer in cm\n",
      "t1 = -15  # The temperature of the surroundings in degree centigrade\n",
      "L = 80.  # The latent heat of ice in cal/gram\n",
      "d = 0.9  # The given density of ice in g/cm**3\n",
      "K = 0.005  # The coefficient of thermal conductivity in C.G.S units\n",
      "\n",
      "# Calculations\n",
      "t = ((d * L) / (2 * K * t1)) * (x1**2 - x2**2)  # The time taken in sec\n",
      "\n",
      "# Output\n",
      "print 'The time taken for a layer of ice to increase the thickness is  %3.2g sec ' % (t)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time taken for a layer of ice to increase the thickness is  2.4e+05 sec \n"
       ]
      }
     ],
     "prompt_number": 64
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.62  Page No : 815"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 121.  # The temperature of solid copper sphere in degree centigrade\n",
      "dt1 = 2.6  # The rate of cooling of copper sphere in degree centigrade per minute\n",
      "t2 = 195.  # The temperature of another solid sphere in degree centigrade\n",
      "t = 30.  # The surrounding temperature in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of solid copper sphere in K\n",
      "T2 = t2 + 273  # The temperature of another solid copper sphere in K\n",
      "T0 = t + 273  # The surrounding temperature in K\n",
      "R1 = 1.  # Let the radius of the first sphere in m\n",
      "R2 = 2. * R1  # The radius of the second sphere in m\n",
      "# The rate at which solid copper sphere cools in degree centigrade per minute\n",
      "dt2 = (dt1) * (R1 / R2) * ((T2**4 - T0**4) / (T1**4 - T0**4))\n",
      "\n",
      "# Output\n",
      "print 'The rate at which solid copper sphere cools is  %3.3f degree centigrade per minute ' % (dt2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate at which solid copper sphere cools is  3.281 degree centigrade per minute \n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.63  Page No : 820"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "dt = 250.  # The temperature gradient of an insulated copper rod in degree centigrade per metre\n",
      "x = 0.05  # The distance between the two points in m\n",
      "K = 384.  # The thermal conductivity of copper in W.m**-1.K**-1\n",
      "A = 1.  # The surface area of the copper rod in m**2\n",
      "t = 1.  # The given time in seconds\n",
      "\n",
      "# Calculations\n",
      "T = dt * x  # The temperature difference in degree centigrade\n",
      "# The amount of heat crossed per unit area per sec in J/s\n",
      "Q = K * A * (dt) * t\n",
      "\n",
      "# Output\n",
      "print '(1)The difference in temperature between two points seperated by 0.05m is  %3.1f degree centigrade \\n (2)The amount of heat crossing per second per unit area normal to the rod is  %3.2g J/s ' % (T, Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1)The difference in temperature between two points seperated by 0.05m is  12.5 degree centigrade \n",
        " (2)The amount of heat crossing per second per unit area normal to the rod is  9.6e+04 J/s \n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.64  Page No : 826"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "T1 = 200.  # The first temperature of the black body in K\n",
      "T2 = 2000.  # The second temperature of the black body in K\n",
      "s = 5.672 * 10**-8  # Stefans constant in M.K.S units\n",
      "\n",
      "# Calculations\n",
      "# The comparision of radiant emittance of a black body for given\n",
      "# temperatures\n",
      "R = (s * T1**4) / (s * T2**4)\n",
      "\n",
      "# Output\n",
      "print 'The comparision of radiant emittance of a black body at 200 K and 2000 K is  %3.0g ' % (R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The comparision of radiant emittance of a black body at 200 K and 2000 K is  0.0001 \n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.65  Page No : 828"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "d = 0.08  # The diameter of the black sphere in m\n",
      "T = 500.  # The temperature of the black sphere in K\n",
      "T0 = 300.  # The temperature of the surroundings in K\n",
      "s = 6. * 10**-8  # The stefans constant in W m**-2 K**-4\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "A = pi * d**2  # The area of the black sphere in m**2\n",
      "e = 1.  # The emittance of the black body\n",
      "# The rate at which energy is radiated in J/s or watts\n",
      "R = s * A * e * (T**4 - T0**4)\n",
      "\n",
      "# Output\n",
      "print 'The rate at which energy is radiated R =  %3.2f J/s  (or) %3.2f watts' % (R, R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate at which energy is radiated R =  65.59 J/s  (or) 65.59 watts\n"
       ]
      }
     ],
     "prompt_number": 68
    }
   ],
   "metadata": {}
  }
 ]
}