{
 "metadata": {
  "name": "",
  "signature": "sha256:1d76b1008117b9259d7e6a17a81353d60bd8490c5f9100521ab22a813e31d7f5"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter1-What Is Mechanical Design"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-1.2   Page 13 ')   \n",
      "##Example 1.2\n",
      "\n",
      "Sy=61000.                   ##[psi] Tensile strength of AISI 1020 cold drawn steel from Appendix 4 Page no 470\n",
      "SF=2.;                      ##[] safety factor\n",
      "F=300.;                     ##[lb] Weight of the ball\n",
      "L=36.;                      ##[in] Length of round bar\n",
      "Sy=61000.;                  ##[psi] Tensile strength from Appendix 4\n",
      "M=F*L;                     ##[in*lb] Bending moment Appendix 2\n",
      "\n",
      "Sall=Sy/SF;                ##[psi] Allowable stress \n",
      "Z=M/Sall;                  ##[in^3] Section modulus for bending Sall=M/Z\n",
      "D=(32.*Z/math.pi)**(1./3.);        ##[in] Diameter of bar\n",
      "\n",
      "##Use 13/8 in bar\n",
      "D1=1.625;\n",
      "\n",
      "print'%s %.2f %s '%('\\n\\n Diameter of Bar is ',D1,' in');\n",
      "\n",
      "##Checking Deflection\n",
      "I=math.pi*D1**4/64.;              ##[in^4] Moment of inertia Appendix 3\n",
      "E=30.*10**6.;                  ##[lb/in^2] Modulus of elasticity\n",
      "Delta=F*L**3./(3.*E*I);        ##[in] Deflection \n",
      "\n",
      "##Note- In the book I=0.342 in^4 is used instead of I=0.3422814 in^4\n",
      "\n",
      "print'%s %.2f %s '%('\\n The deflection of bar is',Delta,' in');\n",
      "\n",
      "\n",
      "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "MACHINE DESIGN \n",
        " Timothy H. Wentzell, P.E. \n",
        " EXAMPLE-1.2   Page 13 \n",
        "\n",
        "\n",
        " Diameter of Bar is  1.62  in \n",
        "\n",
        " The deflection of bar is 0.45  in \n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}