{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter4 - Machining Processes"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.1 - page 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from math import atan, tan, cos , sin, degrees, pi\n",
      "# Given that\n",
      "alpha = 10 # Rake angle in Degree\n",
      "t = 0.4 # Chip thickness  in mm\n",
      "T = 0.15 # Uncut chip thickness in mm\n",
      "\n",
      "r = T/t\n",
      "phi = degrees(atan((r*cos(alpha*pi/180))/(1-r*sin(alpha*pi/180))))\n",
      "gama = 1/tan(phi*pi/180) + tan((phi-alpha)*pi/180)\n",
      "print \"Shear plane angle = %0.1f\u00b0, \\nMagnitude of the shear strain = %0.2f\"%(phi,gama)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shear plane angle = 21.6\u00b0, \n",
        "Magnitude of the shear strain = 2.74\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.2 - page 192"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "t1 = 0.25 # Undercut thickness in mm\n",
      "t2 = 0.75 # Chip thickness in mm\n",
      "w = 2.5 # Width in mm\n",
      "alpha = 0 # Rake angle in Degree\n",
      "Fc = 950 # Cutting force in N\n",
      "Ft = 475 # Thrust force in N\n",
      "\n",
      "r = t1/t2\n",
      "mu = ((Fc*sin(alpha*pi/180)) + (Ft*cos(alpha*pi/180)))/((Fc*cos(alpha*pi/180))-(Ft*sin(alpha*pi/180)))\n",
      "phi = degrees(atan((r*cos(alpha*pi/180))/(1-r*sin(alpha*pi/180))))\n",
      "As = t1*w/sin(phi*pi/180)\n",
      "Fs = Fc*cos(phi*pi/180) - Ft*sin(phi*pi/180)\n",
      "T_s = Fs/As\n",
      "print \"\"\"Coefficient of the friction between tool and the chip = %0.1f,\n",
      "The ultimate shear stress of the material = %0.1f N/mm**2\"\"\"%(mu,T_s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coefficient of the friction between tool and the chip = 0.5,\n",
        "The ultimate shear stress of the material = 380.0 N/mm**2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.3 - page 193"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "alpha = 10 # Rake angle of tool in Degree\n",
      "v = 200 # Cutting speed in m/min\n",
      "t1 = 0.2 # Uncut thickness in mm\n",
      "w = 2 # Width of cut in mm\n",
      "mu = 0.5 # Avg value of the cofficient of tbe friction\n",
      "T_S = 400 # Shear stress of the work material in N/mm**2\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "phi = (90 + alpha - lamda)/2\n",
      "Fs = (w*t1*T_S)/(sin(phi*pi/180))\n",
      "R = Fs/(cos((phi+lamda-alpha)*pi/180))\n",
      "Fc = R*(cos((lamda-alpha)*pi/180))\n",
      "Ft = R*(sin((lamda-alpha)*pi/180))\n",
      "print \"Shear angle = %0.1f\u00b0, \\nCutting force = %0.f N, \\nThrust force = %d N,\"%(phi,Fc,Ft)\n",
      "# Answer in the book for cutting force is given as 420 N and for thrust force is given as 125 N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shear angle = 36.7\u00b0, \n",
        "Cutting force = 429 N, \n",
        "Thrust force = 127 N,\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.4 - page 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "alpha = 10 # Rake angle of tool in Degree\n",
      "v = 200 # Cutting speed in m/min\n",
      "t1 = 0.2 # Uncut thickness in mm\n",
      "w = 2 # Width of cut in mm\n",
      "mu = 0.5 # Avg value of the cofficient of tbe friction\n",
      "T_S = 400 # Shear stress of the work material in N/mm**2\n",
      "Cm = 70 # Machining constant in Degree\n",
      "lamda = degrees(atan(mu))\n",
      "phi = (Cm + alpha - lamda)/2\n",
      "Fs = (w*t1*T_S)/(sin(phi*pi/180))\n",
      "R = Fs/(cos((phi+lamda-alpha)*pi/180))\n",
      "Fc = R*(cos((lamda-alpha)*pi/180))\n",
      "Ft = R*(sin((lamda-alpha)*pi/180))\n",
      "# Using Lee and Shaffer relation \n",
      "phi_ = 45-lamda+alpha\n",
      "Fs_ = (w*t1*T_S)/(sin(phi_*pi/180))\n",
      "R_ = Fs_/(cos((phi_+lamda-alpha)*pi/180))\n",
      "Fc_ = R_*(cos((lamda-alpha)*pi/180))\n",
      "Ft_ = R_*(sin((lamda-alpha)*pi/180))\n",
      "print \"\"\"Shear angle = %0.1f\u00b0,\n",
      "Cutting force = %0.2f N,\n",
      "Thrust force = %0.2f N\n",
      "Using Lee and Shaffer relation- \n",
      " Shear angle = %0.2f\u00b0,\n",
      " Cutting force = %0.2f N,\n",
      " Thrust force = %0.2f N,\"\"\"%(phi,Fc,Ft,phi_,Fc_,Ft_)\n",
      "# Answer in the book for cutting force is given as 486.9 N and for thrust force is given as 144.9 N , When using Lee and Shaffer relation answer in the book for cutting force is given as 481.9 N and for trust force is given as 160.6 N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shear angle = 26.7\u00b0,\n",
        "Cutting force = 468.57 N,\n",
        "Thrust force = 139.37 N\n",
        "Using Lee and Shaffer relation- \n",
        " Shear angle = 28.43\u00b0,\n",
        " Cutting force = 455.48 N,\n",
        " Thrust force = 135.48 N,\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.5 - page 196"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "t1 = 0.25 # Uncut thickness in mm\n",
      "w = 2.5 # Width of cut in mm\n",
      "U_0 = 1.4 # In J/mm**3\n",
      "alpha = 0 # Rake angle in degree\n",
      "mu = 0.5 # Cofficient of the friction\n",
      "T_s = 400 # Shear stress in N/mm**2\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "Fc = 1000*(t1*w*U_0)*((t1)**(-.4))\n",
      "phi = 45 + alpha - degrees(atan(mu))\n",
      "Fc_ = (w*t1*T_s*cos((lamda-alpha)*pi/180))/((sin(phi*pi/180)) *cos((phi+lamda-alpha)*pi/180))\n",
      "print \"\"\"The order of magnitude of cutting force = %d N,\n",
      "Using Lee and Shaffer relation-\n",
      " The order of magnitude of cutting force = %d N.\"\"\"%(Fc,Fc_)\n",
      "# Answer in the book for cutting force is given as 1517 N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The order of magnitude of cutting force = 1523 N,\n",
        "Using Lee and Shaffer relation-\n",
        " The order of magnitude of cutting force = 999 N.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.6 - page 199"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log, sqrt\n",
      "# Given that\n",
      "v = 2 # Cutting speed in m/sec\n",
      "D = 7200 # Density of mild steel in kg /m**3\n",
      "k = 43.6 # Thermal conductivity in W/m-\u00b0c\n",
      "c = 502 # Specific heat of the material in J/kg-\u00b0c\n",
      "t1 = 0.25 # Uncut thickness in mm\n",
      "w =2 # Width of cut in mm\n",
      "theta_0 = 40 # Initial temp of the workpiece in Degree\n",
      "alpha = 0 # Rake angle in degree\n",
      "mu = 0.5 # Cofficient of the friction\n",
      "T_s = 400e6 # Shear stress in N/m**2\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45 + alpha - lamda\n",
      "Fs = (w*t1*T_s)*(10**-6)/(sin(phi*pi/180))\n",
      "R = Fs / (cos((phi+lamda-alpha)*pi/180))\n",
      "Fc = R *(cos((lamda-alpha)*pi/180))\n",
      "r = sin(phi*pi/180)/(cos((phi-alpha)*pi/180))\n",
      "Ft= Fc *(tan((lamda - alpha)*pi/180))\n",
      "F = Fc *(sin(alpha*pi/180))+Ft*(cos(alpha*pi/180))\n",
      "Ws = F*r*v\n",
      "Wp = Fc*v-F*r*v\n",
      "zeta = D*c*v*t1*(10**-3)/k\n",
      "zeta_ = zeta*tan(phi*pi/180)\n",
      "nu = 0.15 *(log(27.5/(zeta_)))\n",
      "theta_P = (1-nu)*Wp/(D*c*v*t1*w*(10**-6))\n",
      "theta_S = 1.13 *(sqrt(1/(D*c*v*t1*(10**-3)*k*(1+tan((phi-alpha)*pi/180))))*(Ws/w)*(10**3))                 \n",
      "theta = theta_0+theta_S+ theta_P\n",
      "print \" \\n Maximum temperature along the rake face of the tool = %0.1f\u00b0C.\"%theta\n",
      "# Answer in the book  is given as 823\u00b0C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " \n",
        " Maximum temperature along the rake face of the tool = 835.6\u00b0C.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.7 - Page 206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "theta_ = 40 #Ambient temperature in\u00b0C\n",
      "v = 2 # Cutting speed in m/sec\n",
      "D = 7200 # Density of mild steel in kg /m**3\n",
      "k = 43.6 # Thermal conductivity in W/m-\u00b0c\n",
      "c = 502 # Specific heat of the material in J/kg-\u00b0c\n",
      "t1 = 0.25 # Uncut thickness in mm\n",
      "w =2 # Width of cut in mm\n",
      "alpha = 0 # Rake angle in degree\n",
      "mu = 0.5 # Cofficient of the friction\n",
      "T_s = 400e6 # Shear stress in N/m**2\n",
      "H = 350 # Hardness of SAE 1040 steel in HV(Vicker hardness)\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45 + alpha - lamda\n",
      "Fs = (w*t1*T_s)*(10**-6)/(sin(phi*pi/180))\n",
      "R = Fs / (cos((phi+lamda-alpha)*pi/180))\n",
      "Fc = R *(cos((lamda-alpha)*pi/180))\n",
      "r = sin(phi*pi/180)/(cos((phi-alpha)*pi/180))\n",
      "Ft= Fc *(tan((lamda - alpha)*pi/180))\n",
      "F = Fc *(sin(alpha*pi/180))+Ft*(cos(alpha*pi/180))\n",
      "Ws = F*r*v\n",
      "Wp = Fc*v-F*r*v\n",
      "zeta = D*c*v*t1*(10**-3)/k\n",
      "zeta_ = zeta*tan(phi*pi/180)\n",
      "nu = 0.15 *(log(27.5/(zeta_)))\n",
      "Theta_0v = ((1-nu)*Wp + Ws)/ (D*c*v*t1*w*(10**-6))\n",
      "H_ = 1.5 *(H)\n",
      "theta_lim = 700*((1-(H_/850))**(1/3.1))\n",
      "v_lim = (theta_lim/309)**(1/0.5)\n",
      "print \" \\n Maximum speed at which cutting is passible = %0.2f m/sec.\"%v_lim"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " \n",
        " Maximum speed at which cutting is passible = 2.76 m/sec.\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "PROBLEM 4.8 - page 212"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "alpha = 0 # Rake angle in degree\n",
      "gama = 3 # Clearance angle in Degree\n",
      "w = 1 # Maximum length of flank wear allowed in mm\n",
      "gama_ = 7 # Increased clearance angle in Degree\n",
      "I_per = (((tan(gama_*pi/180))-(tan(gama*pi/180)))/tan(gama*pi/180))*100\n",
      "print \" \\n Percentage increase in tool life = %d percent.\"%I_per"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " \n",
        " Percentage increase in tool life = 134 percent.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 9 on page no. 220"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "d= 4 # Depth of cut in mm\n",
      "f = 0.25 # Feed in mm/stroke\n",
      "alpha = 10 # Rake angle in degree\n",
      "shi = 30 # Principal cutting edge angle in Degree\n",
      "mu =0.6 # Cofficient of friction between chip and tool\n",
      "T_s = 340 # Ultimate shear stress of cast iron in N/mm**2\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45 +alpha-lamda\n",
      "Fc = f*d*T_s*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n",
      "Ft = Fc*(sin((lamda-alpha)*pi/180))/(cos((lamda-alpha)*pi/180))\n",
      "Ff = Ft*(cos(shi*pi/180))\n",
      "Fn = Ft*(sin(shi*pi/180))\n",
      "print \"\"\"The three components of machinig force are as follows-\n",
      "  Thrust force = %d N,\n",
      "  Feed force component = %d N,\n",
      "  Normal thrust force component = %d N.\"\"\"%(Ft,Ff,Fn)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The three components of machinig force are as follows-\n",
        "  Thrust force = 422 N,\n",
        "  Feed force component = 365 N,\n",
        "  Normal thrust force component = 211 N.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 10 on page no. 221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "d= 4 # Depth of cut in mm\n",
      "f = 0.25 # Feed in mm/stroke\n",
      "alpha = 10 # Rake angle in degree\n",
      "shi = 30 # Principal cutting edge angle in Degree\n",
      "mu =0.6 # Cofficient of friction between chip and tool\n",
      "T_s = 340 # Ultimate shear stress of cast iron in N/mm**2\n",
      "N = 60 # Cutting stroke/min\n",
      "L = 200 # Length of the job in mm\n",
      "H = 180 # Hardness of the workpiece in BHN\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45 +alpha-lamda\n",
      "Fc = f*d*T_s*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n",
      "Fc_ = Fc*(L/1000)\n",
      "Wav  =Fc_*N/60\n",
      "t1 = f*cos(shi*pi/180)\n",
      "U_0 = 0.81 # By using table 4.4 given in the book, In J/mm**3\n",
      "Uc = U_0*((t1)**(-.4))\n",
      "Q = f*d*L*N/60\n",
      "Wav_ = Uc*Q\n",
      "print \"Avg power consumption = %d W,\\nSpecific power consumption when hardness of the workpiece is 180 BHN = %d W.\"%(Wav,Wav_)\n",
      "# Answer in the book for Specific power consumption is given as 294 W"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Avg power consumption = 220 W,\n",
        "Specific power consumption when hardness of the workpiece is 180 BHN = 298 W.\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 11 on page no. 224"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "alpha_b = 6 # Back rake angle in Degree\n",
      "alpha_s = 10 # Side rake angle in Degree\n",
      "gama = 7 # Front clearance angle in Degree\n",
      "gama_ = 7 # Side clearance angle in Degree\n",
      "Shi = 10 # End cutting edge angle in Degree\n",
      "shi = 30 # Side cutting edge angle in Degree\n",
      "r= 0.5 # Nose radius in mm\n",
      "\n",
      "k = tan(alpha_b*pi/180) * cos(shi*pi/180) - tan(alpha_s*pi/180) * sin(shi*pi/180)\n",
      "print \"The value of k=%0.4f,which is near to 0. Hence the case is close to orthogonal one.\\n\"%k\n",
      "alpha= degrees(atan(((tan(alpha_b*pi/180)) * sin(shi*pi/180) ) + (tan(alpha_s*pi/180) * (cos(shi*pi/180))))/ (sqrt(1+((tan(alpha_b*pi/180)*cos(shi*pi/180)) - (tan(alpha_s*pi/180)*sin(shi*pi/180)))**(2))))\n",
      "print \"Normal rake angle = %0.1f\u00b0.\"%(alpha)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of k=0.0029,which is near to 0. Hence the case is close to orthogonal one.\n",
        "\n",
        "Normal rake angle = 11.6\u00b0.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 12 on page no. 225"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import ceil\n",
      "# Given that\n",
      "alpha_b = 6 # Back rake angle in Degree\n",
      "alpha_s = 10 # Side rake angle in Degree\n",
      "gama = 5 # Front clearance angle in Degree\n",
      "gama_ = 7 # Side clearance angle in Degree\n",
      "Shi = 10 # End cutting edge angle in Degree\n",
      "shi = 30 # Side cutting edge angle in Degree\n",
      "r= 0.55 # Nose radius in mm\n",
      "d = 2.5 # Depth of cut in mm\n",
      "f = 0.125 # Feed in mm/revolution\n",
      "N = 300 # Rpm of the job\n",
      "T_S = 400 # Ultimate shear stress of the workpiece in N/mm**2\n",
      "mu = .6 # Cofficient of the friction between the tool and the chip\n",
      "\n",
      "lamda = degrees(atan(mu))\n",
      "alpha= degrees(atan(((tan(alpha_b*pi/180)) * sin(shi*pi/180) ) + (tan(alpha_s*pi/180) * (cos(shi*pi/180))))/ (sqrt(1+((tan(alpha_b*pi/180)*cos(shi*pi/180)) - (tan(alpha_s*pi/180)*sin(shi*pi/180)))**(2))))\n",
      "phi = 45 + alpha - lamda\n",
      "t1 = f*cos(phi*pi/180)\n",
      "w = d/cos(phi*pi/180)\n",
      "Fc = w*t1*T_S*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n",
      "Ft = Fc*tan((lamda-alpha)*pi/180)\n",
      "Ff = Ft*cos(shi*pi/180)\n",
      "Fr = Ft*sin(shi*pi/180)\n",
      "print \"Component of the machining force are as follows -\\n Feed force component = % d N, \\n Normal thrust force component = % d N.\"%(ceil(Ff),ceil(Fr))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Component of the machining force are as follows -\n",
        " Feed force component =  118 N, \n",
        " Normal thrust force component =  68 N.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 14 on page no. 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "D = 20 # Nominal diameter of the drill in mm\n",
      "T_S = 400 # Shear yield stress of work material in N/mm**2\n",
      "N = 240 # Rpm\n",
      "f = 0.25 # Feed in mm/revolution\n",
      "mu = 0.6 # Cofficient of friction\n",
      "\n",
      "Beta = 118/2 # From the table 4.12 given in the book\n",
      "shi = 30 # From the table 4.12 given in the book\n",
      "alpha = degrees(atan(((2*(D/4)/(D)))*tan(shi*pi/180))/sin(Beta*pi/180))\n",
      "t1 = (f/2)*sin(Beta*pi/180)\n",
      "w = (D/2)/sin(Beta*pi/180)\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45+alpha-lamda\n",
      "t1 = f/2\n",
      "Fc = w*t1*T_S*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n",
      "Ft = w*t1*T_S*(sin((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n",
      "M = .6*Fc*D/1000\n",
      "F = 5*Ft*sin(Beta*pi/180)\n",
      "print \"The drilling torque = %0.2f N-m, \\nThrust force = %d N.\"%(M,F)\n",
      "# Answer in the book for drilling torque is given as 18.2 N-m, and for thrust force is given as 1500 N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drilling torque = 17.85 N-m, \n",
        "Thrust force = 1376 N.\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 15 on page no. 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import asin\n",
      "# Given that\n",
      "w = 20 # Width of the mild steel block in mm\n",
      "Z = 20 # No of teeth in milling cutter\n",
      "D = 50 # Diameter of the milling cutter in mm\n",
      "alpha = 10 # Radial rake angle in Degree\n",
      "f = 15 # Feed velocity of the table in mm/min\n",
      "N =60 # Rpm of the cutter\n",
      "t = 1 # Depth of cut in mm\n",
      "mu = 0.5 # Cofficient of friction\n",
      "T_s = 400 # Shear yield stress in N/mm**2\n",
      "t_a = 0.0018 # Avg uncut thickness in mm\n",
      "\n",
      "Beta = degrees(asin(2*(t/D)))\n",
      "theta = 2*pi/Z\n",
      "t1_max = (2*f/(N*Z))*sqrt(t/D)\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45+alpha -lamda\n",
      "Fc_max = ((w*t1_max*T_s*cos((lamda-alpha)*pi/180)))/((sin(phi*pi/180))*(cos(45*pi/180)))\n",
      "T_max = Fc_max*D/(2*1000)\n",
      "M_av = (1/2)*(Beta*T_max)/theta\n",
      "omega = 2*pi*N/60\n",
      "U_0 = 1.4 # From the table 4.4 given in the book\n",
      "Uc_ms = U_0*((t_a)**(-0.4))\n",
      "R = f*t*w/60\n",
      "U = Uc_ms * R\n",
      "print \"Power consumption = %0.1f W.\"%U"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power consumption = 87.7 W.\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 16 on page no. 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "w = 20 # Width of the mild steel block in mm\n",
      "Z = 10 # No of teeth in milling cutter\n",
      "D = 75 # Diameter of the milling cutter in mm\n",
      "alpha = 10 # Radial rake angle in Degree\n",
      "f = 100 # Feed velocity of the table in mm/min\n",
      "N =60 # Rpm of the cutter\n",
      "t = 5 # Depth of cut in mm\n",
      "mu = 0.5 # Cofficient of friction\n",
      "T_s = 400 # Shear yield stress in N/mm**2\n",
      "t_a = 0.043 # Avg uncut thickness in mm\n",
      "\n",
      "Beta = degrees(asin(2*(t/D)))\n",
      "theta = 2*pi/Z\n",
      "t1_max = (2*f/(N*Z))*sqrt(t/D)\n",
      "lamda = degrees(atan(mu))\n",
      "phi = 45+alpha -lamda\n",
      "Fc_max = ((w*t1_max*T_s*cos((lamda-alpha)*pi/180)))/((sin(phi*pi/180))*(cos(45*pi/180)))\n",
      "T_max = Fc_max*D/(2*1000)\n",
      "M_av = (1/2)*(Beta*T_max)/theta\n",
      "omega = 2*pi*N/60\n",
      "U_0 = 1.4 # From the table 4.4 given in the book\n",
      "Uc_ms = U_0*((t_a)**(-0.4))\n",
      "R = f*t*w/60\n",
      "U = Uc_ms * R\n",
      "print \"Power required = %d W.\"%U\n",
      "# Answer in the book for Power required is given as 817 W"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power required = 821 W.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 17 on page no. 240"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "B = 20 # Width of the cut in mm\n",
      "Z = 10 # No of teeth in milling cutter\n",
      "D = 75 # Diameter of the milling cutter in mm\n",
      "alpha = 10 # Radial rake angle in Degree\n",
      "f = 25 # Feed velocity of the table in mm/min\n",
      "N =60 # Rpm of the cutter\n",
      "t = 5 # Depth of cut in mm\n",
      "mu = 0.5 # Cofficient of friction\n",
      "T_s = 400 # Shear yield stress in N/mm**2\n",
      "t_a = 0.043 # Avg uncut thickness in mm\n",
      "t1_max = 0.01\n",
      "lamda = 0.28 # From the table 4.13 Given in the book\n",
      "nu = 1400 # From the table 4.13 Given in the book\n",
      "t1_av = t1_max/2\n",
      "P = nu*B*t*f*(10**-4)/(6*((t1_av)**(lamda)))\n",
      "print \"Power required = %0.2f W.\"%P"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power required = 257.16 W.\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 18 on page no. 240"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "w = 20 # Width of the mild steel block in mm\n",
      "Z = 10 # No of teeth in milling cutter\n",
      "D = 75 # Diameter of the milling cutter in mm\n",
      "alpha = 10 # Radial rake angle in Degree\n",
      "f = 25 # Feed velocity of the table in mm/min\n",
      "N =60 # Rpm of the cutter\n",
      "t = 5 # Depth of cut in mm\n",
      "mu = 0.5 # Cofficient of friction\n",
      "T_s = 400 # Shear yield stress in N/mm**2\n",
      "t_a = 0.043 # Avg uncut thickness in mm\n",
      "\n",
      "R = f*t*w/60\n",
      "Uc = 3.3 # Specific energy in J/mm**3 from the table 4.14 Given in the book\n",
      "U = Uc * R\n",
      "print \"Power required = %d W.\"%ceil(U)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power required = 138 W.\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 19 on page no. 241"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "d = 25 # Diameter of circular hole in mm\n",
      "t = 20 # Thickness of the steel plate in mm\n",
      "D = 27 # Enlarged diameter of hole in mm\n",
      "c= 0.08 # Cut per tooth in mm\n",
      "alpha = 10 # Radial rake angle in Degree\n",
      "mu = 0.5 # Cofficient of friction\n",
      "T_s = 400 # Shear yield stress in N/mm**2\n",
      "\n",
      "lamda=degrees(atan(mu))\n",
      "phi = 45-lamda+alpha\n",
      "w = pi*(d+D)/2\n",
      "Fc = w*c*T_s*(cos((lamda-alpha)*pi/1800)/((sin(phi*pi/180))*(cos(45*pi/180))))\n",
      "s = 1.75*sqrt(t)\n",
      "F = 3*Fc\n",
      "print \"Peak broaching load = %d N.\"%ceil(F)\n",
      "# Answer in the book  is given as 22323 N which is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Peak broaching load = 23280 N.\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 20 on page no. 246"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "D = 250 # Diameter of the wheel in mm\n",
      "N = 2000 # Rpm of the wheel\n",
      "f =5 # Plung feed rate in mm/min\n",
      "C = 3 # Surface density of active grain in mm**-2\n",
      "A = 20*15 # Area of mild steel prismatic bar in mm**2\n",
      "rg = 15 # In mm**-1\n",
      "\n",
      "t1 = sqrt(f/(pi*D*N*C*rg))\n",
      "U_0 = 1.4 # From the table 4.4 given in the book\n",
      "Uc= U_0*((t1)**(-.4))\n",
      "R = A*f/60\n",
      "P = Uc*R\n",
      "Fc_ = 60000*(P)/(pi*D*A*C*N)\n",
      "print \"Power requirement during plunge grinding of the mild steel primatic bar = %d W.\"%ceil(P)\n",
      "# Answer in the book is given as 94 W which is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power requirement during plunge grinding of the mild steel primatic bar = 943 W.\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 21 on page no. 248"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "w = 25 # Width of mild steel block in mm\n",
      "d= 0.05 # Depth of cut in mm\n",
      "D = 200 # Diameter of the wheel in mm\n",
      "N = 3000 # Rpm of the wheel\n",
      "f =100 # Feed velocity of table in mm/min\n",
      "C = 3 # No of grits in mm**-2\n",
      "rg = 15 # In mm**-1\n",
      "\n",
      "t1_max = sqrt(((6*f)/(pi*D*N*C*rg))*sqrt(d/D))\n",
      "t1_a = t1_max/2\n",
      "U_0 = 1.4 # From the table 4.4 given in the book\n",
      "Uc= U_0*((t1_a)**(-.4))\n",
      "R = w*d*f/60\n",
      "P = Uc*R\n",
      "Fc = 60000*(P)/(pi*D*N)\n",
      "print \"Grinding force = %d N\"%Fc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Grinding force = 3 N\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 22 on page no. 251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that\n",
      "d= 0.05 # Depth of cut in mm\n",
      "f =200 # Feed rate in mm/min\n",
      "theta = 850 # Surface temperature in \u00b0C\n",
      "Theta = 700 # Maximum surface temperature of workpiece surface required to maintain in \u00b0C\n",
      "\n",
      "K = theta * (f**0.2)/(d**0.9)\n",
      "r = Theta/K\n",
      "C = d*f\n",
      "Dm = (r*C**0.2)**(1/1.1)\n",
      "fm = C/Dm\n",
      "print \"Required depth of cut = %f mm,\\nRequired feed = %d mm/min\"%(Dm,fm)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required depth of cut = 0.041910 mm,\n",
        "Required feed = 238 mm/min\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 24 on page no. 260"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that \n",
      "shi = 30 # Side cutting edge angle in Degree\n",
      "lamda = 7 # End cutting edge angle in Degree\n",
      "r = 0.7 # Nose radius in mm\n",
      "f = 0.125 # Feed in mm\n",
      "H_max = f/(tan(shi*pi/180)+1/tan(lamda*pi/180))\n",
      "H_max_ = (f**2)/(8*r)\n",
      "print \"Maximum height of uneveness in first tool case = %0.3f mm,\\nIn second tool case = %0.4f mm\"%(H_max,H_max_)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum height of uneveness in first tool case = 0.014 mm,\n",
        "In second tool case = 0.0028 mm\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 25 on page no. 262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that \n",
      "Z = 12 # No of teeth\n",
      "d = 100 # Diameter of cutter in mm\n",
      "N = 60 # Rpm of cutter\n",
      "f = 25 # Table feed in mm/min\n",
      "\n",
      "H_max = (f**2)/(4*d*(N**2)*(Z**2))\n",
      "print \"Maximum height of uneveness = %f mm\"%H_max"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum height of uneveness = 0.000003 mm\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 26 on page no. 268"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that \n",
      "n = 0.25 # Value of exponent of time in Taylor's tool life equation\n",
      "C = 75 # Value of constant in Taylor's tool life equation\n",
      "Lc = .15 # Labour cast in $/min\n",
      "Tc = 2.50 # Total cast of tool in $\n",
      "t = 2 # Change time for tool in min\n",
      "\n",
      "x = (C)**(1/n) # Where x = k/(f**(1/n))\n",
      "v_opt = ((n*x*Lc)/((1-n)*((Lc*t+Tc))))**(n)\n",
      "print \"Cutting speed that will be lead to minimum cast = %0.2f m/min\"%v_opt"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cutting speed that will be lead to minimum cast = 27.42 m/min\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 27 on page no. 269"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that \n",
      "L = 300 # Length of the bar in mm\n",
      "d=30 # Diameter of the bar in mm\n",
      "f_max = 0.25 # Maximum allowable feed in mm/revolution\n",
      "Lc = .25 # Labour and overhead cast in $/min\n",
      "Tc = 2 # Regrinding cast in $\n",
      "t = 1 # Change time for tool in min\n",
      "C_X = 2.50 # Cast of tool of material X per piece in $ \n",
      "C_Y = 3 # Cast of tool of material Y  per piece in $\n",
      "n_x = 0.1 # Value of exponent of time in Taylor's tool life equation for material X\n",
      "n_y = 0.16 # Value of exponent of time in Taylor's tool life equation for material Y\n",
      "C_x = 30 # Value of constant in Taylor's tool life equation for material X\n",
      "C_y = 76 # Value of constant in Taylor's tool life equation For material Y\n",
      "\n",
      "x_x = (C_x)**(1/n_x) # Where x = k/(f**(1/n))\n",
      "v_opt_x = ((n_x*x_x*Lc)/((1-n_x)*((Lc*t+Tc))))**(n_x)\n",
      "Rmin_x = C_X+Lc*t+(Lc*pi*L*d/(1000*f_max*v_opt_x)) + (Lc*t*(pi*L*d/(1000*x_x)))*(v_opt_x**(1/n_y))*(v_opt_x**-1)*(f_max**-1)+(Tc*((pi*L*d/(1000*x_x)))*(v_opt_x**(1/n_x))*(v_opt_x**-1)*(f_max**-1))\n",
      "x_y = (C_y)**(1/n_y) # Where x = k/(f**(1/n))\n",
      "v_opt_y = ((n_y*x_y*Lc)/((1-n_y)*((Lc*t+Tc))))**(n_y)\n",
      "Rmin_y = C_Y+Lc*t+(Lc*pi*L*d/(1000*f_max*v_opt_y)) + (Lc*t*(pi*L*d/(1000*x_y)))*(v_opt_y**(1/n_y))*(v_opt_y**-1)*(f_max**-1)+(Tc*((pi*L*d/(1000*x_y)))*(v_opt_y**(1/n_y))*(v_opt_y**-1)*(f_max**-1))\n",
      "print \"The minimum cost per piece\\n When material X is used = %0.2f $,\\n When material Y is used = %0.2f $\"%(Rmin_x,Rmin_y)\n",
      "print \"So material Y will be suitable for tool as it has low cast\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum cost per piece\n",
        " When material X is used = 4.36 $,\n",
        " When material Y is used = 4.07 $\n",
        "So material Y will be suitable for tool as it has low cast\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 28 on page no. 271"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given that \n",
      "n = 0.25 # Value of exponent of time in Taylor's tool life equation\n",
      "C = 75 # Value of constant in Taylor's tool life equation\n",
      "Lc = .15 # Labour cast in $/min\n",
      "Tc = 2.50 # Total cast of tool in $\n",
      "t = 2 # Change time for tool in min\n",
      "x = (C)**(1/n) # Where x = k/(f**(1/n))\n",
      "v_opt = ((n*x)/((1-n)*t))**(n)\n",
      "print \"Optimum cutting speed for maximum production rate for the job = %0.2f m/min\"%(v_opt)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Optimum cutting speed for maximum production rate for the job = 47.92 m/min\n"
       ]
      }
     ],
     "prompt_number": 26
    }
   ],
   "metadata": {}
  }
 ]
}
