summaryrefslogtreecommitdiff
path: root/Problems_In_Hydraulics/ch2.ipynb
blob: d68673ef6c24b1cf650214a99c843a6353e70bfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{
 "metadata": {
  "name": "",
  "signature": "sha256:2c442a1cbc28b933d555165b6cb09fa7f45de31e28c837593e3048f115cafdbb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : Equilibrium of Floating Bodies"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1 Page No : 26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "d= 40.   \t#lb/ft**2 density of wood\n",
      "w= 4     \t#ft  wide\n",
      "h= 6     \t#ft  deep\n",
      "l= 12    \t#ft  long \n",
      "\n",
      "#CALCULATIONS\n",
      "W= w*h*d*l\n",
      "V= W/64\n",
      "D= V/(w*l)\n",
      "\n",
      "#RESULTS\n",
      "print  'Volume of water print laced = %.f ft**3'%(V)\n",
      "print  ' Depth of immersion = %.2f ft'%(D)\n",
      "print  ' Centre of buoyancy = %.2f ft from base'%(D)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Volume of water print laced = 180 ft**3\n",
        " Depth of immersion = 3.75 ft\n",
        " Centre of buoyancy = 3.75 ft from base\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 Page No : 28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy import Symbol,solve\n",
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "d= 4.    \t#ft diameter\n",
      "h= 7.    \t#ft high\n",
      "W= 2500. \t#lb weighing \n",
      "OG= 3.5\n",
      "OB= 1.55 \t#ft\n",
      "\n",
      "#CALCULATIONS\n",
      "V= W/d**3\n",
      "D= V/(math.pi*(d/2)**2)\n",
      "I= math.pi*d**4/64\n",
      "BM= I/V\n",
      "BG= OG-OB\n",
      "T = Symbol(\"T\")\n",
      "ans = solve( (2500 + T)**2 -(512*math.pi *(8750 - 804)) - 1)\n",
      "T = ans[1]\n",
      "\n",
      "#RESULTS\n",
      "print  'Minimum tension in chain = %d lb'%(T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum tension in chain = 1075 lb\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4 Page No : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "W1= 1000. \t#lb weighing\n",
      "W2= 100. \t#lb load\n",
      "h= 4. \t#ft height\n",
      "d= 5. \t#ft  diameter\n",
      "\n",
      "#CALCULATIONS\n",
      "V= (W1+W2)/h**3\n",
      "D= V*h/(d**2*math.pi)\n",
      "I= d**4*math.pi/h**3\n",
      "BM= I/V\n",
      "x= (BM+(D/2)-(W1*(h/2)/(W1+W2)))/(W2/(W1+W2))-0.02\n",
      "C= x-h\n",
      "\n",
      "#RESULTS\n",
      "print  'centre of gravity = %.2f ft'%(x)\n",
      "print  ' Hence the gravity of the weight must not be more than above the top of buoy = %.2f ft'%(C)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "centre of gravity = 4.43 ft\n",
        " Hence the gravity of the weight must not be more than above the top of buoy = 0.43 ft\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5 Page No : 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "b= 12. \t#ft  breadth\n",
      "h1= 3. \t#ft  draught\n",
      "h2= 1.5 \t#ft\n",
      "h3= 5+(2./3) \t#ft\n",
      "\n",
      "#CALCULATIONS\n",
      "I= b**3/12\n",
      "V= b*h1\n",
      "bm= I/V\n",
      "BG= bm+(h1*2/(3*b))\n",
      "O= math.degrees(math.tan(math.sqrt((h3*2-h1-bm*2)/(bm*2+bm))))\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print  ' Volume of body immersed = %.f ft**3'%(V)\n",
      "print  ' BM = %.f ft'%(bm)\n",
      "print  ' BG = %.2f ft'%(BG)\n",
      "print  ' angle of heel = %.2f degrees'%(O)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Volume of body immersed = 36 ft**3\n",
        " BM = 4 ft\n",
        " BG = 4.17 ft\n",
        " angle of heel = 9.64 degrees\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}