summaryrefslogtreecommitdiff
path: root/Mechanics_of_Materials_by_R._C._Hibbeler/Chapter11.ipynb
blob: fc68b993c2c390638f06b61f945599ad0350adff (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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11:Design of Beams and Shafts"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.1 Page No 544"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "sigma_allow = 24    #ksi, stress\n",
      "tou_allow = 14.5      #ksi, allowable stress\n",
      "\n",
      "#Shear and Moment Diagrams\n",
      "V_max = 30         #kip, \n",
      "M_max = 120         #kip, bending moment\n",
      "\n",
      "#Bending Stress\n",
      "S_reqd = (M_max*(10**3))/sigma_allow\n",
      "#Shear Stress\n",
      "d = 17.9   #in\n",
      "tw = 0.315  #inch\n",
      "tou_avg = (V_max)/(d*tw)\n",
      "\n",
      "if tou_avg<14.5:\n",
      "    print\"Use a W18*14\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Use a W18*14\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.2 Page No 545"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "udl = 0.5         #kN/m\n",
      "h_by_a = 1.5      \n",
      "sigma_allow = 9 #MPa, allowable bending stress\n",
      "tou_allow = 0.6 #MPa, allowable shear stress\n",
      "\n",
      "#calculation\n",
      "#Shear and Moment Diagrams\n",
      "import math\n",
      "V_max =20         #kNm\n",
      "M_max =10.67       #kNm\n",
      "#Bending Stress\n",
      "S_reqd = (M_max)/(sigma_allow*1000)\n",
      "c = h_by_a/2.0\n",
      "a_cube = (S_reqd*c*12)/(1.5**3) #S_reqd = I/c\n",
      "a = a_cube**(1/3.0)\n",
      "A = a*h_by_a*a\n",
      "tou_max = (1.5*V_max)/(A*1000)\n",
      "if tou_max>tou_allow:\n",
      "    a_sqr = (3/2.0)*(V_max)/(h_by_a*tou_allow*1000)\n",
      "    a =math.sqrt(a_sqr)\n",
      "else:\n",
      "    print\"not\"\n",
      "\n",
      "#Display\n",
      "print\"The smallest width for the laminated wooden beam = \", round(a,2),\"m\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The smallest width for the laminated wooden beam =  0.18 m\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.3 Page No 546"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "l = 200/1000.0       #m, length\n",
      "t = 30/1000.0        #m\n",
      "sigma_allow = 9     #MPa, shear stress\n",
      "tou_allow = 0.6      #MPa, bending stress\n",
      "V_nail = 1.50        #kN\n",
      "l_bc = 2             #m\n",
      "l_cd = 2            #m\n",
      "\n",
      "#Shear and Moment Diagrams\n",
      "V_max = 20        #kN\n",
      "M_max =10.67         #kNm\n",
      "#Bending Stress\n",
      "y1 = l/2.0\n",
      "A1 = l*t\n",
      "y2 = l+(t/2.0)\n",
      "A2 = t*l\n",
      "y_dash = (y1*A1 + y2*A2)/(A1 + A2)\n",
      "\n",
      "I1 = (t*l**3)/12.0 + (t*l*(y_dash - y1)**2)\n",
      "I2 = (l*t**3)/12.0 + (t*l*(y2 - y_dash)**2)\n",
      "I =I1 + I2\n",
      "\n",
      "c = y_dash\n",
      "sigma = (M_max*c)/(I)\n",
      "flag1 = 0\n",
      "sigma_allow = sigma_allow*1000 #kPa\n",
      "\n",
      "if(sigma<sigma_allow):\n",
      "    flag1 = 1\n",
      "else:\n",
      "    print\"otherwisw not\"\n",
      "\n",
      "#Shear Stress\n",
      "y3 = y_dash/2.0\n",
      "A3 = y_dash*t\n",
      "Q = y3*A3\n",
      "\n",
      "tou = (V_max*Q)/(I*t)\n",
      "tou_allow = tou_allow*1000 #kPa\n",
      "flag2 =0\n",
      "\n",
      "if(tou<tou_allow):\n",
      "    flag2 = 1\n",
      "else:\n",
      "    print\"flag2 is not equal to one\"\n",
      "\n",
      "#Nail Spacing\n",
      "y4a = (l+t-y_dash)\n",
      "y4 = y4a - (t/2.0)\n",
      "A4 = l*t\n",
      "Q4 = y4*A4\n",
      "V_bc = 1.5 #kN\n",
      "V_cd = 1 #kN\n",
      "\n",
      "q_bc = (V_bc*Q4)/I\n",
      "q_cd = (V_cd*Q4)/I\n",
      "\n",
      "s_bc = (V_nail)/(q_bc)\n",
      "s_cd = (V_nail)/(q_cd)\n",
      "\n",
      "chosen_bc = 150 #mm\n",
      "chosen_cd = 250 #mm\n",
      "\n",
      "#Result\n",
      "print'The design is safe in bending and shear.'\n",
      "print'The calculated nail spacing BC ',round(s_bc,2),\"m\"\n",
      "print'The calculated nail spacing CD ',round(s_cd,2),\"m\"\n",
      "print'The chosen nail spacing BC     ',chosen_bc,\"mm\"\n",
      "print'The chosen nail spacing CD     ',chosen_cd,\"mm\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "otherwisw not\n",
        "flag2 is not equal to one\n",
        "The design is safe in bending and shear.\n",
        "The calculated nail spacing BC  0.17 m\n",
        "The calculated nail spacing CD  0.26 m\n",
        "The chosen nail spacing BC      150 mm\n",
        "The chosen nail spacing CD      250 mm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.6 Page No 560"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find smallest allowable diameter\n",
      "\n",
      "#Given\n",
      "tou_allow = 50*10**6 #MPa, shear stress\n",
      "T = 7.5              #Nm, torque\n",
      "R_ah = 150           #N, horizontal force\n",
      "R_av = 475           #N\n",
      "l_ac = 0.25          #m\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "mc = R_ah*l_ac\n",
      "m = R_av*l_ac\n",
      "M_c = sqrt(m**2 + mc**2)\n",
      "k = sqrt(M_c**2 + T**2)\n",
      "c1 = (2*k)/(math.pi*tou_allow)\n",
      "c = c1**(1/3.0)\n",
      "d = 2*c*1000\n",
      "\n",
      "#Display\n",
      "print\"The smallest allowable diameter of the shaft =\",round(d,1),\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The smallest allowable diameter of the shaft = 23.3 mm\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}