{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 11 Dispertion Strengthening and Eutectic Phase Diagrams"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_2 pgno:422"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "c.Amount of beeta forms of Pb-Sn in gm: 8.16326530612\n",
      "d.The mass of Sn in the alpha phase in g: 1.83673469388\n",
      "d.The mass of Sn in beeta phase in g: 8.2\n",
      "e.The mass of Pb in the alpha phase in g: 90.0\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "Sn=2.#Amount of Tin Dissolved in alpha solid solution \n",
    "Sn2=10.;#Amount of Tin Dissolved in alpha+beeta   solid solution at 0 degree celsius\n",
    "m=100.;#Total mass of the Pb-Sn alloy in gm\n",
    "Pbm=90.#Total mass of the Pb in Pb-Sn alloy in gm\n",
    "#CALCULATIONS\n",
    "B=((Sn2-Sn)/(m-Sn))*100;#The amount of beeta Sn  that forms if a Pb-10% Sn alloy is cooled to 0 Degree celsius\n",
    "B2=100-B;#The amount of alpha Sn that forms if a Pb-10% Sn alloy is cooled to 0 Degree celsius\n",
    "Sn1=(Sn/100.)*(B2);#The mass of Sn in the alpha phase in g\n",
    "Sn2=Sn2-Sn1;#The mass of Sn in beeta phase in g\n",
    "Pb1=B2-Sn1;#The mass of Pb in the alpha phase in g\n",
    "Pb2=Pbm-Pb1;#The mass of Pb in the beeta phase in g\n",
    "print \"c.Amount of beeta forms of Pb-Sn in gm:\",B\n",
    "print \"d.The mass of Sn in the alpha phase in g:\",Sn1\n",
    "print \"d.The mass of Sn in beeta phase in g:\",round(Sn2,1)\n",
    "print \"e.The mass of Pb in the alpha phase in g:\",Pb1\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_3 pgno:425"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Weight fraction of alpha phase 0.453503184713\n",
      "Weight fraction of beeta phase 0.546496815287\n",
      "The mass of the alpha phase in 200g in g: 90.7006369427\n",
      "The amount of the beeta phase in g at  182 degree celsius: 109.299363057\n",
      "Mass of Pb in the alpha phase in g: 73.4675159236\n",
      "Mass of Sn in alpha phase 17.2331210191\n",
      "Mass of Pb in beeta phase: 2.73248407643\n",
      "mass of Sn in beeta Phase: 106.6\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "M=200.;#Mass of alpha phase of alloy in gm\n",
    "Sn=61.9;#Percentage of the Sn in the eutectic alloy in percent\n",
    "Pb=19.;#Percentage of the Pb in the alpha phase in percent\n",
    "Pb2=97.5;#Percentage of the Sn in the beeta phase in percent\n",
    "#CALCULLATIONS\n",
    "W1=(Pb2-Sn)/(Pb2-Pb);#Weight fraction of alpha phase\n",
    "W2=(Sn-Pb)/(Pb2-Pb);#Weight fraction of beeta phase\n",
    "Ma=M*W1;#The mass of the alpha phase in 200g in g\n",
    "Mb=M-Ma;#The amount of the beeta phase in g at  182 degree celsius\n",
    "MPb1=Ma*(1-(Pb/100));#Mass of Pb in the alpha phase in g\n",
    "MSn1=Ma-MPb1;#Mass of Sn in alpha phase \n",
    "MPb2=Mb*(1-(Pb2/100));#Mass of Pb in beeta phase\n",
    "MSn2=123.8-MSn1;#mass of Sn in beeta Phase\n",
    "print \"Weight fraction of alpha phase\",W1\n",
    "print \"Weight fraction of beeta phase\",W2\n",
    "print \"The mass of the alpha phase in 200g in g:\",Ma\n",
    "print \"The amount of the beeta phase in g at  182 degree celsius:\",Mb\n",
    "print \"Mass of Pb in the alpha phase in g:\",MPb1\n",
    "print \"Mass of Sn in alpha phase\",MSn1\n",
    "print \"Mass of Pb in beeta phase:\",MPb2\n",
    "print \"mass of Sn in beeta Phase:\",round(MSn2,1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_5 pgno:429"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The amount of compositions of primary alpha in Pb-Sn: 74.0\n",
      "The amount of composition of eutectic in Pb-Sn: 26.0\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "Sn=61.9;#Percentage of the Sn in the eutectic alloy in percent\n",
    "Pb=19.;#Percentage of the Pb in the alpha phase in percent\n",
    "Sn2=30.;#Percentage of the Sn in the eutectic alloy in percent\n",
    "#CALCULATIONS\n",
    "Pa=(Sn-Sn2)/(Sn-Pb);#The amount of compositions of primary alpha in Pb-Sn\n",
    "L=(Sn2-Pb)/(Sn-Pb);#The amount of composition of eutectic in Pb-Sn\n",
    "print \"The amount of compositions of primary alpha in Pb-Sn:\",round(Pa*100)\n",
    "print \"The amount of composition of eutectic in Pb-Sn:\", round(L*100)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_6 pgno:434"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "L200 in percentage 59.0\n",
      "L210 in percentage 70.0\n"
     ]
    }
   ],
   "source": [
    "\n",
    "per_L_200=((40.-18.)/(55.-18.))*100\n",
    "Per_L_210=((40.-17.)/(50.-17.))*100\n",
    "print \"L200 in percentage\",round(per_L_200)\n",
    "print \"L210 in percentage\",round(Per_L_210)\n",
    "#answer variation is due to round off"
   ]
  }
 ],
 "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
}
