{
 "metadata": {
  "name": "",
  "signature": "sha256:e82f907589ee9f285b03423d7d7f94fa76a99d99633034868b1766421e211787"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 13 Thermodynamics Entropy and Free Energy"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.1 , Page no:289"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "H= 540 #cal per gram\n",
      "m= 9 #gms\n",
      "T= 100 #C\n",
      "\n",
      "#CALCULATIONS\n",
      "S= H*m/(273+T)\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(S,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = 13.03 E.U\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.2 , Page no:289"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "m= 9 #gms\n",
      "H= 79.7 #cal per gram\n",
      "T= 0 #C\n",
      "\n",
      "#CALCULATIONS\n",
      "S= m*H/(273+T)\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(S,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = 2.63 E.U\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.3 , Page no:290"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "m= 14 #gms\n",
      "M= 28 #gms\n",
      "R= 1.99 # cal per mole per degree\n",
      "V= 30 #lit\n",
      "v1= 10 #lit\n",
      "\n",
      "#CALCULATIONS\n",
      "S1= (m/M)*R*2.303*math.log10(V/v1)\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(S1,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = 1.09 E.U\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.4 , Page no:290"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "m= 14 #gms\n",
      "M= 28 #gms\n",
      "S= 6.94 #cal per mole\n",
      "T= 127 #C\n",
      "T1= 27 #C\n",
      "S1= 4.94 #cal per mole\n",
      "\n",
      "#CALCULATIONS\n",
      "dS= (m/M)*S*math.log((273+T)/(273+T1))\n",
      "dS1= (m/M)*S1*math.log((273+T)/(273+T1))\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(dS-0.01,2),\"E.U\";\n",
      "print\"Entropy change =\",round(dS1,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = 0.99 E.U\n",
        "Entropy change = 0.71 E.U\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.5 , Page no:293"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Scl= 53.29 #E.U\n",
      "Sag= 10.21 #E.U\n",
      "Sagcl= 22.97 #E.U\n",
      "\n",
      "#CALCULATIONS\n",
      "dS= Sagcl-Sag-0.5*Scl\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(dS,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = -13.89 E.U\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.6 , Page no:293"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Scl= 13.17 #E.U\n",
      "Sag= 17.67 #E.U\n",
      "Sagcl= 22.97 #E.U\n",
      "\n",
      "#CALCULATIONS\n",
      "dS= Scl+Sag-Sagcl\n",
      "\n",
      "#RESULTS\n",
      "print\"Entropy change =\",round(dS,2),\"E.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change = 7.87 E.U\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.7 , Page no:295"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "F1= -94260 #cal\n",
      "F2= -56690 #cal\n",
      "F3= -7860 #cal\n",
      "\n",
      "#CALCULATIONS\n",
      "F= 2*F1+3*F2-F3\n",
      "\n",
      "#RESULTS\n",
      "print\"value of dF =\",round(F,2);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of dF = -350730.0\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.8 , Page no:295"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "T= 25 #C\n",
      "F1= -35180 #cal\n",
      "\n",
      "#CALCULATIONS\n",
      "F= F1\n",
      "\n",
      "#RESULTS\n",
      "print\"value of dF =\",round(F,2);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of dF = -35180.0\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.9 , Page no:296"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "F= -51180 #cal\n",
      "T= 25 #C\n",
      "R= 1.99 #cal/mole K\n",
      "\n",
      "#CALCULATIONS\n",
      "K= 10**(-F/(R*(273+T)*2.303))\n",
      "\n",
      "#RESULTS\n",
      "print\"equilibrium constant =\",'%.2E'%K;"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "equilibrium constant = 2.98E+37\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.10 , Page no:296"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "F= 18430 #cal\n",
      "F1= -31350 #cal\n",
      "F2= 26224 #cal\n",
      "R= 1.99 #cal/mole K\n",
      "T= 25 #C\n",
      "\n",
      "#CALCULATIONS\n",
      "F3= F+F1+F2\n",
      "Ksp= 10**(-F3/(R*(273+T)*2.303))\n",
      "\n",
      "#RESULTS\n",
      "print\"solubility product =\",'%.2E'%Ksp;"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "solubility product = 1.81E-10\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.11 , Page no:296"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "F= -51108 #cal\n",
      "f= 96500 #coloumbs\n",
      "n= 2 #moles\n",
      "\n",
      "#CALCULATIONS\n",
      "E= -F*4.184/(n*f)\n",
      "\n",
      "#RESULTS\n",
      "print\"value of E =\",round(E,2),\"v\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of E = 1.11 v\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.12 , Page no:297"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "F1= 31350 #cal\n",
      "F2= 26224 #cal\n",
      "F= 96500 #coloumbs\n",
      "\n",
      "#CALCULATIONS\n",
      "F3= -F1+F2\n",
      "E= F3*4.184/F\n",
      "\n",
      "#RESULTS\n",
      "print\"value of E =\",round(E,4),\"cal\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of E = -0.2223 cal\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.13 , Page no:298"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "T= 25 #C\n",
      "a= 0.2 #molar\n",
      "P= 1 #atm\n",
      "F1= -5126 #cal\n",
      "R= 2 #cal/mole K\n",
      "\n",
      "#CALCULATIONS\n",
      "F= F1+R*(273+T)*2.303*math.log10(a**2)\n",
      "\n",
      "#RESULTS\n",
      "print\"value of F =\",round(F),\"cal\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of F = -7045.0 cal\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.14 , Page no:299"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "T= 25 #C\n",
      "F= 1160 #cal\n",
      "P= 0.1 #atm\n",
      "P1= 1 #atm\n",
      "R= 2 #cal/mole K\n",
      "\n",
      "#CALCULATIONS\n",
      "F1= F+R*(273+T)*math.log(P/P1**2)\n",
      "F2= F+R*(273+T)*math.log(P1/P**2)\n",
      "\n",
      "#RESULTS\n",
      "print\"value of F =\",round(F1),\"cal\";\n",
      "print\"value of F =\",round(F2),\"cal\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of F = -212.0 cal\n",
        "value of F = 3905.0 cal\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.15 , Page no:300"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "T= 25 #C\n",
      "H= -94.05 #kcal\n",
      "H1= -26.42 #kcal\n",
      "S= 51.06 #cal per degree\n",
      "S1= -47.3 #cal per degree\n",
      "S2= -24.5 #cal per degree\n",
      "\n",
      "#CALCULATIONS\n",
      "dH= (H-H1)*1000\n",
      "dS= S+S1+S2\n",
      "F= dH-(273+T)*dS\n",
      "\n",
      "#RESULTS\n",
      "print\"value of F =\",round(F),\"cal\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of F = -61449.0 cal\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}