summaryrefslogtreecommitdiff
path: root/Engineering_Thermodynamics_by__O._Singh/chapter2_3.ipynb
blob: 6d7e9bc4868b4a0e25194047765f8ba2bdb21d9e (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# chapter 2:Zeroth Law of Thermodynamics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 2.1;pg no:46"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 2.1, Page:46  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 1\n",
      "degree celcius and farenheit are related as follows\n",
      "Tc=(Tf-32)/1.8\n",
      "so temperature of body in degree celcius 37.0\n"
     ]
    }
   ],
   "source": [
    "#cal of temperature of body of human\n",
    "#intiation of all variables\n",
    "# Chapter 2\n",
    "print\"Example 2.1, Page:46  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 1\")\n",
    "Tf=98.6;#temperature of body in farenheit\n",
    "Tc=(Tf-32)/1.8\n",
    "print(\"degree celcius and farenheit are related as follows\")\n",
    "print(\"Tc=(Tf-32)/1.8\")\n",
    "print(\"so temperature of body in degree celcius\"),round(Tc,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 2.2;pg no:47"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 2.2, Page:47  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 2\n",
      "using thermometric relation\n",
      "t=a*log(p)+(b/2)\n",
      "for ice point,b/a=\n",
      "so b=2.1972*a\n",
      "for steam point\n",
      "a= 101.95\n",
      "and b= 224.01\n",
      "thus, t=in degree celcius\n",
      "so for thermodynamic property of 6.5,t=302.83 degree celcius= 302.84\n"
     ]
    }
   ],
   "source": [
    "#cal of celcius temperature\n",
    "#intiation of all variables\n",
    "# Chapter 2\n",
    "import math\n",
    "print\"Example 2.2, Page:47  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 2\")\n",
    "t1=0;#ice point temperature in degree celcius\n",
    "p1=3;#thermometric property for ice point\n",
    "t2=100;#steam point temperature in degree celcius\n",
    "p2=8;#thermometric property for steam point\n",
    "p3=6.5;#thermometric property for any temperature\n",
    "print(\"using thermometric relation\")\n",
    "print(\"t=a*log(p)+(b/2)\")\n",
    "print(\"for ice point,b/a=\")\n",
    "b=2*math.log(p1)\n",
    "print(\"so b=2.1972*a\")\n",
    "print(\"for steam point\")\n",
    "a=t2/(math.log(p2)-(2.1972/2))\n",
    "print(\"a=\"),round(a,2)\n",
    "b=2.1972*a\n",
    "print(\"and b=\"),round(b,2)\n",
    "t=a*math.log(p3)+(b/2)\n",
    "print(\"thus, t=in degree celcius\")\n",
    "print(\"so for thermodynamic property of 6.5,t=302.83 degree celcius=\"),round(t,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 2.3;page no:47"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 2.3, Page:47  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 3\n",
      "emf equation\n",
      "E=(0.003*t)-((5*10^-7)*t^2))+(0.5*10^-3)\n",
      "using emf equation at ice point,E_0 in volts\n",
      "E_0= 0.0\n",
      "using emf equation at steam point,E_100 in volts\n",
      "E_100= 0.3\n",
      "now emf at 30 degree celcius using emf equation(E_30)in volts\n",
      "now the temperature(T) shown by this thermometer\n",
      "T=in degree celcius 30.36\n",
      "NOTE=>In this question,values of emf at 100 and 30 degree celcius is calculated wrong in book so it is corrected above so the answers may vary.\n"
     ]
    }
   ],
   "source": [
    "#cal of temperature shown by this thermometer\n",
    "#intiation of all variables\n",
    "# Chapter 2\n",
    "print\"Example 2.3, Page:47  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 3\")\n",
    "print(\"emf equation\")\n",
    "print(\"E=(0.003*t)-((5*10^-7)*t^2))+(0.5*10^-3)\")\n",
    "print(\"using emf equation at ice point,E_0 in volts\")\n",
    "t=0.;#ice point temperature in degree celcius\n",
    "E_0=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
    "print(\"E_0=\"),round(E_0,2)\n",
    "print(\"using emf equation at steam point,E_100 in volts\")\n",
    "t=100.;#steam point temperature in degree celcius\n",
    "E_100=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
    "print(\"E_100=\"),round(E_100,2)\n",
    "print(\"now emf at 30 degree celcius using emf equation(E_30)in volts\")\n",
    "t=30.;#temperature of substance in degree celcius\n",
    "E_30=(0.003*t)-((5.*10**-7)*t**2)+(0.5*10**-3)\n",
    "T_100=100.;#steam point temperature in degree celcius\n",
    "T_0=0.;#ice point temperature in degree celcius\n",
    "T=((E_30-E_0)/(E_100-E_0))*(T_100-T_0)\n",
    "print(\"now the temperature(T) shown by this thermometer\")\n",
    "print(\"T=in degree celcius\"),round(T,2)\n",
    "print(\"NOTE=>In this question,values of emf at 100 and 30 degree celcius is calculated wrong in book so it is corrected above so the answers may vary.\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 2.4;pg no:48"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 2.4, Page:48  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 4\n",
      "emf equation,e=0.18*t-5.2*10^-4*t^2 in millivolts\n",
      "as ice point and steam points are two reference points,so\n",
      "at ice point,emf(e1)in mV\n",
      "at steam point,emf(e2)in mV\n",
      "at gas temperature,emf(e3)in mV\n",
      "since emf variation is linear so,temperature(t)in degree celcius at emf of 7.7 mV 60.16\n",
      "temperature of gas using thermocouple=60.16 degree celcius\n",
      "percentage variation=((t-t3)/t3)*100variation in temperature reading with respect to gas thermometer reading of 50 degree celcius 20.31\n"
     ]
    }
   ],
   "source": [
    "#cal of percentage variation in temperature\n",
    "#intiation of all variables\n",
    "# Chapter 2\n",
    "import math\n",
    "print\"Example 2.4, Page:48  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 4\")\n",
    "t1=0;#temperature at ice point\n",
    "t2=100;#temperature at steam point\n",
    "t3=50;#temperature of gas\n",
    "print(\"emf equation,e=0.18*t-5.2*10^-4*t^2 in millivolts\")\n",
    "print(\"as ice point and steam points are two reference points,so\")\n",
    "print(\"at ice point,emf(e1)in mV\")\n",
    "e1=0.18*t1-5.2*10**-4*t1**2\n",
    "print(\"at steam point,emf(e2)in mV\")\n",
    "e2=0.18*t2-5.2*10**-4*t2**2\n",
    "print(\"at gas temperature,emf(e3)in mV\")\n",
    "e3=0.18*t3-5.2*10**-4*t3**2\n",
    "t=((t2-t1)/(e2-e1))*e3\n",
    "variation=((t-t3)/t3)*100\n",
    "print(\"since emf variation is linear so,temperature(t)in degree celcius at emf of 7.7 mV\"),round(t,2)\n",
    "print(\"temperature of gas using thermocouple=60.16 degree celcius\")\n",
    "print(\"percentage variation=((t-t3)/t3)*100variation in temperature reading with respect to gas thermometer reading of 50 degree celcius\"),round(variation,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 2.5;pg no:48"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 2.5, Page:48  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 5\n",
      "let the conversion relation be X=aC+b\n",
      "where C is temperature in degree celcius,a&b are constants and X is temperature in X degree \n",
      "at freezing point,temperature=0 degree celcius,0 degree X\n",
      "so by equation X=aC+b\n",
      "we get b=0\n",
      "at boiling point,temperature=100 degree celcius,1000 degree X\n",
      "conversion relation\n",
      "X=10*C\n",
      "absolute zero temperature in degree celcius=-273.15\n",
      "absolute zero temperature in degree X= -2731.5\n"
     ]
    }
   ],
   "source": [
    "#cal of absolute zero temperature\n",
    "#intiation of all variables\n",
    "# Chapter 2\n",
    "print\"Example 2.5, Page:48  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 5\")\n",
    "print(\"let the conversion relation be X=aC+b\")\n",
    "print(\"where C is temperature in degree celcius,a&b are constants and X is temperature in X degree \")\n",
    "print(\"at freezing point,temperature=0 degree celcius,0 degree X\")\n",
    "print(\"so by equation X=aC+b\")\n",
    "X=0;#temperature in degree X\n",
    "C=0;#temperature in degree celcius\n",
    "print(\"we get b=0\")\n",
    "b=0;\n",
    "print(\"at boiling point,temperature=100 degree celcius,1000 degree X\")\n",
    "X=1000;#temperature in degree X\n",
    "C=100;#temperature in degree celcius\n",
    "a=(X-b)/C\n",
    "print(\"conversion relation\")\n",
    "print(\"X=10*C\")\n",
    "print(\"absolute zero temperature in degree celcius=-273.15\")\n",
    "X=10*-273.15\n",
    "print(\"absolute zero temperature in degree X=\"),round(X,2)\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
}