summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb
blob: cd9770453b18c2890c58cbe19309c5ca61054f0c (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:246707d96e3b84083bd218a775428cfb0782bf8a60e397f9fdb6240bd50142c9"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter15:Electronic Instruments"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 512"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate shunt resistance and multiplying factor\n",
      "#given\n",
      "Im=5.*10.**-3.;#A\n",
      "Rm=20.;#ohm\n",
      "I=5.;#A\n",
      "Rsh=Rm*Im/(I-Im);\n",
      "n=I/Im;\n",
      "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
      "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shunt resistance = 0.02002 ohm\n",
        "\n",
        "Multiplying factor = 1000 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 512"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate shunt resistance\n",
      "#given\n",
      "#At I= 1 mA\n",
      "I1=1.*10.**-3.;#A\n",
      "Im=0.1*10.**-3.;#A\n",
      "Rm=500.;#ohm\n",
      "Rsh=Rm*Im/(I1-Im);\n",
      "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
      "\n",
      "\n",
      "#At I= 1 mA\n",
      "I2=10.*10.**-3.;#A\n",
      "Rsh=Rm*Im/(I2-Im);\n",
      "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
      "\n",
      "\n",
      "#At I= 1 mA\n",
      "I3=100.*10.**-3.;#A\n",
      "Rsh=Rm*Im/(I3-Im);\n",
      "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shunt resistance = 55.5556 ohm\n",
        "\n",
        "Shunt resistance = 5.0505 ohm\n",
        "\n",
        "Shunt resistance = 0.5005 ohm\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 514"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Caluclate the series resistance to convert it into voltmeter\n",
      "#given\n",
      "Im=100.*10.**-6.;#A\n",
      "Rm=100.;#ohm\n",
      "V=100.;#V\n",
      "Rs=V/Im-Rm;\n",
      "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of series resistance is 999.9 kohm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 515"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate multiplier resistance and voltage multiplying factor\n",
      "#given\n",
      "Im=50.*10.**-6.;#A\n",
      "Rm=1000.;#ohm\n",
      "V=50.;#V\n",
      "Rs=V/Im-Rm;\n",
      "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
      "Vm=Im*Rm;\n",
      "n=V/Vm;\n",
      "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of multiplier resistance is 999 kohm\n",
        "\n",
        "Voltage multiplying factor = 1000 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 518"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate reading and error of each voltmeter\n",
      "#given\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2)#\n",
      "\treturn z\n",
      "S_A=1000.;# ohm/V#sensitivity\n",
      "S_B=20000.;# ohm/V#sensitivity\n",
      "R=50.;#V#range of voltmeter\n",
      "Vs=150.;#V#Supply\n",
      "R1=100.*10.**3.;#ohm\n",
      "R2=50.*10.**3.;#ohm\n",
      "Vt=Vs*(R2/(R1+R2));\n",
      "\n",
      "#Voltmeter A\n",
      "Ri1=S_A*R;\n",
      "Rxy_A=prll(Ri1,R2);      #total resistance at X and Y\n",
      "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
      "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
      "\n",
      "#Voltmeter B\n",
      "Ri2=S_B*R;\n",
      "Rxy_B=prll(Ri2,R2);      #total resistance at X and Y\n",
      "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
      "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
      "\n",
      "e1=(Vt-V1)*100./Vt;\n",
      "e2=(Vt-V2)*100./Vt;\n",
      "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
      "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltmeter indicates 30 V\n",
        "\n",
        "The voltmeter indicates 48.39 V\n",
        "\n",
        "The error in the reading of voltmeter A = 40 percent\n",
        "\n",
        "The error in the reading of voltmeter A = 3.23 percent\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 - Pg 531"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine rms value of the ac voltage\n",
      "#given\n",
      "import math\n",
      "l=8.3;#cm#length of the trace\n",
      "D=5.;# V/cm#deflection sensitivity\n",
      "Vpp=l*D;\n",
      "Vrms=Vpp/(2.*math.sqrt(2.));\n",
      "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rms value of the ac voltage 14.7 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E7 - Pg 531"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine rms value and frequency of the sine voltage\n",
      "#given\n",
      "import math\n",
      "l=3.5;#cm         #length of the trace\n",
      "D=2.;# V/cm        #deflection sensitivity\n",
      "Vpp=l*D;\n",
      "Vrms=Vpp/math.sqrt(2.);\n",
      "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
      "x=4.;#cm #one cycle length on x axis\n",
      "t=0.5*10.**-3.;# s/cm    #timebase setting\n",
      "T=x*t;\n",
      "f=1./T;\n",
      "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rms value of the sine voltage = 4.95 V\n",
        "\n",
        "The frequency of the sine voltage = 0.5 kHz\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}