{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 13 Heat treatment of Steels and Cast Iron"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 13_1 pgno:496"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Carbon content present in Steel: 1.085512\n",
      "Carbon content present in Steel: 1.065\n",
      "The carbon content is on the order of 1.065 to 1.086 percent, consistent with a 10110 steel\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "Fe=6.67;#Carbon percentage in Cementite by weight\n",
    "G=0.77;#Carbon percentage in eutectoid composition  in steel by weight\n",
    "A=0.0218;#Carbon percentage in Ferrite\n",
    "Fe3C=16.;#Percentage of alpha ferrite in steel\n",
    "P=95.;#Percentage of Pearlite in Steel\n",
    "#CALCULATIONS\n",
    "X1=((Fe3C/100)*(Fe-A))+A;#Carbon content present in Steel\n",
    "X2=Fe-((P/100)*(Fe-G));#Carbon content  present in Steel\n",
    "print \"Carbon content present in Steel:\",X1\n",
    "print \"Carbon content present in Steel:\",X2\n",
    "print \"The carbon content is on the order of 1.065 to 1.086 percent, consistent with a 10110 steel\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exmaple 13_3 pgno:502"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "primary alpha in percentage = 36.0\n",
      "pearlite in percentage = 64.0\n"
     ]
    }
   ],
   "source": [
    "\n",
    "primary_alpha=((0.77-.5)/(0.77-0.0218))*100\n",
    "pearlite=((0.5-0.0218)/(0.77-0.0218))*100\n",
    "print \"primary alpha in percentage =\",round(primary_alpha)\n",
    "print \"pearlite in percentage =\",round(pearlite)\n",
    "#Answer difference is due to roundoff"
   ]
  }
 ],
 "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
}
