{
 "metadata": {
  "name": "CH17"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17: Corrosion and Degradiation of Materials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 17.1 Page No 629"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "V_Cd=-0.403  #Half Cell Potential of Cd++|Cd\n",
      "V_Ni=-0.250  #Half Cell Potential of Ni++|Ni\n",
      "\n",
      "dV=V_Ni-V_Cd\n",
      "C_Ni=10**-3\n",
      "C_Cd=0.5\n",
      "n=2          #Net electron exchange in Redox reaction\n",
      "V=-dV-(0.0592*math.log10(C_Ni/C_Cd)/n)\n",
      "\n",
      "print\"Standard Cell potential is \",dV,\"V\"\n",
      "print\"Net EMF is \",round(V,3),\"V\"\n",
      "if V<0:\n",
      "    print\"Ni is reduced & Cd is oxidised\"\n",
      "else:\n",
      "    print\"Cd is reduced & Ni is oxidised\"\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Standard Cell potential is  0.153 V\n",
        "Net EMF is  -0.073 V\n",
        "Ni is reduced & Cd is oxidised\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 17.2 Page No 637"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VZn_Zn2=-0.763\n",
      "iZn=10**-7\n",
      "beta_Zn=0.09\n",
      "iH2=10**-10\n",
      "VH_H2=0\n",
      "beta_H2=-0.08\n",
      "\n",
      "ic=10**((VH_H2-VZn_Zn2-(beta_H2*math.log10(iH2))+(beta_Zn*math.log10(iZn)))/(beta_Zn-beta_H2))\n",
      "n=2              #Exchange of 2 electrons\n",
      "F=96500          #Faradays constant\n",
      "r=ic/(n*F)\n",
      "Vc=VH_H2+(beta_H2*log10(ic/iH2))\n",
      "\n",
      "print\"i) Rate of oxiadation is\",round(r,12),\"mol/cm**2-s\"\n",
      "print\"ii) Corrosion potential is\",round(Vc,3),\"V\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i) Rate of oxiadation is 6.18e-10 mol/cm**2-s\n",
        "ii) Corrosion potential is -0.486 V\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}