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
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1>Chapter 24: Application of complex numbers to series a.c. circuits</h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 1, page no. 433</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine the values of the resistance and the series-connected inductance or capacitance for each of the following impedances:\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"z1 = 12 + 5j;\n",
"z2 = -40j;\n",
"r3 = 30;\n",
"theta3 = 60;# in degrees\n",
"r4 = 2.20E6; \n",
"theta4 = -30;# in degrees\n",
"f = 50;# in Hz\n",
"\n",
"#calculation:\n",
" #for an R-L series circuit, impedance\n",
" # Z = R + iXL\n",
"Ra = z1.real\n",
"XLa = z1.imag\n",
"La = XLa/(2*math.pi*f)\n",
" #for a purely capacitive circuit, impedance Z = -iXc\n",
"Xcb = abs(z2.imag)\n",
"Cb = 1/(2*math.pi*f*Xcb)\n",
"z3 = r3*cmath.cos(theta3*math.pi/180) + (r3*cmath.sin(theta3*math.pi/180))*1j\n",
"Rc = z3.real\n",
"XLc = z3.imag\n",
"Lc = XLc/(2*math.pi*f)\n",
"z4 = r4*cmath.cos(theta4*math.pi/180) + (r4*cmath.sin(theta4*math.pi/180))*1j\n",
"Rd = z4.real\n",
"Xcd = abs(z4.imag)\n",
"Cd = 1/(2*math.pi*f*Xcd)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)an impedance (12 + i5)ohm represents a resistance of \",round( Ra,2),\" ohm \"\n",
"print \"in series with an inductance of \",round(La*1000,2),\"mH\"\n",
"print \"\\n (b)an impedance -40i ohm represents a pure capacitor of capacitance \",round(Cb*1E6,2),\"uF\"\n",
"print \"\\n (c)an impedance 30/_60deg ohm represents a resistance of \",round(Rc,2),\" ohm \"\n",
"print \"in series with an inductance of \",round(Lc*1000,2),\"mH\"\n",
"print \"\\n (d)an impedance 2.20 x 10^6 /_-30deg ohm represents a resistance of \",round(Rd/1000,2),\"kohm \"\n",
"print \" in series with a capacitor of capacitance \",round(Cd*1E9,2),\"nF\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)an impedance (12 + i5)ohm represents a resistance of 12.0 ohm \n",
"in series with an inductance of 15.92 mH\n",
"\n",
" (b)an impedance -40i ohm represents a pure capacitor of capacitance 79.58 uF\n",
"\n",
" (c)an impedance 30/_60deg ohm represents a resistance of 15.0 ohm \n",
"in series with an inductance of 82.7 mH\n",
"\n",
" (d)an impedance 2.20 x 10^6 /_-30deg ohm represents a resistance of 1905.26 kohm \n",
" in series with a capacitor of capacitance 2.89 nF\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2, page no. 434</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine, in polar and rectangular forms, the current flowing in an inductor of negligible resistance and inductance\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"L = 0.1592 ;# in Henry\n",
"V = 250;# in Volts\n",
"f = 50;# in Hz\n",
"R = 0;# in ohms\n",
"\n",
"#calculation:\n",
" #for an R\u00e2\u20ac\u201cL series circuit, impedance\n",
" # Z = R + iXL\n",
"XL = 2*math.pi*f*L\n",
"Z = R + 1j*XL\n",
"I = V/Z\n",
"x = I.real\n",
"y = I.imag\n",
"r = (x**2 + y**2)**0.5\n",
"if ((x==0)&(y<0)):\n",
" theta = -90\n",
"elif ((x==0)&(y>0)):\n",
" theta = +90\n",
"else:\n",
" theta = cmath.phase(complex(x,y))*180/math.pi\n",
"\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n current is (\",round(r,2),\"/_\",theta,\"deg) A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" current is ( 5.0 /_ -90 deg) A"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 3, page no. 435</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine the value of the supply p.d.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"C = 3E-6 ;# in farad\n",
"f = 1000;# in Hz\n",
"ri = 2.83;\n",
"thetai = 90;# in degrees\n",
"\n",
"#calculation:\n",
" #Capacitive reactance Xc\n",
"Xc = 1/(2*math.pi*f*C)\n",
" # circuit impedance Z\n",
"Z = -1*1j*Xc\n",
"I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
"V = I*Z\n",
"x = V.real\n",
"y = V.imag\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n supply p.d. is \",round(abs(V),0),\"V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" supply p.d. is 150.0 V"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 4, page no. 435</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine (a) the resistance, (b) the capacitance, \n",
"#(c) the modulus of the impedance, and (d) the current flowing and its phase angle,\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 240;# in Volts\n",
"f = 50;# in Hz\n",
"Z = 30 - 50j;\n",
"\n",
"#calculation:\n",
" #Since impedance Z = 30 - i50,\n",
" #resistance\n",
"R = Z.real\n",
" #capacitive reactance\n",
"Xc = abs(Z.imag)\n",
" #capacitance\n",
"C = 1/(2*math.pi*f*Xc)\n",
" #modulus of impedance\n",
"modZ = (R**2 + Xc**2)**0.5\n",
"I = V/Z\n",
"x = I.real\n",
"y = I.imag\n",
"r = (x**2 + y**2)**0.5\n",
"theta = cmath.phase(complex(x,y))*180/math.pi\n",
"\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)resistance is \",round( R,2),\" ohm\"\n",
"print \"\\n (b)capacitance is \",round(C*1E6,2),\"uFarad\"\n",
"print \"\\n (c)modulus of impedance is \",round(modZ,2),\" ohm\"\n",
"print \"\\n (d)current flowing and its phase angle is (\",round( r,2),\"/_\",round( theta,2),\"deg) A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)resistance is 30.0 ohm\n",
"\n",
" (b)capacitance is 63.66 uFarad\n",
"\n",
" (c)modulus of impedance is 58.31 ohm\n",
"\n",
" (d)current flowing and its phase angle is ( 4.12 /_ 59.04 deg) A"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 5, page no. 436</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine (a) the impedance of the circuit,\n",
"#(b) the current and circuit phase angle, \n",
"#(c) the p.d. across the 32 ohm resistor, and (d) the p.d. across the coil\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 200;# in Volts\n",
"f = 50;# in Hz\n",
"R = 32;# in ohms\n",
"L = 0.15;# in Henry\n",
"\n",
"#calculation:\n",
" #Inductive reactance XL\n",
"XL = 2*math.pi*f*L\n",
" #impedance, Z\n",
"Z = R + 1j*XL\n",
" #Current I\n",
"I = V/Z\n",
"xi = I.real\n",
"yi = I.imag\n",
"ri = (xi**2 + yi**2)**0.5\n",
"if ((xi==0)&(yi<0)):\n",
" thetai = -90\n",
"elif ((xi==0)&(yi>0)):\n",
" thetai = +90\n",
"else:\n",
" thetai = cmath.phase(complex(xi,yi))*180/math.pi\n",
"\n",
" #P.d. across the resistor\n",
"VR = I*R\n",
"xr = VR.real\n",
"yr = VR.imag\n",
"rr = (xr**2 + yr**2)**0.5\n",
"thetar = cmath.phase(complex(xr,yr))*180/math.pi\n",
" #P.d. across the coil, VL\n",
"VL = I*1j*XL\n",
"xl = VL.real\n",
"yl = VL.imag\n",
"rl = (xl**2 + yl**2)**0.5\n",
"thetal = cmath.phase(complex(xl,yl))*180/math.pi\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)impedance is \",round(Z.real,2),\" + \",round( Z.imag,2),\")i ohm\"\n",
"print \"\\n (b)current flowing and its phase angle is lagging the voltage = (\",round( ri,2),\"/_\",round( thetai,2),\"deg) A\"\n",
"print \"\\n (c)P.d. across the resistor is (\",round(rr,2),\"/_\",round(thetar,2),\"deg) V\"\n",
"print \"\\n (d)P.d. across the coil, VL is (\",round(rl,2),\"/_\",round(thetal,2),\"deg) V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)impedance is 32.0 + 47.12 )i ohm\n",
"\n",
" (b)current flowing and its phase angle is lagging the voltage = ( 3.51 /_ -55.82 deg) A\n",
"\n",
" (c)P.d. across the resistor is ( 112.36 /_ -55.82 deg) V\n",
"\n",
" (d)P.d. across the coil, VL is ( 165.46 /_ 34.18 deg) V"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 6, page no. 436</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine the value of impedance\n",
"#determine the value of the components forming the series circuit.\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"V = 120 + 200j;# in Volts\n",
"f = 5E6;# in Hz\n",
"I = 7 + 16j;# in amperes\n",
"\n",
"#calculation:\n",
" #impedance, Z\n",
"Z = V/I\n",
"R = Z.real\n",
"X = Z.imag \n",
"if ((R>0)&(X<0)):\n",
" C = -1/(2*math.pi*f*X)\n",
"#Results\n",
" print \"\\n\\n Result \\n\\n\"\n",
" print \"\\n The series circuit thus consists of a resistor of resistance \",round(R,2),\" ohm \"\n",
" print \"and a capacitor of capacitive reactance\", round(X*-1,3),\"ohm and capacitance is\",round(C*1E9,2),\" nFarad\\n\"\n",
"elif ((R>0)&(X>0)):\n",
" L = 2*math.pi*f*X\n",
"#Results\n",
" print \"\\n\\n Result \\n\\n\"\n",
" print \"\\n The series circuit thus consists of a resistor of resistance \",round(R,2),\" ohm \"\n",
" print \" and a inductor of insuctance \",round(L*100,2),\" mHenry\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" The series circuit thus consists of a resistor of resistance 13.25 ohm \n",
"and a capacitor of capacitive reactance 1.705 ohm and capacitance is 18.67 nFarad\n",
"\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 7, page no. 437</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#determine the value of impedance Z2.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 70;# in volts\n",
"thetav = 30;# in degrees\n",
"ri = 3.5;# in amperes\n",
"thetai = -20;# in degrees\n",
" #z1 consist of two resistance\n",
"R1 = 4.36;# in ohms\n",
"R2 = -2.1j;# in ohms\n",
"\n",
" #calculation:\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
"I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
" #impedance, Z\n",
"Z = V/I\n",
" #Total impedance Z = z1 + z2\n",
"Z1 = R1 + R2\n",
"Z2 = Z - Z1\n",
"x = Z2.real\n",
"y = Z2.imag \n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n impedance Z2 is \",round(x,2),\" + (\",round(y,2),\")i ohm\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" impedance Z2 is 8.5 + ( 17.42 )i ohm"
]
}
],
"prompt_number": 9
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 8, page no. 437</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#determine (a) the supply voltage, (b) the voltage across the 90 \u000e resistance, \n",
"#(c) the voltage across the inductance, and (d) the circuit phase angle.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"R = 90;# in ohms\n",
"XL = 150;# in ohms\n",
"ri = 1.35;# in amperes\n",
"thetai = 0;# in degrees\n",
"\n",
"#calculation:\n",
"I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
" #Circuit impedance Z\n",
"Z = R + 1j*XL\n",
" #Supply voltage, V\n",
"V = I*Z\n",
" #Voltage across 90 ohm\u000e resistor\n",
"VR = V.real\n",
"#Voltage across inductance, VL\n",
"VL = V.imag\n",
"xv = V.real\n",
"yv = V.imag\n",
"rv = (xv**2 + yv**2)**0.5\n",
"thetav = cmath.phase(complex(xv,yv))*180/math.pi\n",
"phi = thetav - thetai\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)Supply voltage, V is \",xv,\" + (\",yv,\")i V\\n\"\n",
"print \"\\n (b)Voltage across 90 ohm resistor, VR is \",VR,\" V\\n\"\n",
"print \"\\n (c)Voltage across inductance, VL is \",VL,\" V\\n\"\n",
"print \"\\n (d)Circuit phase angle is \",round(phi,2),\"deg lagging\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)Supply voltage, V is 121.5 + ( 202.5 )i V\n",
"\n",
"\n",
" (b)Voltage across 90 ohm resistor, VR is 121.5 V\n",
"\n",
"\n",
" (c)Voltage across inductance, VL is 202.5 V\n",
"\n",
"\n",
" (d)Circuit phase angle is 59.04 deg lagging"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 9, page no. 438</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine (a) the rms value of voltage (in polar form),\n",
"#(b) the circuit impedance, (c) the rms current flowing, and\n",
"#(d) the circuit phase angle.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"R = 25;# in ohms\n",
"L = 0.02;# in henry\n",
"Vm = 282.8;# in volts\n",
"w = 628.4;# in rad/sec\n",
"phiv = math.pi/3;# phase angle\n",
"\n",
"#calculation:\n",
" #rms voltage\n",
"Vrms = 0.707*Vm*math.cos(phiv) + 0.707*Vm*math.sin(phiv)*1j\n",
" #frequency\n",
"f = w/(2*math.pi)\n",
" #Inductive reactance XL\n",
"XL = 2*math.pi*f*L\n",
" #Circuit impedance Z\n",
"Z = R + XL*1j\n",
" #Rms current\n",
"Irms = Vrms/Z\n",
"phii = cmath.phase(complex(Irms.real, Irms.imag))*180/math.pi\n",
"phi = phiv*180/math.pi - phii\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)the rms value of voltage is \",round(Vrms.real,2),\" + (\",round( Vrms.imag,2),\")i V\\n\"\n",
"print \"\\n (b)the circuit impedance is \",round(R,2),\" + (\",round( XL,2),\")i ohm\\n\"\n",
"print \"\\n (c)the rms current flowing is \",round(Irms.real,2),\" + (\",round( Irms.imag,2),\")i A\\n\"\n",
"print \"\\n (d)Circuit phase angle is \",round(phi,2),\"deg lagging\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)the rms value of voltage is 99.97 + ( 173.15 )i V\n",
"\n",
"\n",
" (b)the circuit impedance is 25.0 + ( 12.57 )i ohm\n",
"\n",
"\n",
" (c)the rms current flowing is 5.97 + ( 3.92 )i A\n",
"\n",
"\n",
" (d)Circuit phase angle is 26.69 deg lagging\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 10, page no. 438</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine the current flowing in the circuit\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"R = 12;# in ohms\n",
"L = 0.10;# in henry\n",
"C = 120E-6;# in Farads\n",
"f = 50;# in Hz\n",
"V = 240;# in volts\n",
"\n",
"#calculation:\n",
" #Inductive reactance, XL\n",
"XL = 2*math.pi*f*L\n",
" #Capacitive reactance, Xc\n",
"Xc = 1/(2*math.pi*f*C)\n",
" #Circuit impedance Z\n",
"Z = R + 1j*(XL - Xc)\n",
"I = V/Z\n",
"phii = cmath.phase(complex(I.real, I.imag))*180/math.pi\n",
"phiv = 0# in degrees\n",
"phi = phiv - phii\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing is \",round(abs(I),1),\"/_\",round(cmath.phase(complex(I.real,I.imag))*180/math.pi,1),\"deg A\\n\"\n",
"print \"and Circuit phase angle is \",round(phi,1),\"deg lagging\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing is 18.5 /_ -22.2 deg A\n",
"\n",
"and Circuit phase angle is 22.2 deg lagging\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 11, page no. 439</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#determine the values of R and L, Determine also the voltage across the coil and the voltage across the capacitor.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"C = 50E-6;# in Farads\n",
"f = 50;# in Hz\n",
"V = 225;# in volts\n",
"ri = 1.5;# in Amperes\n",
"thetai = -30;# in degrees\n",
"\n",
"#calculation:\n",
"I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
" #Capacitive reactance, Xc\n",
"Xc = 1/(2*math.pi*f*C)\n",
" #Circuit impedance Z\n",
"Z = V/I\n",
"R = Z.real\n",
"XL = Z.imag + Xc\n",
" #inductance L\n",
"L = XL/(2*math.pi*f)\n",
" #Voltage across coil\n",
"Zcoil = R + 1j*XL\n",
"Vcoil = I*Zcoil\n",
" #Voltage across capacitor,\n",
"Vc = I*(-1j*Xc)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)resistance is \",round(R,2),\" ohm and inductance is \",round( L,3),\" H\\n\"\n",
"print \"\\n (b)voltage across the coil is \",round(Vcoil.real,2),\" + (\",round( Vcoil.imag,2),\")i V\\n\"\n",
"print \"\\n (c)voltage across the capacitor is \",round(Vc.real,2),\" + (\",round( Vc.imag,2),\")i V\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)resistance is 129.9 ohm and inductance is 0.441 H\n",
"\n",
"\n",
" (b)voltage across the coil is 272.75 + ( 82.7 )i V\n",
"\n",
"\n",
" (c)voltage across the capacitor is -47.75 + ( -82.7 )i V"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 12, page no. 440</h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Determine also the value of the supply voltage V and the circuit phase angle.\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"C = 2.653E-6;# in Farads\n",
"R1 = 8;# in ohms\n",
"R2 = 5;# in ohms\n",
"L = 0.477E-3;# in Henry\n",
"f = 4000;# in Hz\n",
"ri = 6;# in Amperes\n",
"thetai = 0;# in degrees\n",
"\n",
"#calculation:\n",
"I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
" #Capacitive reactance, Xc\n",
"Xc = 1/(2*math.pi*f*C)\n",
" #impedance Z1\n",
"Z1 = R1 - 1j*Xc\n",
" #inductive reactance XL\n",
"XL = 2*math.pi*f*L\n",
" #impedance Z2,\n",
"Z2 = R2 + 1j*XL\n",
" #voltage V1\n",
"V1 = I*Z1\n",
" #voltage V2\n",
"V2 = I*Z2\n",
" #Supply voltage, V\n",
"V = V1 + V2\n",
"phiv = cmath.phase(complex(V.real, V.imag))*180/math.pi\n",
"phi = phiv - thetai\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n supply voltage is \",round(V.real,2),\" + (\",round( V.imag,2),\")i V\\n\"\n",
"print \"and Circuit phase angle is \",round(phi,2),\"deg leading\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" supply voltage is 78.0 + ( -18.06 )i V\n",
"\n",
"and Circuit phase angle is -13.03 deg leading"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}
|