summaryrefslogtreecommitdiff
path: root/Mechanics_of_Materials_by_Pytel_and_Kiusalaas/Chapter03_2.ipynb
blob: 83b15053c6a07d5d6ae0bd0b72cdf55293089b0f (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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
{
 "metadata": {
  "name": "",
  "signature": "sha256:e94e252902947538e327888c054726e4c87fafcbcff4841a5585391ce610b765"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Chapter 03:Torsion"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.1, Page No:79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "P=20*10**3 #Power in W\n",
      "f=2 #Frequency in Hz\n",
      "t_max=40*10**6 #Maximum shear stress in Pa\n",
      "G=83*10**9 #Bulk modulus in Pa\n",
      "theta=(6*pi)/180 #Angle of twist in radians\n",
      "L=3 #Length in m\n",
      "\n",
      "#Calculations\n",
      "#Strength condition\n",
      "T=P/(2*pi*f) #Torque in N.m\n",
      "d1=((16*T)/(pi*t_max))**0.333 #Max allowable diameter in mm\n",
      "\n",
      "#Applying torque-twist relationship\n",
      "d2=((32*T*L)/(G*theta*pi))**0.25 #Diameter in mm\n",
      "\n",
      "d=max(d1,d2)\n",
      "\n",
      "print \"To satisfy both strength and rigidity conditions d=\",round(d*1000,1),\"mm\"\n",
      "\n",
      "#NOTE:The fractional power leads to the discrepancy in the answer\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "To satisfy both strength and rigidity conditions d= 58.9 mm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.2, Page No:79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "Ga=4*10**6 #Bulk modulus of Aluminium in psi\n",
      "Gs=12*10**6 #Bulk Modulus of Steel in psi\n",
      "T=10**4 #Torque in lb.in\n",
      "L1=3 #Length in ft of the Steel bar\n",
      "L2=6 #Length in ft of the Aluminium bar\n",
      "d1=3 #Diameter of the Aluminium bar in inches\n",
      "d2=2 #Diameter of the Steel bar in inches\n",
      "\n",
      "#Calculations\n",
      "#Using Compatibility and equlibrium conditions\n",
      "a=np.array([[1,1],[(L1*32)/(Gs*pi*d2**4),-((L2*32)/(Ga*d1**4*pi))]])\n",
      "b=np.array([T,0])\n",
      "y=np.linalg.solve(a,b)\n",
      "\n",
      "#Stresses\n",
      "t_max_st=(16*y[0])/(pi*d2**3) #Max shear Stress in Steel in psi\n",
      "t_max_al=(16*y[1])/(pi*d1**3) #Max shear stress in aluminium in psi\n",
      "\n",
      "print \"The maximum values of Shear Stresses are as flollows\"\n",
      "print round(t_max_st),\"psi in Steel and \",round(t_max_al),\"psi in Aluminium\"\n",
      "#NOTE:The shear stress for steel in the txtbook is off by 3psi"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum values of Shear Stresses are as flollows\n",
        "3453.0 psi in Steel and  863.0 psi in Aluminium\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.3, Page No:80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "d=2 #Diameter in ft\n",
      "G=12*10**6 #Bulk Modulus in psi\n",
      "#Torque in lb.ft\n",
      "T1=500 #Torque 1 \n",
      "T2=900 #Torque 2\n",
      "T3=1000 #Torque 3\n",
      "#Length in ft\n",
      "L1=4 \n",
      "L2=3\n",
      "L3=5\n",
      "\n",
      "#Calculations\n",
      "#Applying the sum of torques we get\n",
      "Tab=T1 #Torque at section AB in lb.ft\n",
      "Tbc=-T2+T1 #Torque at section BC in lb.ft\n",
      "Tcd=T3-T2+T1 #Torque at Section CD in lb.ft\n",
      "\n",
      "#Summing the angle of twists\n",
      "theta_r=(((Tab*12*L3*12)+(Tbc*12*L2*12)+(Tcd*12*L1*12))*32)/(pi*2**4*G)\n",
      "theta=(theta_r*180)/pi #Angle in degrees\n",
      "\n",
      "print \"The angle of twist is\",round(theta,3),\"degrees\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angle of twist is 1.62 degrees\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.4, Page No:81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "L=1.5 #Length of the shaft in m\n",
      "t_B=200 #Torque per unit length in N.m/m\n",
      "d=0.025 #Diameter of the shaft in m\n",
      "G=80*10**9 #Bulk Modulus for steel in Pa\n",
      "\n",
      "\n",
      "#Calculations\n",
      "#Part(1)\n",
      "#After carrying out the variable integration\n",
      "T_A=0.5*t_B*L #Torque about point A in N.m\n",
      "#Using equation of max stress\n",
      "tau_Max=(16*T_A)*(pi*d**3)**-1 #Maximum stress in the shaft in Pa\n",
      "\n",
      "#Part(2)\n",
      "J=(pi*d**4)*32**-1 #Polar moment of inertia in m^4\n",
      "#After carrying out the computation for angle of twist we get\n",
      "theta_r=(t_B*L**2)*(3*G*J)**-1 #Angle of twist in radians\n",
      "theta=theta_r*(180*pi**-1) #Angle of twist in degrees\n",
      "\n",
      "#Result\n",
      "print \"Result for part (1)\"\n",
      "print \"Maximum Shear Stress in the shaft is\",round(tau_Max/10**6,1),\"MPa\"\n",
      "print \"Result for part (2)\"\n",
      "print \"The angle of twist in the shaft is\",round(theta,2),\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Result for part (1)\n",
        "Maximum Shear Stress in the shaft is 48.9 MPa\n",
        "Result for part (2)\n",
        "The angle of twist in the shaft is 2.8 degrees\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.5, Page No:91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "L=6 #Length of the tube in ft\n",
      "t=3*8**-1 #Constant wall thickness in inches\n",
      "G=12*10**6 #Bulk modulus of the tube in psi\n",
      "w1=6 #Width on the top in inches\n",
      "w2=4 #Width at the bottom in inches\n",
      "h=5 #Height in inches\n",
      "theta=0.5 #Angle of twist in radians\n",
      "\n",
      "#Calculations\n",
      "#Part(1)\n",
      "Ao=(w1+w2)*2**-1*h #Area enclosed by the median line in sq.in\n",
      "S=w1+w2+2*(sqrt(1**2+h**2)) #Length of the median line in inches\n",
      "#Using the torsional stifness formula we get\n",
      "k=4*G*Ao**2*t*(L*12*S)**-1*(pi*180**-1) #tortional Stiffness  in lb.in/rad\n",
      "\n",
      "#Part(2)\n",
      "T=k*theta #Torque required to produce an angle of twist of theta in lb.in\n",
      "q=T*(2*Ao)**-1 #Shear flow in lb/in\n",
      "tau=q/t #Shear stress in the wall in psi\n",
      "\n",
      "\n",
      "#Result \n",
      "print \"Part(1) results\"\n",
      "print \"Torsional stiffness is\",round(k),\"lb.in/deg\"\n",
      "print \"Part(2) results\"\n",
      "print \"The shear stress in the wall is\", round(tau),\"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part(1) results\n",
        "Torsional stiffness is 135017.0 lb.in/deg\n",
        "Part(2) results\n",
        "The shear stress in the wall is 3600.0 psi\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.6, Page No:92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "L=1.2 #Length of the tube in m\n",
      "tau=40*10**6 #MAximum shear stress  in MPa\n",
      "t=0.002 #Thickness in m\n",
      "r=0.025 #Radius of the semicircle in m\n",
      "G=28*10**9 #Bulk Modulus in Pa\n",
      "t1=2 #Thickness in mm\n",
      "t2=3 #thickness in mm\n",
      "\n",
      "#Calculations\n",
      "#Part(1)\n",
      "q=tau*t #Shear flow causing the stress in N/m\n",
      "Ao=pi*r**2*0.5 #Area of the semi-circle in m^2\n",
      "T=2*Ao*q #Torque causing the shear stress in N.m\n",
      "\n",
      "#Part(2)\n",
      "#After computing the median lines integration we get\n",
      "S=(pi*25*t1**-1)+(2*25*t2**-1) #Length of median line \n",
      "theta_r=T*L*S*(4*G*Ao**2)**-1 #Angle of twist in radians\n",
      "theta=theta_r*(180*pi**-1) #Angle of twist in degrees\n",
      "\n",
      "#Result\n",
      "print \"Result for part(1)\"\n",
      "print \"The torque causing the stress of 40MPa is\",round(T,2),\"N.m\"\n",
      "print \"Result for part (2)\"\n",
      "print \"The angle of twist is\",round(theta,1),\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Result for part(1)\n",
        "The torque causing the stress of 40MPa is 157.08 N.m\n",
        "Result for part (2)\n",
        "The angle of twist is 5.6 degrees\n"
       ]
      }
     ],
     "prompt_number": 21
    }
   ],
   "metadata": {}
  }
 ]
}