{
 "metadata": {
  "name": "",
  "signature": "sha256:56bbd90f35decd7f62fabe45fb918c0e397bbdcedfeeda130ab611b764281c1a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ch:5 Introduction to pressure vessels"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exa 5-1 - Page 138"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p=2#\n",
      "Rm=220#\n",
      "#tensile hoop or circumferential stress= sigt\n",
      "sigr=-2#\n",
      "#sigt=(p*Rm)/t#\n",
      "Sa=230/2#\n",
      "#t1=thickness according to maximum principal stress theory\n",
      "#t2=thickness according to maximum shear stress theory\n",
      "t1=(p*Rm)/Sa#\n",
      "t2=(p*Rm)/(Sa+sigr)#\n",
      "print \"t1 is %0.2f mm \"%(t1)#\n",
      "print \"\\nt2 is %0.3f mm \"%(t2)#"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "t1 is 3.00 mm \n",
        "\n",
        "t2 is 3.000 mm \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exa 5-2 - Page 139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "from __future__ import division\n",
      "#Elastic limit=sige\n",
      "sige=310#\n",
      "#inside diameter=di\n",
      "di=300#\n",
      "p=1.8#\n",
      "FOS=2#\n",
      "#design stress=sigd#\n",
      "sigd=sige/2#\n",
      "c=0.162#\n",
      "d=380#\n",
      "#cover plate thickness=t#\n",
      "t=d*sqrt(c*p/sigd)#\n",
      "t=17#\n",
      "M=di*p*t/4#\n",
      "\n",
      "z=(1/6)*1*t**2#\n",
      "#bending stress=sigb#\n",
      "sigb=M/z#\n",
      "print \"t is %0.1fmm \"%(t)#\n",
      "print \"\\nM is %0.1fmm \"%(M)#\n",
      "print \"\\nsigb is %0.1fmm \"%(sigb)#\n",
      "if (sigb<=sigd):\n",
      "    print 'sigb is below allowable sigd.'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "t is 17.0mm \n",
        "\n",
        "M is 2295.0mm \n",
        "\n",
        "sigb is 47.6mm \n",
        "sigb is below allowable sigd.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exa 5-3 - Page 140"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sige=220#\n",
      "v=0.29#\n",
      "Ri=175#\n",
      "FOS=3#\n",
      "Sa=sige/3#\n",
      "p=10#\n",
      "#t1=thickness according to maximum principal stress theory\n",
      "#t2=thickness according to maximum shear stress theory\n",
      "x=Sa+(p*(1-(2*v)))#\n",
      "y=Sa-(p*(1+v))#\n",
      "t1=(sqrt(x/y)-1)*Ri#\n",
      "t1=24#\n",
      "#t1=((sqrt((Sa+(p*(1-(2*v)))))/(Sa-(p*(1+v))))-1)*Ri#\n",
      "t2=Ri*((sqrt(Sa/(Sa-(2*p))))-1)#\n",
      "# printing data in scilab o/p window\n",
      "print \"t1 is %0.1fmm \"%(t1)#\n",
      "print \"\\nt2 is %0.3fmm \"%(t2)#\n",
      "#The answer to t2 is not calculated in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "t1 is 24.0mm \n",
        "\n",
        "t2 is 30.206mm \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exa 5-4 - Page 141"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p=16#\n",
      "Ri=250#\n",
      "#Yield strength =sigy#\n",
      "sigy=330#\n",
      "v=0.3#\n",
      "FOS=3#\n",
      "Sa=sigy/3#\n",
      "t=Ri*((sqrt(Sa/(Sa-(2*p))))-1)#\n",
      "t=50#\n",
      "\n",
      "print \"t is %0.1fmm \"%(t)#"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "t is 50.0mm \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exa 5-5 - Page 141"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import pi\n",
      "d=15#\n",
      "Eg=480#\n",
      "t=3#\n",
      "#flange thickness=ft#\n",
      "ft=12#\n",
      "A=pi*d**2/4#\n",
      "l=d+t+(ft/2)#\n",
      "E=210#\n",
      "kb=A*E/l#\n",
      "#effective area of gasket=Ag#\n",
      "Ag=pi*(((ft+t+d)**2)-(d**2))/4#\n",
      "kg=Ag*Eg/t#\n",
      "# printing data in scilab o/p window\n",
      "print \"kb is %0.3f N/mm \"%(kb)#\n",
      "kb=kb*10**-3#\n",
      "kg=kg*10**-3#\n",
      "if (kb<=kg):\n",
      "    print \"\\nThe combines stiffness of bolt and gasket is %0.3f kN/mm\"%(kg)\n",
      "\n",
      "\n",
      "#The difference in the value of kb is due to rounding-off the value of A \n",
      "   "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "kb is 1546.253 N/mm \n",
        "\n",
        "The combines stiffness of bolt and gasket is 84.823 kN/mm\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}