{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 12 Dispersion Strengthening  by Phase Transmission and Heat Treatment"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12_1 pgno:454"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Constant 10**10 A= 1.35108097784\n",
      "Slpoe of the straight line -Q/R -20829.0\n"
     ]
    }
   ],
   "source": [
    "from math import log,exp\n",
    "# Initialisation of Variables\n",
    "r1=0.111;#Rate of copper in min^-1 at 135 degree celsius\n",
    "r2=0.004;#Rate of copper in min^-1 at 88 degree celsius\n",
    "T1=408.;#Temperature in K\n",
    "T2=361.;#Temperature in K\n",
    "R=1.987;#Gas constant\n",
    "Q=20693.;#Change in Rates\n",
    "slope=(log(r1)-log(r2))/((1/T1)-(1/T2));#Slope of the straight line ploted ln(Growth rate) as a function of 1=T,\n",
    "A=r1/(exp(-Q/(R*T1)));#Constant\n",
    "print  \"Constant 10**10 A=\",A/10**10\n",
    "print  \"Slpoe of the straight line -Q/R\",round(2*slope)\n",
    "#diffrence in asnwer is due to round off error\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12_5 pgno:467"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Amount of ferrite present in peralite: 88.7\n",
      "Amount of Cementite present in peralite: 11.3\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "Fe=6.67;#Carbon percentage in Cementite\n",
    "G=0.77;#Carbon percentage in  peralite in composition\n",
    "A=0.0218;#Carbon percentage in Ferrite\n",
    "#CALCULATIONS\n",
    "ferrite=((Fe-G)/(Fe-A))*100#Amount of ferrite present in peralite\n",
    "C=((G-A)/(Fe-A))*100;#Amount of Cementite present in peralite\n",
    "print \"Amount of ferrite present in peralite:\",round(ferrite,1)\n",
    "print \"Amount of Cementite present in peralite:\",round(C,1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12_6 pgno:469"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Composition of Phase Ferrite in alloy : 91.3\n",
      "Composition of Cementite in percent in alloy: 8.7\n",
      "Percentage of microconstituents Primary Ferrite in alloy: 22.7\n",
      "Percentage of microconstituents Pearlite in alloy: 77.3\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "A=0.0218;#Carbon percentage in  primary alpha in percent\n",
    "Fe=6.67;#Carbon percentage in Cementite in percent\n",
    "G=0.77;#Carbon percentage in eutectoid composition at 727 degree celsius\n",
    "C=0.60;#Carbon percentage in Pearlite in percent\n",
    "#CALCULATIONS\n",
    "alpha=((Fe-C)/(Fe-A))*100;# Composition of Phase Ferrite in alloy \n",
    "Ce=((C-A)/(Fe-A))*100;#Composition of Cementite in percent in alloy\n",
    "PF=((G-C)/(G-A))*100;#Percentage of microconstituents Primary Ferrite in alloy\n",
    "P=((C-A)/(G-A))*100;#Percentage of microconstituents Pearlite in alloy\n",
    "print \"Composition of Phase Ferrite in alloy :\",round(alpha,1)\n",
    "print \"Composition of Cementite in percent in alloy:\",round(Ce,1)\n",
    "print \"Percentage of microconstituents Primary Ferrite in alloy:\",round(PF,1)\n",
    "print \"Percentage of microconstituents Pearlite in alloy:\", round(P,1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12_7 pgno:474"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The interlamellar spacing between one alpha plate to next alpha plate in Pearlite Microstructure: 7.14285714286e-05\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "d=0.001;#Actual distence between one alpha plate to next alpha plate \n",
    "S=14;#Spacings between between one alpha plate to next alpha plate \n",
    "#CALCULATIONS\n",
    "lamida=d/S;#The interlamellar spacing between one alpha plate to next alpha plate in Pearlite Microstructure\n",
    "print \"The interlamellar spacing between one alpha plate to next alpha plate in Pearlite Microstructure:\",lamida\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12_9 pgno:476"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The carbon content of hypoeutectoid  Steel in percentage: 0.31\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "M=0.60;#Percentage of Carbon in Martensite at  750 degree celsius\n",
    "a=50.;#Percentage of Carbon in Austenite at 750 degree celsius\n",
    "c=0.02;#Percentage of Carbon atoms in Steel \n",
    "X=(a/100)*(M-c)+c;#The carbon content of Steel in percentage\n",
    "print \"The carbon content of hypoeutectoid  Steel in percentage:\",X\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
