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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 3: Tem"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exa 3.1"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"T (F) = 26.60\n",
" \n",
" T (C) = 87.96\n",
" \n",
" T (K) = 361.11\n",
"press enter key to exit\n"
]
},
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#Make the following conversions : (a) -3 C to F (b) 650 R to C (c) 650 R to K\n",
"#initialisation of variables\n",
"T1= -3 \t\t\t\t\t#degrees\n",
"T2= 650. \t\t\t\t#Rankine\n",
"T3= 650. \t\t\t\t#Rankine\n",
"#CALCULATIONS\n",
"t1= (9./5.)*T1+32 \t\t#In F\n",
"t2= T2-459.67 \t\t\t#In F\n",
"t21= (5./9.)*(t2-32) \t#In C\n",
"t3= t21+273.15 \t\t\t#In K\n",
"#RESULTS\n",
"print '%s %.2f' % ('T (F) = ',t1)\n",
"print '%s %.2f' % (' \\n T (C) = ',t21)\n",
"print '%s %.2f' % (' \\n T (K) = ',t3)\n",
"raw_input('press enter key to exit')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exa 3.2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"T (F) = 18.00\n",
" \n",
" T (R) = 18.00\n",
"press enter key to exit\n"
]
},
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#The temperatuer of an object drops from 40 to 30C. Determine the temperature\n",
"#drop in (a) F and (b) R.\n",
"#initialisation of variables\n",
"T1= 40. \t\t\t\t#degrees\n",
"T2= 30. \t\t\t\t#degrees\n",
"#CALCULATIONS\n",
"d1= (T1-T2)*(9./5.) \t#drop in F\n",
"d2= d1 \t\t\t\t\t#drop in R\n",
"#RESULTS\n",
"print '%s %.2f' % ('T (F) = ',d1)\n",
"print '%s %.2f' % (' \\n T (R) = ',d2)\n",
"raw_input('press enter key to exit')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exa 3.3"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"L (mm) = 400.54\n",
"press enter key to exit\n"
]
},
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#A brass wire has a length of 400mm at 20C. What is the length of the wire at 90C?\t\n",
"#initialisation of variables\n",
"l= 400 \t\t\t\t\t#mm\n",
"t1= 20 \t\t\t\t\t#degrees\n",
"t2= 90 \t\t\t\t\t#degrees\n",
"alpha= 19.3/1000000. \t#degrees^-1\n",
"#CALCULATIONS\n",
"L= alpha*(t2-t1)*l \t\t#Change in Length\n",
"L1= L+l \t\t\t\t#Final Length\n",
"#RESULTS\n",
"print '%s %.2f' % ('L (mm) = ',L1)\n",
"raw_input('press enter key to exit')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exa 3.4"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"diameter at -15 (in) = 2.98\n",
"press enter key to exit\n"
]
},
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#An Al 2024-T3 plate has a 2.980-in diameter hole at 69F. What is the \n",
"#diameter if the temperature is lowered to -15F?\n",
"import math\n",
"#initialisation of variables\n",
"d= 2.98 \t\t\t\t\t#in\n",
"T1= 69 \t\t\t\t\t\t#F\n",
"T2= -15 \t\t\t\t\t#F\n",
"alpha= 22.7/1000000. \t\t#C^-1\n",
"#CALCULATIONS\n",
"A0= math.pi*d*d/4. \t\t\t#Initial Area\n",
"alpha1= alpha/1.8 \n",
"A= 2*alpha1*A0*(T1-T2) \t#Change in Area\n",
"A1= A0-A \n",
"d1= math.sqrt(4*A1/math.pi) #diameter at -15F\n",
"#RESULTS\n",
"print '%s %.2f' % ('diameter at -15 (in) = ',d1)\n",
"raw_input('press enter key to exit')"
]
}
],
"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.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|