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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 15: Fundamentals of Metalworking"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 15.1, Mechanics of Metal Working, Page No. 506"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Enginering Strain = 1\n",
"True Strain = 0.693147\n",
"Reduction = 1\n",
"\n",
"\n",
"Enginering Strain = -0.5\n",
"True Strain = -0.693147\n",
"Reduction = -1\n"
]
}
],
"source": [
"from math import log\n",
"\n",
"#For Bar which is double in length\n",
"#variable declaration 1\n",
"L2=2;\n",
"L1=1;\n",
"\n",
"#calculation 1\n",
"e=(L2-L1)/L1;\n",
"e1=log(L2/L1);\n",
"r=1-L1/L2;\n",
"\n",
"#result 1\n",
"print('\\nEnginering Strain = %g\\nTrue Strain = %g\\nReduction = %g')%(e,e1,r);\n",
"\n",
"\n",
"\n",
"#For bar which is halved in length\n",
"#variable declaration 2\n",
"L1=1;\n",
"L2=0.5;\n",
"\n",
"#calculation 2\n",
"e=(L2-L1)/L1;\n",
"e1=log(L2/L1);\n",
"r=1-L1/L2;\n",
"\n",
"#result 2\n",
"print('\\n\\nEnginering Strain = %g\\nTrue Strain = %g\\nReduction = %g')%(e,e1,r);\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"### Example 15.2, Mechanics of Metal Working, Page No. 511"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Plastic work done in 1st step = 39752.1 lb/in^2\n",
"Plastic work done in 2nd step = 97934.8 lb/in^2\n",
"\n"
]
}
],
"source": [
"\n",
"from scipy.integrate import quad\n",
"from math import log\n",
"\n",
"#variable declaration\n",
"D0=25.0;\n",
"D1=20.0;\n",
"D2=15.0;\n",
"def integrand(e):\n",
" return 200000*e**0.5\n",
"\n",
"#calculation\n",
"ep1=log((D0/D1)**2);\n",
"U1,U1_err=quad(integrand,0,ep1);\n",
"ep2=log((D1/D2)**2);\n",
"U2,U2_err=quad(integrand,ep1,ep1+ep2);\n",
"\n",
"#result\n",
"print('\\nPlastic work done in 1st step = %g lb/in^2\\nPlastic work done in 2nd step = %g lb/in^2\\n')%(U1,U2);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 15.3, Hodography, Page No. 517"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pressure = 2.88675\n"
]
}
],
"source": [
"\n",
"from math import sin\n",
"from math import radians\n",
"\n",
"#variable declaration\n",
"alpha=60;\n",
"\n",
"#calculation\n",
"r=radians(alpha);\n",
"mu=1/sin(r);\n",
"p_2k=mu*5/2;\n",
"\n",
"#result\n",
"print('Pressure = %g')%(p_2k);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 15.4, Temperature in Metalworking, Page No. 526"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Temperature Rise for aluminium = 78.4808 C\n",
"Temperature Rise for titanium = 162.686 C\n",
"\n"
]
}
],
"source": [
"\n",
"\n",
"#variable declaration\n",
"Al_s=200;\n",
"Al_e=1;\n",
"Al_p=2.69;\n",
"Al_c=0.215;\n",
"Ti_s=400;\n",
"Ti_e=1;\n",
"Ti_p=4.5;\n",
"Ti_c=0.124;\n",
"J=4.186;\n",
"b=0.95;\n",
"\n",
"#calculation\n",
"Al_Td=Al_s*Al_e*b/(Al_p*Al_c*J);\n",
"Ti_Td=Ti_s*Ti_e*b/(Ti_p*Ti_c*J);\n",
"\n",
"#result\n",
"print('\\nTemperature Rise for aluminium = %g C\\nTemperature Rise for titanium = %g C\\n')%(Al_Td,Ti_Td);\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 15.5, Friction and Lubrication, Page No. 546"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"For OD after deformation being 70 mm, Di = 22.3607 mm\n",
"Precent change in inside diameter = 25.4644 percent\n",
"Peak pressure = 1.93531\n",
"\n",
"\n",
"\n",
"\n",
"For OD after deformation being 81.4 mm, Di = 35.0137 mm\n",
"Precent change in inside diameter = -16.7124 percent\n",
"Peak pressure = 1.17321\n"
]
}
],
"source": [
"\n",
"\n",
"from math import sqrt\n",
"\n",
"#variable declaration\n",
"Do=60;\n",
"Di=30;\n",
"def1=70;\n",
"def2=81.4;\n",
"h=10;\n",
"a=30;\n",
"\n",
"#calculation1\n",
"di=sqrt((Do**2-Di**2)*2-def1**2);\n",
"pr=(Di-di)/Di*100;\n",
"m=0.27;\n",
"p_s=1+2*m*a/(sqrt(3)*h);\n",
"\n",
"#result 1\n",
"print('\\nFor OD after deformation being 70 mm, Di = %g mm\\nPrecent change in inside diameter = %g percent\\nPeak pressure = %g')%(di,pr,p_s);\n",
"\n",
"#calculation 2\n",
"di=sqrt(def2**2-(Do**2-Di**2)*2);\n",
"pr=(Di-di)/Di*100;\n",
"m=0.05;\n",
"p_s=1+2*m*a/(sqrt(3)*h);\n",
"\n",
"#result 2\n",
"print('\\n\\n\\n\\nFor OD after deformation being 81.4 mm, Di = %g mm\\nPrecent change in inside diameter = %g percent\\nPeak pressure = %g')%(di,pr,p_s);\n"
]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|