summaryrefslogtreecommitdiff
path: root/Engineering_Thermodynamics_by_O_Singh/2-Zeroth_Law_Of_Thermodynamics.ipynb
blob: 5bd4538153cfd1e92a6bc65fd56cb4af12b158b7 (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
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 2: Zeroth Law Of Thermodynamics"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 2.1: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_2_Example_1.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Display mode\n",
"mode(0);\n",
"// Display warning for floating point exception\n",
"ieee(1);\n",
"clear;\n",
"clc;\n",
"disp('Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 1')\n",
"Tf=98.6;//temperature of body in farenheit\n",
"disp('degree celcius and farenheit are related as follows')\n",
"disp('Tc=(Tf-32)/1.8')\n",
"disp('so temperature of body in degree celcius')\n",
"Tc=(Tf-32)/1.8"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 2.2: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_2_Example_2.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Display mode\n",
"mode(0);\n",
"// Display warning for floating point exception\n",
"ieee(1);\n",
"clear;\n",
"clc;\n",
"disp('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",
"disp('using thermometric relation')\n",
"disp('t=a*log(p)+(b/2)')\n",
"disp('for ice point,b/a=')\n",
"b=2*log(p1)\n",
"disp('so b=2.1972*a')\n",
"disp('for steam point')\n",
"a=t2/(log(p2)-(2.1972/2))\n",
"disp('and b=')\n",
"b=2.1972*a\n",
"disp('thus, t=a*log(p3)+(b/2) in degree celcius')\n",
"t=a*log(p3)+(b/2)\n",
"disp('so for thermodynamic property of 6.5,t=302.83 degree celcius')"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 2.3: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_2_Example_3.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Display mode\n",
"mode(0);\n",
"// Display warning for floating point exception\n",
"ieee(1);\n",
"clear;\n",
"clc;\n",
"disp('Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 3')\n",
"disp('emf equation')\n",
"disp('E=(0.003*t)-((5*10^-7)*t^2))+(0.5*10^-3)')\n",
"disp('using emf equation at ice point,E_0 in volts')\n",
"t=0;//ice point temperature in degree celcius\n",
"disp('E_0=(0.003*t)-((5*10^-7)*t^2)+(0.5*10^-3)')\n",
"E_0=(0.003*t)-((5*10^-7)*t^2)+(0.5*10^-3)\n",
"disp('using emf equation at steam point,E_100 in volts')\n",
"t=100;//steam point temperature in degree celcius\n",
"disp('E_100=(0.003*t)-((5*10^-7)*t^2)+(0.5*10^-3)')\n",
"E_100=(0.003*t)-((5*10^-7)*t^2)+(0.5*10^-3)\n",
"disp('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",
"disp('now the temperature(T) shown by this thermometer')\n",
"disp('T=((E_30-E_0)/(E_100-E_0))*(T_100-T_0) in degree celcius')\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",
"disp('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.')"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 2.4: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_2_Example_4.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Display mode\n",
"mode(0);\n",
"// Display warning for floating point exception\n",
"ieee(1);\n",
"clear;\n",
"clc;\n",
"disp('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",
"disp('emf equation,e=0.18*t-5.2*10^-4*t^2 in millivolts')\n",
"disp('as ice point and steam points are two reference points,so')\n",
"disp('at ice point,emf(e1)in mV')\n",
"e1=0.18*t1-5.2*10^-4*t1^2\n",
"disp('at steam point,emf(e2)in mV')\n",
"e2=0.18*t2-5.2*10^-4*t2^2\n",
"disp('at gas temperature,emf(e3)in mV')\n",
"e3=0.18*t3-5.2*10^-4*t3^2\n",
"disp('since emf variation is linear so,temperature(t)in degree celcius at emf of 7.7 mV')\n",
"t=((t2-t1)/(e2-e1))*e3\n",
"disp('temperature of gas using thermocouple=60.16 degree celcius')\n",
"disp('% variation in temperature reading with respect to gas thermometer reading of 50 degree celcius')\n",
"variation=((t-t3)/t3)*100"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 2.5: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_2_Example_5.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"// Display mode\n",
"mode(0);\n",
"// Display warning for floating point exception\n",
"ieee(1);\n",
"clear;\n",
"clc;\n",
"disp('Engineering Thermodynamics by Onkar Singh,Chapter 2,Example 5')\n",
"disp('let the conversion relation be X=aC+b')\n",
"disp('where C is temperature in degree celcius,a&b are constants and X is temperature in X degree ')\n",
"disp('at freezing point,temperature=0 degree celcius,0 degree X')\n",
"disp('so by equation X=aC+b')\n",
"X=0;//temperature in degree X\n",
"C=0;//temperature in degree celcius\n",
"disp('we get b=0')\n",
"b=0;\n",
"disp('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",
"disp('conversion relation')\n",
"disp('X=10*C')\n",
"disp('absolute zero temperature in degree celcius=-273.15')\n",
"disp('absolute zero temperature in degree X=')\n",
"10*-273.15"
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}