{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 2 : Fluid Statics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.1 Page no 44"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using the pascal's law a weight of 1000N can be lifted by applying a force only of  10.0 N\n"
     ]
    }
   ],
   "source": [
    "# Force applied on the piston\n",
    "\n",
    "from math import *\n",
    "\n",
    "# Given \n",
    "\n",
    "d = 10                        # diameter of hydraulic press in meters\n",
    "\n",
    "d1 = 1                       # diameter of piston in meters\n",
    "\n",
    "W = 1000                        # weight in Newtons\n",
    "\n",
    "Ap = math.pi*d1**2/4         # Area of piston in m**2\n",
    "\n",
    "Ar = math.pi*d**2/4        # Area of rram in m**2\n",
    "\n",
    "# Solution \n",
    "\n",
    "p = W/Ar                       # pressure to be supplied by the oil in N/cm**2\n",
    "\n",
    "F = p*Ap                       # Force applied on the piston\n",
    "\n",
    "print \"Using the pascal's law a weight of 1000N can be lifted by applying a force only of \",round(F,1),\"N\"\n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.2 Page no 53"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pressure =  10070.0 kN/m**2\n"
     ]
    }
   ],
   "source": [
    "# Pressure in kN/m**2\n",
    "\n",
    "# Given\n",
    "\n",
    "h = 1                           # ocean depth below the surface in km\n",
    "\n",
    "gma = 10070                     # Specific weight of sea water\n",
    "\n",
    "# Solution\n",
    "\n",
    "P =gma*h                        # Pressure in kN/m**2\n",
    "\n",
    "print \"Pressure = \",round(P),\"kN/m**2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.3 Page no 53"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pressure at the bottom of the tank is 176.3 kN/m**3"
     ]
    }
   ],
   "source": [
    "# Pressure at the bottom of the tank\n",
    "\n",
    "# Given\n",
    "\n",
    "p1 = 150*10**3                  # Pressure at point 1 in kN/m**2\n",
    "\n",
    "Sg = 0.85                       # Specific gravity of oil\n",
    "\n",
    "h = 0.8                         # height of oil 2 i tank in meters \n",
    "\n",
    "g = 9810                        # specific gravity \n",
    "\n",
    "h1 = 2.0                        # height of oil 3 in tank\n",
    "\n",
    "# Solution \n",
    "\n",
    "p2 = (p1 + Sg*h*g)\n",
    "\n",
    "p3 = (p2 + g*h1)/1000\n",
    "\n",
    "print \"Pressure at the bottom of the tank is\",round(p3,1),\"kN/m**3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.4 Page no 54"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Height of the mountain is 2208.0 m\n"
     ]
    }
   ],
   "source": [
    "# Height of the mountain\n",
    "\n",
    "# Given\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "Po = 570                         #  mercury barometer reading in mm\n",
    "\n",
    "T = 273 -5                       # temperature in K\n",
    "\n",
    "p = 750                          # mercury barometer reading in mm\n",
    "\n",
    "n = 1.2345                       # for polytropic atmosphere\n",
    "\n",
    "R  =287                          # univerasl gas constant in J/Kg-K\n",
    "\n",
    "g = 9.81 \n",
    "\n",
    "r = p/Po\n",
    "\n",
    "# Solution\n",
    "\n",
    "y = -(R*T/(g*0.19))*(1 - (r)**((n-1)/n))\n",
    "\n",
    "print \"Height of the mountain is\",round(y,0),\"m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.5 Page no 57"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pressure in the pipe =  9.074 kPa\n"
     ]
    }
   ],
   "source": [
    "# Pressure in the pipe\n",
    "\n",
    "# Given\n",
    "\n",
    "h1 = 500           # height in mm\n",
    "\n",
    "h2 = 950           # height in mm\n",
    "\n",
    "S1 = 1             # specific gravity fo water\n",
    "\n",
    "S2 = 1.5           # specific gravity of liquid 2\n",
    "\n",
    "w = 9810           # specific weight of water\n",
    "\n",
    "# Solution\n",
    "\n",
    "ha = ((h2*S2)-(h1*S1))/1000\n",
    "\n",
    "Pa = w*ha/1000     # Pressure in kPa\n",
    "\n",
    "print \"Pressure in the pipe = \",round(Pa,3),\"kPa\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.6 Page no 66"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Magnitude of the force required to open the gate =  21659.0 N\n"
     ]
    }
   ],
   "source": [
    "# Force required to open the gate\n",
    "\n",
    "# Given\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "from math import *\n",
    "\n",
    "d = 1                  # diameter of the gate in m\n",
    "\n",
    "w = 9810               # specific weight in N/m**3\n",
    "\n",
    "A = pi*d**2/4          # area of the gate\n",
    "\n",
    "Ig = pi*d**4/64        # mamm moment of inertia\n",
    "\n",
    "theta = pi/2\n",
    "\n",
    "y1= 5+0.5\n",
    "\n",
    "# Solution\n",
    "\n",
    "F = w*round(A,3)*(y1) # the answer will come out to be different as they have used the value of Area as 0.78 \n",
    "\n",
    "# depth of the COP\n",
    "\n",
    "h1 = y1 + (Ig*math.sin(theta)*math.sin(theta)/(A*y1))\n",
    "\n",
    "# moment about hinge A\n",
    "\n",
    "F1 = (F*(h1 - 5))/d\n",
    "\n",
    "print \"Magnitude of the force required to open the gate = \",round(F1,0),\"N\" \n",
    "#The area calculated in the book is 0.785 and that calculated from code is 0.78. \n",
    "#This difference of 0.005 is causing the answer to change from the original\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.7 Page no 67"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Total force =  31.71 kN\n",
      "(b) Position of center of pressure =  1.616 m\n"
     ]
    }
   ],
   "source": [
    "# total force ; position of the center of pressure  \n",
    "\n",
    "from math import *\n",
    "\n",
    "# Given\n",
    "\n",
    "l =2             # length of the plate in m\n",
    "\n",
    "b =1             # width of the plate\n",
    "\n",
    "theta = pi/3\n",
    "\n",
    "h = 0.75         # depth of the plate\n",
    "\n",
    "w = 9810         # specific weight of water\n",
    "\n",
    "# Solution\n",
    "\n",
    "A = 1*2\n",
    "\n",
    "y1 = h + 1*sin(theta)\n",
    "\n",
    "F = w*A*y1/1000\n",
    "\n",
    "print \"(a) Total force = \",round(F,2),\"kN\"\n",
    "\n",
    "Ig = (b*l**3)/12\n",
    "\n",
    "h1 = y1 + (Ig*sin(theta)*sin(theta)/(2*y1))\n",
    "\n",
    "print \"(b) Position of center of pressure = \",round(h1,3),\"m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.8 Page no 68"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total hydrostatic force = 40783.0 lbs\n",
      "point of location on the center plate =  13.52 ft\n",
      " OR point of location on the center plate from method 2 =  13.5 ft\n"
     ]
    }
   ],
   "source": [
    "# Hydrostatic force  and point of location \n",
    "\n",
    "from math import *\n",
    "\n",
    "# Given\n",
    "\n",
    "d = 6                   # diameter of the gate in ft\n",
    "\n",
    "A =pi*d**2/4            # area of the gate\n",
    "\n",
    "p1 = 600                # pressure on top in psia\n",
    "\n",
    "y1 = 10 +2 + 3*sin(pi/6)\n",
    "\n",
    "F = 62.4*A*y1\n",
    "\n",
    "F1 = p1*A\n",
    "\n",
    "# Solution\n",
    "\n",
    "Tf = F+F1\n",
    "\n",
    "print \"Total hydrostatic force =\",round(Tf,0),\"lbs\"\n",
    "\n",
    "Ig = pi*d**4/64\n",
    "\n",
    "h1 = y1 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y1))\n",
    "\n",
    "H = ((F*h1)+(F1*y1))/Tf\n",
    "\n",
    "print \"point of location on the center plate = \",round(H,2),\"ft\"\n",
    "\n",
    "# method 2\n",
    "\n",
    "Hf = p1/62.4            # equivalent fluid height\n",
    "\n",
    "y2 = Hf+y1\n",
    "\n",
    "Tf1 = 62.4*A*y2\n",
    "\n",
    "h2 = y2 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y2))\n",
    "\n",
    "H1 = y2-Hf\n",
    "\n",
    "print \" OR point of location on the center plate from method 2 = \",round(H1,2),\"ft\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.10 Page no 74"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Horizontal component acting on the plate =  998.4 lbs\n",
      "Vertical component acting on the plate =  1283.34 lbs\n",
      "location of Xv = 1.82 ft\n"
     ]
    }
   ],
   "source": [
    "# Horizontal and Vertical components\n",
    "\n",
    "import math\n",
    "\n",
    "# Given\n",
    "\n",
    "R = 4                 # radius of the gate in ft\n",
    "\n",
    "w = 1                # width of the gate in ft\n",
    "\n",
    "gma =62.4            # specific weight of water\n",
    "\n",
    "y1 = 4               # distance of center of the gate\n",
    "\n",
    "xv1 = 2              # distance in ft\n",
    "\n",
    "xv2 = 1.7           # distance in ft\n",
    "\n",
    "# Solution \n",
    "\n",
    "Fh = R*y1*gma\n",
    "\n",
    "Ig = w*R**3/12\n",
    "\n",
    "yh = y1 + (Ig/(R*y1))\n",
    "\n",
    "Fv1 = R*2*gma\n",
    "\n",
    "Fv2 = pi*R**2*gma/4\n",
    "\n",
    "Fv = Fv1 + Fv2\n",
    "\n",
    "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n",
    "\n",
    "print \"Horizontal component acting on the plate = \",round(Fh,2),\"lbs\"\n",
    "\n",
    "print \"Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n",
    "\n",
    "print \"location of Xv =\",round(Xv,2),\"ft\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.11 Page no 77"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Horizontal component acting on the plate =  29923.0 lbs\n",
      "(b) Vertical component acting on the plate =  30208.14 lbs\n",
      "location of vertical component Xv = 1.99 ft from the left wall\n"
     ]
    }
   ],
   "source": [
    "# Vertical and Horizontal components\n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "# Given\n",
    "\n",
    "p = 50                         # pressure in psia\n",
    "\n",
    "gma = 62.4                     # specific weight in ft\n",
    "\n",
    "h1 = p*144/gma                 # equivalent height of water surface in ft\n",
    "\n",
    "R = 4                          # radius of gate in ft\n",
    "\n",
    "w = 1                          # width of the gate in ft\n",
    "\n",
    "A = R*w\n",
    "\n",
    "y1 = h1 + 2.5 + 2              # center of pressure\n",
    "\n",
    "xv1 = 2                        # center of pressure1 for x direction force\n",
    "\n",
    "xv2 = 1.7                      # center of pressure2 for x direction force\n",
    "\n",
    "# Solution\n",
    "\n",
    "Fh = gma*A*y1                 # hiorizontal force\n",
    "\n",
    "Ig = 5.33                      # moment of inertia\n",
    "\n",
    "yh = y1 + (Ig/(A*y1))          # location of horizontal component\n",
    "\n",
    "y2 = h1+2.5\n",
    "\n",
    "Fv1 = gma*(R*y2)               # vertical force component 1\n",
    "\n",
    "Fv2 = gma*(pi*R**2/4)               # vrtical force component 2\n",
    "\n",
    "Fv = Fv1 + Fv2                # vertical force component\n",
    "\n",
    "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n",
    "\n",
    "print \"(a) Horizontal component acting on the plate = \",round(Fh,0),\"lbs\" # The answer for horizontal force in the book is wrong\n",
    "\n",
    "print \"(b) Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n",
    "\n",
    "print \"location of vertical component Xv =\",round(Xv,2),\"ft from the left wall\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.13 Page no 84"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Depth to which water would rise =  0.25 m\n"
     ]
    }
   ],
   "source": [
    "# Depth to which water would rise\n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "# Given\n",
    "\n",
    "l = 3                    # length in m\n",
    "\n",
    "b = 4                    # breadth in m\n",
    "\n",
    "h = 15                    # height in m\n",
    "\n",
    "S = 0.9                 # specific gravity of barge\n",
    "\n",
    "Sw  = 1.09              # specific gravity of water\n",
    "\n",
    "Wd = 150*10**3          # addditional weight in kN\n",
    "\n",
    "V = l*b*h               # volume in m**3\n",
    "\n",
    "Wb = gma*S*V          # weight of barge\n",
    "\n",
    "Tw = Wb + Wd            # total weight in kN\n",
    "\n",
    "gma = 9810              # specific density \n",
    "\n",
    "# Solution\n",
    "\n",
    "Fb = Tw                 # since barge is floating\n",
    "\n",
    "V1 = Fb/((gma/1000)*Sw)    #  volume in m**3\n",
    "\n",
    "\n",
    "d = (V1/(h*b))/1000\n",
    "\n",
    "print \"Depth to which water would rise = \",round(d,2),\"m\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.14 Page no 85 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X =  3.12 cm\n",
      "Y =  3.25 cm\n",
      "The bottom of the solid cylinder will be  4.88 cm above the bottom\n"
     ]
    }
   ],
   "source": [
    "# Level at which cylinder will float\n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "# Given\n",
    "\n",
    "W = 0.4 * 9.81              # weight of the solid cylinder in N\n",
    "\n",
    "# Solution\n",
    "\n",
    "A = np.array([(1,-0.96),(1,1)])\n",
    "\n",
    "b = np.array([0,6.37])\n",
    "\n",
    "x = np.linalg.solve(A,b)\n",
    "\n",
    "X = x[0]\n",
    "\n",
    "Y = x[1]\n",
    "\n",
    "print \"X = \",round(X,2),\"cm\"\n",
    "\n",
    "print \"Y = \",round(Y,2),\"cm\"\n",
    "\n",
    "b = 8 -x[0]\n",
    "\n",
    "print \"The bottom of the solid cylinder will be \",round(b,2),\"cm above the bottom\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.15 Page no 86"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Weight of the pan = 37.7 N\n",
      "Magnitude of right momentum =  123.4 N.cm\n"
     ]
    }
   ],
   "source": [
    "# Weight of the pan and the magnitude of righting moment\n",
    "\n",
    "from math import *\n",
    "\n",
    "# Given\n",
    "\n",
    "l =100                # length of the pan in cm\n",
    "\n",
    "w = 20                # width of the pan in cm\n",
    "\n",
    "d = 4                 # depth of the pan in cm\n",
    "\n",
    "L = 1.5               # load in N/m\n",
    "\n",
    "gma = 9810              # sepcific weight\n",
    "\n",
    "# Solution\n",
    "\n",
    "Fb = gma*(d*w*l/(2*l**3)) # weight on the pan\n",
    "\n",
    "W = Fb-L                # weight of the pan\n",
    "\n",
    "X1 = w/3\n",
    "\n",
    "X2 = w/2\n",
    "\n",
    "theta = math.atan(d/w)*180/pi\n",
    "\n",
    "x = ((X2-X1)*cos(theta*pi/180))\n",
    "\n",
    "# momentum equation \n",
    "\n",
    "M = W*x\n",
    "\n",
    "print \"Weight of the pan =\",round(W,1),\"N\"\n",
    "print \"Magnitude of right momentum = \",round(M,1),\"N.cm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example no 2.16 Page no 90"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Metacentric height =  0.347 m\n",
      "(b) Righting moment = 63.1 kN.m\n"
     ]
    }
   ],
   "source": [
    "# Metacentric height and rightning moment \n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "# Continued from example 2.15\n",
    "\n",
    "# Given\n",
    "\n",
    "Io = 15*4**3/12                     # moment of inertia in m**4\n",
    "\n",
    "V = 15*4*2.71                       # Volume in m**3\n",
    "\n",
    "Gb = ((3/2)-(2.71/2))          \n",
    "\n",
    "W = 1739.2                          # weight of the barge from the previous example in kN\n",
    "# Solution\n",
    "\n",
    "Mg = (Io/V)-Gb                     # metacentric height in m\n",
    "\n",
    "print \"(a) Metacentric height = \", round(Mg,3),\"m\"\n",
    "\n",
    "M = W*Mg*sin(pi*6/180)\n",
    "\n",
    "print \"(b) Righting moment =\",round(M,1),\"kN.m\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example no 2.17 Page no 92"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Amximum pressure occurs at the bottom of the tank = 24768.9 N\n"
     ]
    }
   ],
   "source": [
    "# Maximum pressure in the tank\n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "# Given\n",
    "\n",
    "l=6                  # length of the tank\n",
    "\n",
    "w =2                 # width of the tank\n",
    "\n",
    "d = 3                # depth of the tank\n",
    "\n",
    "a = 3                # acceleration in m/s**2\n",
    "\n",
    "theta = pi/6\n",
    "\n",
    "W = 9810            # specific weight\n",
    "\n",
    "X = 0\n",
    "\n",
    "po=0               # pressure at the origin\n",
    "\n",
    "# Solution\n",
    "\n",
    "A = np.array([(1,-1),(1,1)])\n",
    "\n",
    "b = np.array([-1.38,3.0])\n",
    "\n",
    "x = np.linalg.solve(A,b)\n",
    "\n",
    "Y1 = x[0]\n",
    "\n",
    "Y2 = x[1]\n",
    "\n",
    "# AMximum pressure at the bottom of the tank\n",
    "\n",
    "P = po - W*(2.61*X/9.81) - W*(1+(1.5/9.81))*(-Y2)\n",
    "\n",
    "print\"Amximum pressure occurs at the bottom of the tank =\",round(P,3),\"N\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 2.18 Page no 98"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Height of paraboliod revolution of base =  1.48 ft\n",
      "(b) Maximum pressure corresponding to maximum height =  92.3 lbs/ft**2\n",
      "(c) Pressure = 26.4 lbs/ft**2\n"
     ]
    }
   ],
   "source": [
    "# Height of the paraboloid revolution; maxm=imum pressure and location ; pressure at the point 0.2 from the center\n",
    "\n",
    "from math import *\n",
    "\n",
    "from __future__ import division\n",
    "\n",
    "# Given\n",
    "\n",
    "d = 1                          # diamter of the jar in ft\n",
    "\n",
    "h =2                           # height of the jar in ft\n",
    "\n",
    "H = 1                          # height of water in the jar in ft\n",
    "\n",
    "N = 150                        # RPM\n",
    "\n",
    "g = 32.2                       # acceleration due to gravity in ft/s**2\n",
    "\n",
    "# Solution\n",
    "\n",
    "w = 2*pi*N/60\n",
    "\n",
    "ho = H+((w**2*(d/2)**2)/(4*g))\n",
    "print \"(a) Height of paraboliod revolution of base = \", round(ho,2),\"ft\"\n",
    "\n",
    "Pmax = 62.4*ho\n",
    "\n",
    "print \"(b) Maximum pressure corresponding to maximum height = \",round(Pmax,1),\"lbs/ft**2\"\n",
    "\n",
    "z = H - ((w**2*(d/2)**2)/(4*g))\n",
    "\n",
    "r = 0.2                # distance from center\n",
    "\n",
    "y = -(0.52-0.25)\n",
    "\n",
    "P = po + (62.4*w**2*r**2/(2*g))-(62.4*y)\n",
    "\n",
    "print \"(c) Pressure =\",round(P,1),\"lbs/ft**2\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "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.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}