summaryrefslogtreecommitdiff
path: root/Power_Electronics_Principles_and_Applications_by_Jacob/Chapter1.ipynb
blob: 662bf254313b26cea13227faf51100d6456d70b0 (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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 1: Advanced Operational Amplifier Principles"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.1,Page 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "open output voltage is 0.5 V\n",
      "resistance lower loaded is 333.333 ohm\n",
      "loaded output voltage is 0.25 V\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "R1=1000.0;\n",
    "R2=1000.0;\n",
    "Rl=500.0#load resistance\n",
    "V=1.0#input voltage\n",
    "\n",
    "#calculation\n",
    "Vo=(R2/(R1+R2))*V;\n",
    "Rll=1/((1/R2)+(1/Rl))#lower loaded resistance\n",
    "Vol=(Rll/(R2+Rll))*V;\n",
    "\n",
    "#result\n",
    "print \"open output voltage is\",round(Vo,3),\"V\"\n",
    "print \"resistance lower loaded is\",round(Rll,3),\"ohm\"\n",
    "print \"loaded output voltage is\",round(Vol,3),\"V\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.2,Page 11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input resistance is 1.01 Kohm\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Rf=100000.0#resistance\n",
    "Acl=100.0#amplifier gain\n",
    "\n",
    "#calculation\n",
    "Ri=Rf/(Acl-1);\n",
    "\n",
    "#result\n",
    "print \"input resistance is\",round(Ri/1000,2), \"Kohm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.3,Page 17"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current through Ri1 is 178.571 microAmp\n",
      "current through Ri2 is 31.915 microAmp\n",
      "current through Ri2 is 31.915 microAmp\n",
      "current through Rf is 210.486 microAmp\n",
      "voltage dropped is 2.105 V\n",
      "output voltage 1 is -2.105 V\n",
      "output voltage is 2.105 V\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vni=0.0#non inverting voltage\n",
    "Vinv=0.0;#inverting voltage\n",
    "Vri1=1.0;\n",
    "Vri2=15.0;\n",
    "Ri1=5600.0#resistance\n",
    "Ri2=470000.0;\n",
    "Rf=10000.0#load resistance\n",
    "\n",
    "#calculation\n",
    "Ir1=Vri1/Ri1;\n",
    "Ir2=Vri2/Ri2;\n",
    "Irf=(Vri1/Ri1)+(Vri2/Ri2);\n",
    "Vr=Irf*Rf;\n",
    "Vo1=-Vr;\n",
    "Vo=Irf*Rf;\n",
    "\n",
    "#result\n",
    "print \"current through Ri1 is\",round(Ir1*1e6,3), \"microAmp\"\n",
    "print \"current through Ri2 is\",round(Ir2*1e6,3), \"microAmp\"\n",
    "print \"current through Ri2 is\",round(Ir2*1e6,3),\"microAmp\"\n",
    "print \"current through Rf is\",round(Irf*1e6,3), \"microAmp\"\n",
    "print \"voltage dropped is\",round(Vr,3), \"V\"\n",
    "print \"output voltage 1 is\",round(Vo1,3), \"V\"\n",
    "print \"output voltage is\",round(Vo,3), \"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.4,Page 25"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "inverting voltage is 4.955 V\n",
      "non inverting voltage is 4.955 V\n",
      "current through Rf2 is 42.698 microA\n",
      "current through Ri2 is 42.698 microA\n",
      "voltage dropped is 4.056 V\n",
      "output voltage is 884.897 mV\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Ri1=950.00;#ohm\n",
    "Ri2=1050.00;\n",
    "Rf1=105000.00;#resistance\n",
    "Rf2=95000.00;\n",
    "Vin=5.00;#voltage\n",
    "\n",
    "#calculation\n",
    "Vinv=(Rf1/(Rf1+Ri1))*Vin;\n",
    "Vni=Vinv;\n",
    "Irf2=(Vin-Vinv)/Ri2;\n",
    "Iri2=Irf2;\n",
    "Vrf2=Irf2*Rf2;\n",
    "Vo=Vinv-Vrf2-.014;\n",
    "\n",
    "#result\n",
    "print \"inverting voltage is\",round(Vinv,3), \"V\"\n",
    "print \"non inverting voltage is\",round (Vni,3), \"V\"\n",
    "print \"current through Rf2 is\",round(Irf2*1e6,3), \"microA\"\n",
    "print \"current through Ri2 is\",round(Iri2*1e6,3), \"microA\"\n",
    "print \"voltage dropped is\",round(Vrf2,3), \"V\"\n",
    "print \"output voltage is\",round(Vo*1000,3), \"mV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.5,Page 27"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input resistor current is 272.222 microA\n",
      "input resistor current is 500.0 microA\n",
      "feedback resistor current is 227.778 microAmp\n",
      "resistor voltage is 227.778 mV\n",
      "1st output voltage is 2.222 V\n",
      "input resistor current is 327.778 microA\n",
      "input resistor current is 827.778 microA\n",
      "feedback resistor voltage is 7.45 V\n",
      "2nd output voltage is 10.0 V\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance \n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vniu1=2.45;#V\n",
    "Vniu2=2.55;#V\n",
    "Vinvu1=2.45;\n",
    "Vinvu2=2.55;\n",
    "Ri1=9000.0;#ohm\n",
    "Ri2=1000.0;#ohm\n",
    "Rf1=1000.0;\n",
    "Rf2=9000.0;\n",
    "Rg=200.0;#load resistance\n",
    "\n",
    "#calculation\n",
    "Iri1=Vniu1/Ri1;\n",
    "Irg=(Vniu2-Vniu1)/Rg;\n",
    "Irf1=Irg-Iri1;\n",
    "Vrf1=Irf1*Rf1;\n",
    "Vou1=Vniu1-Vrf1;\n",
    "Iri2=(Vniu2-Vou1)/Ri2;\n",
    "Irf2=Iri2+Irg;\n",
    "Vrf2=Irf2*Rf2#feedback resistor voltage\n",
    "Vo=Vrf2+Vniu2;\n",
    "\n",
    "#result\n",
    "print \"input resistor current is\",round(Iri1*1e6,3), \"microA\"\n",
    "print \"input resistor current is\",round(Irg*1e6,3), \"microA\"\n",
    "print \"feedback resistor current is\",round(Irf1*1e6,3), \"microAmp\"\n",
    "print \"resistor voltage is\",round(Vrf1*1000,3), \"mV\"\n",
    "print \"1st output voltage is\",round(Vou1,3), \"V\"\n",
    "print \"input resistor current is\",round(Iri2*1e6,3), \"microA\"\n",
    "print \"input resistor current is\",round(Irf2*1e6,3),\"microA\"\n",
    "print \"feedback resistor voltage is\",round(Vrf2,3), \"V\"\n",
    "print \"2nd output voltage is\",round(Vo,3), \"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.6.a,Page 29"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input resistor current is 128.0 microA\n",
      "feedback resistor current is 128.0 microA\n",
      "feedback resistor voltage is 5.018 V\n",
      "output resistor voltage is 5.018 V\n",
      "output voltage is 3.818 V\n",
      "load current is 0.5 A\n",
      "load power is 2.5 W\n",
      "power dissipated in LM317 is 5.0 W\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vniu1=0;#V\n",
    "Vinvu2=0;#V\n",
    "Vref=2.56;\n",
    "Rl=10000.0;#ohm\n",
    "Rf=39200.0;#ohm\n",
    "Ro=10.0;#resistance\n",
    "Vdc1=5.0;\n",
    "Vdc2=15.0;\n",
    "Idc=0.5;#current\n",
    "\n",
    "#calculation\n",
    "Iu1=(Vref/Rl)*.5;\n",
    "Irf=Iu1;\n",
    "Vrf=Irf*Rf;\n",
    "Vout=Vrf+Vinvu2;\n",
    "Eo=Vout-1.2;\n",
    "Iload=Vdc1/Ro;\n",
    "Pload=Vdc1**2/Ro;\n",
    "Plm317=(Vdc2-Vdc1)*Idc;\n",
    "\n",
    "#result\n",
    "print \"input resistor current is\",round(Iu1*1e6,3), \"microA\"\n",
    "print \"feedback resistor current is\",round(Irf*1e6,3), \"microA\"\n",
    "print \"feedback resistor voltage is\",round(Vrf,3), \"V\"\n",
    "print \"output resistor voltage is\",round(Vout,3), \"V\"\n",
    "print \"output voltage is\",round(Eo,3), \"V\"\n",
    "print \"load current is\",round(Iload,3), \"A\"\n",
    "print \"load power is\",round(Pload,3), \"W\"\n",
    "print \"power dissipated in LM317 is\",round(Plm317,3), \"W\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.6.b,Page 31"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input resistor current is 360.36 microamp\n",
      "inverting voltage 1 & 2 is 396.396 mV\n",
      "current across Rs is 3.964 A\n",
      "emitter voltage is 8.324 V\n",
      "output voltage is 10.124 V\n"
     ]
    }
   ],
   "source": [
    "#finding voltage current resistance\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vin=4;#V\n",
    "Vs=1.8;#V\n",
    "Rf=10000.0;#ohm\n",
    "Ri=1100.0;#ohm\n",
    "Rl=2.0;#ohm\n",
    "Rs=0.1;#ohm\n",
    "\n",
    "#calculation\n",
    "Irf=Vin/(Rf+Ri);\n",
    "Vni=Irf*Ri;\n",
    "Ir=Vni/Rs;\n",
    "Ve=Ir*(Rl+Rs);\n",
    "Vo=Ve+Vs;\n",
    "\n",
    "#result\n",
    "print \"input resistor current is\",round(Irf*1e6,3),\"microamp\"\n",
    "print \"inverting voltage 1 & 2 is\",round(Vni*1000,3), \"mV\"\n",
    "print \"current across Rs is\",round(Ir,3), \"A\"\n",
    "print \"emitter voltage is\",round(Ve,3), \"V\"\n",
    "print \"output voltage is\",round(Vo,3), \"V\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.7,Page 36"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "rms voltage is 9.899 V\n",
      "power delivered is 12.25 W\n",
      "load voltage is 28.284 V\n"
     ]
    }
   ],
   "source": [
    "#finding voltage and power\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vs=18.0;#V\n",
    "Rl=8.0;#load resistance\n",
    "Pll=100.0;#power\n",
    "\n",
    "#calculation\n",
    "Vlp=Vs-4;\n",
    "Vlr=Vlp/(2**(.5));\n",
    "Pl=(Vlr**2)/Rl;\n",
    "Vl=(Pll*Rl)**(.5);\n",
    "\n",
    "#result\n",
    "print \"rms voltage is\",round(Vlr,3), \"V\"\n",
    "print \"power delivered is\",round(Pl,3), \"W\"\n",
    "print \"load voltage is\",round(Vl,3), \"V\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.9,Page 44"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "output voltage is 37.34 V\n",
      "V+ is 45.34 V ;V- is 29.34 V\n"
     ]
    }
   ],
   "source": [
    "#finding output volatage and range \n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "import numpy as np\n",
    "Vp=6.0;#V\n",
    "Ra=10.0;#Kohm\n",
    "Rb=1800.0;#ohm\n",
    "V=8.0;\n",
    "#solving for Ir & Vo\n",
    "a=np.array([[1.0,-124.6e-6],[7800.0,-1.0]])\n",
    "b=np.array([134.6e-6,0.0])\n",
    "\n",
    "#calculation\n",
    "x=np.linalg.solve(a,b);\n",
    "Vo=x[1];\n",
    "Va=Vo+V;\n",
    "Vb=Vo-V;\n",
    "\n",
    "#result\n",
    "print \"output voltage is\",round(Vo,2), \"V\"\n",
    "print \"V+ is\",round(Va,2), \"V ;V- is\",round(Vb,2), \"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.11,Page 50"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "output current is 4.091 mA\n",
      "output voltage is 45.409 V\n",
      "gain output voltage 1 is 13.356 V\n",
      "gain output voltage 2 is 0.38 V\n"
     ]
    }
   ],
   "source": [
    "#finding output voltage and gain output voltage \n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vin=4.5;\n",
    "R1=1100.0;\n",
    "R2=10000.0;\n",
    "\n",
    "G1=3.4#gain 1\n",
    "G2=120.0#gain 2\n",
    "\n",
    "#calculation\n",
    "Ir=Vin/R1;\n",
    "Vo=Ir*(R1+R2);\n",
    "Vuo1=Vo/G1;\n",
    "Vuo2=Vo/G2;\n",
    "\n",
    "#result\n",
    "print \"output current is\",round(Ir*1000,3),\"mA\"\n",
    "print \"output voltage is\",round(Vo,3), \"V\"\n",
    "print \"gain output voltage 1 is\",round(Vuo1,3), \"V\"\n",
    "print \"gain output voltage 2 is\",round(Vuo2,2),\"V\""
   ]
  }
 ],
 "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
}