{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 20 : Performance of Materials in Service ( Fracture, Fatigue, and Corrosion and its Control)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 20.1 page no : 537"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "l = 1.5*10**-6;\t\t\t#crack length in m\n",
      "e = 70*10**9;\t\t\t#Young's modulous in N/m**2\n",
      "y_e = 1.05;\t\t\t#specific surface energy in j/m**2\n",
      "\n",
      "# Calculations\n",
      "a_f = math.sqrt((2*y_e*e)/(3.14*l));\n",
      "a_f1 = a_f*10**-6;\t\t\t#in MPa\n",
      "r = a_f/e;\t\t\t#ratio\n",
      "\n",
      "# Results\n",
      "print \"Fracture strength (in MPa)  =  %.2f\"%a_f1\n",
      "print \"Ratio of fracture strength to Youngs modulous  =  %.2e\"%r\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fracture strength (in MPa)  =  176.66\n",
        "Ratio of fracture strength to Youngs modulous  =  2.52e-03\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 20.2 pageno : 547"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "#Variables\n",
      "m_m = 58.71;\t\t\t#molecular weight of ni\n",
      "m_c = 74.71;\t\t\t#molecular weight of nio\n",
      "p_m = 8900;\t\t\t#density of ni in kg/m**3\n",
      "p_c = 7080;\t\t\t#desity of nio in kg/m**3\n",
      "\n",
      "#Calculations & Reults\n",
      "x = m_m/p_m;\t\t\t#molar volume of ni in m**3/mol\n",
      "print \"Mc/Pc (in m**3/mol) %.2e m**3/mol\"%x\n",
      "y = m_c/p_c;\t\t\t#molar volume of nio in m**3/mol\n",
      "print \"Mm/Pm (in m**3/mol) %.2e m**3/mol\"%y\n",
      "print \"           Mc/Pc > Mm/Pm Hence protective layer of NiO will form over Ni        \";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mc/Pc (in m**3/mol) 6.60e-03 m**3/mol\n",
        "Mm/Pm (in m**3/mol) 1.06e-02 m**3/mol\n",
        "           Mc/Pc > Mm/Pm Hence protective layer of NiO will form over Ni        \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 20.3 pageno : 548"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "x1 = 0.1;\t\t\t#in mm\n",
      "t1 = 25.;\t\t\t#in hours\n",
      "t2 = 300.;\t\t\t#in hours\n",
      "\n",
      "# Calculations\n",
      "x2 = x1*math.sqrt(t2/t1);\t\t\t#in mm\n",
      "\n",
      "# Results\n",
      "print \"Oxidation loss in 300 hours (in mm)  =  %.3f mm\"%x2\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Oxidation loss in 300 hours (in mm)  =  0.346 mm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 20.4 pageno : 551"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p_mg = 1.74;\t\t\t#density of magnesium in gm/cm**3\n",
      "p_mgo = 3.65;\t\t\t#density of magnesium oxide in gm/cm**3\n",
      "m_mg = 24.;\t\t\t#mol wt ogf mg\n",
      "m_mgo = 40.3;\t\t\t#mol wt of mgo\n",
      "\n",
      "# Calculations\n",
      "PBR = (m_mgo/p_mgo)/(m_mg/p_mg);\n",
      "\n",
      "# Results\n",
      "print \"PBR  =  %.2f\"%PBR\n",
      "print \"Since PBR < 1. So porous film will form which will be non protective\";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "PBR  =  0.80\n",
        "Since PBR < 1. So porous film will form which will be non protective\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 20.5 pageno : 562"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 0.0243;\t\t\t#one mole of magnesium in kg\n",
      "\n",
      "# Calculations\n",
      "c = 2.*96490;\t\t\t#in C\n",
      "j = 20.*10**-3;\t\t\t#in A/m**2\n",
      "t = 15.*365*24*3600;\t\t\t#in sec\n",
      "x = j*t;        \t\t\t#in A s\n",
      "w_mg = m*x/c;\t    \t\t#in kg/sqm\n",
      "\n",
      "# Results\n",
      "print \"Amount of Magnesium needed (in Kg/m**2)  =  %.2f kg/m**2\"%w_mg\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Amount of Magnesium needed (in Kg/m**2)  =  1.19 kg/m**2\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}