summaryrefslogtreecommitdiff
path: root/sample_notebooks/Sushovan Jena/Chapter1.ipynb
blob: 1d13f1456880d7d4d8f0d180ec3577fb50d0bca0 (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
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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 1: Review of Basic Circuits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1 Page No:5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Applying KCL at junction(N),we get I=1+2=3 A\n"
     ]
    }
   ],
   "source": [
    "# Given Data\n",
    "#Current through Resistor R1 is 1A\n",
    "#Current through Resistor R2 is 2A\n",
    "#Display results\n",
    "print\"Applying KCL at junction(N),we get I=1+2=3 A\"   # KCL stands for Kirchoff's Current Law which states\n",
    "                                                    # that sum of all currents at a junction equals to zero\n",
    "                                                    # N is the name of the junction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2 Page No:7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I=0.200000 A\n"
     ]
    }
   ],
   "source": [
    "#Given Data\n",
    "E1=4.;#EMF in volts\n",
    "E2=2.;#EMF in volts\n",
    "r1=2.;#Resistance in ohm\n",
    "r2=3.;#Resistance in ohm\n",
    "R=5.;#Resistance in ohm\n",
    "#Calculations\n",
    "#Applying KVL to the circuit,we get\n",
    "I=(E1-E2)/(r1+r2+R);#Current in Amperes\n",
    "#Display Results\n",
    "print \"I=%f A\"%I;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3 Page No:9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The current by the battery I=0.312500 Amperes\n"
     ]
    }
   ],
   "source": [
    "#Given Data\n",
    "E=10.0;#EMF in volts\n",
    "R1=20.0;#Resistance in ohm\n",
    "R2=20.0;#Resistance in ohm\n",
    "R3=30.0;#Resistance in ohm\n",
    "#Calculations\n",
    "Req=R1+(R2*R3/(R2+R3));# Equivalent resistance of the circuit\n",
    "I=E/Req;#Current through the battery in Amperes\n",
    "print \"The current by the battery I=%f Amperes\"%I;\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 Page No:12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current through R=5ohm is 0.277778 Amperes\n"
     ]
    }
   ],
   "source": [
    "#Naming emfs on both sides to be E1,E2 respectively\n",
    "#and resistances as R1,R2,R3\n",
    "#Given Data\n",
    "E1=3.0;# volts\n",
    "E2=1.0;# volts\n",
    "R1=4.0;# ohms\n",
    "R2=Rab=RL=5.0;# ohms\n",
    "R3=2.0;# ohms\n",
    "#Calculations\n",
    "#We apply Thevenins Theorem to solve\n",
    "#We have to find Vth and Rth\n",
    "#First Apllying KVL in the outer loop,we get\n",
    "I=2.0/6;# Amp\n",
    "Va=3-I*4# volts\n",
    "#Since 'B' is attached to negative potential\n",
    "Vth=Vab=Va-0;# volts\n",
    "#Then we find Rth\n",
    "Rth=Rab=2*4/(2+4);# ohm\n",
    "IL=Vth/(Rth+RL);# Load Current in Amp\n",
    "print \"Current through R=5ohm is %f Amperes\"%IL\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5 Page No:14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The power delivered to 'R' is maximum when R=r/2\n",
      "Maximum Power transferred is Pmax=E**2/(2*r)\n"
     ]
    }
   ],
   "source": [
    "from sympy import Symbol\n",
    "#Given Data\n",
    "#Two batteries of emf E with internal resistances 'r'\n",
    "#Calculations\n",
    "#Case(a)\n",
    "#Open circuiting the branch containing 'R'\n",
    "#and short circuiting 'E'\n",
    "E=Symbol('E');\n",
    "r=Symbol('r');\n",
    "Rth=r*r/(r+r);# Thevenin's Eq. Resistance in Ohm\n",
    "print \"The power delivered to 'R' is maximum when R=%s\"%Rth; #According to the maximum power transform theorem\n",
    "#case(b)\n",
    "#Applying Parallel Theorem\n",
    "Vth=E; # Vth is Thevenin's Voltage\n",
    "#Pmax=(IL**2)*R\n",
    "Pmax=(Vth/(2*Rth))**2*Rth;# R=Rth, Pmax is Maximum power tranferred\n",
    "print \"Maximum Power transferred is Pmax=%s\"%Pmax;\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## Solved Questions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.1 Page No:33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Input Power=444.44 KW\n",
      "Power Factor=-0.998612\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import degrees,arctan,cos\n",
    "#Given\n",
    "#For a 3ph motor\n",
    "VL=2000; #in volts\n",
    "f=50;# Hz\n",
    "nFL=0.9;#Full load Efficiency\n",
    "W1=300;#Wattmeter-1 Reading in KW\n",
    "W2=100;#Wattmeter-2 Reading in KW\n",
    "#Calculations\n",
    "#(i)\n",
    "Po=W1+W2;#Outout Power\n",
    "Pin=Po/nFL;#Input Power\n",
    "#(ii)\n",
    "ph=degrees(arctan(((W2-W1)*math.sqrt(3))/(W1+W2)));\n",
    "pf=cos(ph);\n",
    "#Display\n",
    "print\"Input Power=%.2f KW\"%Pin;\n",
    "print\"Power Factor=%f\"%pf;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.2 Page No:34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Line Current=23.09Amperes\n",
      "Power factor=0.800000\n",
      "Power=12.800000 KW\n",
      "Total Volt Ampere=16.00 KVA\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arctan2,degrees,cos\n",
    "#Given\n",
    "#A balanced star connected load\n",
    "Zph=8+1j*6;#Ohm\n",
    "VL=400;#Line voltage inVolts\n",
    "#Calculations\n",
    "#(i)\n",
    "Vph=VL/math.sqrt(3);#Phase Voltage\n",
    "Iph=Vph/abs(Zph);#Phase Current\n",
    "IL=Iph;#Line current\n",
    "#(ii)\n",
    "pf=cos(arctan2(Zph.imag,Zph.real));#Power factor\n",
    "#(iii)\n",
    "P=math.sqrt(3)*VL*IL*pf*10**-3;#Power\n",
    "#(iv)\n",
    "VA=math.sqrt(3)*VL*IL*10**(-3);#Volt Ampere\n",
    "#Display\n",
    "print\"Line Current=%.2fAmperes\"%IL;\n",
    "print\"Power factor=%f\"%pf;\n",
    "print\"Power=%f KW\"%P;\n",
    "print\"Total Volt Ampere=%.2f KVA\"%VA;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Q.3 Page No:35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Line current=3.264397 amp\n",
      "Power Absorbed=1.600000 KW\n",
      "Total KVA=2.261641 KVA\n",
      "Power Factor=0.707451\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arctan2,cos,degrees\n",
    "#Given\n",
    "#Each phase of a star connected load has\n",
    "R=100;# Resistance in Ohm\n",
    "C=31.8*10**(-6);# Capacitance in Farad\n",
    "#Connected to 3-ph\n",
    "VL=400;#Volts\n",
    "f=50;#Hz\n",
    "#Calculations\n",
    "Xc=1/(2*math.pi*f*C);#Capacitive Reactance in Ohm\n",
    "num=R*-1j*Xc;#Ohm\n",
    "den=(R-1j*Xc);\n",
    "Z=(num*den.conjugate())/(den*den.conjugate()); #Impedance\n",
    "#(i)\n",
    "Vp=VL/math.sqrt(3);#Phase voltage\n",
    "IL=Vp/abs(Z);#Line current\n",
    "#(ii)\n",
    "ph=arctan2(Z.imag,Z.real); #Phase angle\n",
    "TKVA=math.sqrt(3)*VL*IL*10**(-3);# Total Power\n",
    "P=TKVA*cos(ph);\n",
    "pf=cos(ph);#Power factor\n",
    "#Display\n",
    "print\"Line current=%f amp\"%IL;\n",
    "print\"Power Absorbed=%f KW\"%P;\n",
    "print\"Total KVA=%f KVA\"%TKVA;\n",
    "print\"Power Factor=%f\"%pf;\n",
    "#Answer differs slightly from TEXTBOOK"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Q.4. Page No:36"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Line voltage=461.88 volt\n",
      "Phase voltage=266.67 volt\n",
      "KVAR input=16.703293 KVAR\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arccos,sin\n",
    "#Given\n",
    "#The load connectted to a 3-ph supply comprises\n",
    "Pkva=20;#in KVA\n",
    "Pkw=11.0;#in KW\n",
    "IL=25;#Line Current in Amp\n",
    "#Calculations\n",
    "ph=arccos(Pkw/Pkva);\n",
    "Pkvar=Pkva*sin(ph);#in KVAR\n",
    "VL=20*10**3/(math.sqrt(3)*IL);\n",
    "Vph=VL/math.sqrt(3);\n",
    "#Display\n",
    "print\"Line voltage=%.2f volt\"%VL;\n",
    "print\"Phase voltage=%.2f volt\"%Vph;\n",
    "print\"KVAR input=%f KVAR\"%Pkvar;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.5. Page No:37"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Resistance across Delta Circuit=60.000000 Ohm\n",
      "Current flowing through them=6.67 Amp\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Given\n",
    "#A star circuit and a delta circuit\n",
    "#In star circuit\n",
    "VL1=400.0;#volts\n",
    "R1=20.0;#ohm\n",
    "#In Delta Circuit\n",
    "VL=400;#volt\n",
    "#Calculations\n",
    "Vph1=VL1/math.sqrt(3); #Phase Voltage-1\n",
    "Iph1=Vph1/R1; #Phase current-1\n",
    "IL1=Iph1; #Line current-1\n",
    "#In Delta circuit\n",
    "IL2=IL1; # Line current-2\n",
    "VL2=VL1; #line voltage-2\n",
    "Vph2=VL2; #Phase voltage-2\n",
    "Iph2=IL2/math.sqrt(3);#Phase current-2\n",
    "R2=Vph2/Iph2;#Resistance in  Ohm\n",
    "#Display\n",
    "print\"Resistance across Delta Circuit=%f Ohm\"%R2;\n",
    "print\"Current flowing through them=%.2f Amp\"%Iph2;\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Q.6. Page No:37"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Phase current=27.712813 A\n",
      "Power consumed=6.400000 KW\n",
      "Phasor sum of all line currents= 0\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Given\n",
    "#A 3-ph supply connected to balanced delta load\n",
    "VL=Vph=400; #in volts\n",
    "Zph=15+1j*20; #Ohm\n",
    "#Calculations\n",
    "#(i)\n",
    "Iph=Vph/abs(Zph); #Phase current\n",
    "#(ii)\n",
    "P=Iph**2*abs(Zph)*10**-3; #Power\n",
    "#(iii)\n",
    "IL=math.sqrt(3)*Iph; #Line current\n",
    "#Display\n",
    "print\"Phase current=%f A\"%IL;\n",
    "print\"Power consumed=%f KW\"%P;\n",
    "print\"Phasor sum of all line currents=\",0;\n",
    "#SOLUTION IN THE TEXTBOOK IS WRONG"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Q.7 Page No:38"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Line Voltage=346.41 V\n",
      "On reversing the phase connections,Line voltage remains unaffected\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "#In a 3-ph Star connected System\n",
    "Vp=200;#Phase voltage in volts\n",
    "#Calculations\n",
    "#(a)\n",
    "VL=math.sqrt(3)*Vp; #Line Voltage in volts\n",
    "#(b)\n",
    "#Line voltage remains unaffected\n",
    "#Display\n",
    "print\"Line Voltage=%.2f V\"%VL;\n",
    "print\"On reversing the phase connections,Line voltage remains unaffected\";"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.8 Page No:39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total Power drawn=600.000000 Watts\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import cos\n",
    "import cmath\n",
    "#Given\n",
    "#A 3-ph supply connected to 3-ph load\n",
    "Vp=200; #Phase Voltage in volts\n",
    "Zp=cmath.rect(100,60*math.pi/180); #Phase Impedance\n",
    "#Calculations\n",
    "Ip=Vp/abs(Zp); #Phase current in Amp\n",
    "P=Vp*Ip*cos(cmath.phase(Zp)); #Power in Watts\n",
    "P3ph=3*P;#3-ph Power\n",
    "#Display\n",
    "print\"Total Power drawn=%f Watts\"%P3ph;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.9 Page No:39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "W1=-4.843135 KW\n",
      "W2=34.843135 KW\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arccos,cos\n",
    "#Given\n",
    "#A 3-ph motor\n",
    "VL=500.0; #Line voltage in watts\n",
    "pf=0.4; #Power factor\n",
    "P=30*10**3; #Total power in KW\n",
    "#Calculations\n",
    "ph=arccos(pf);\n",
    "IL=P/(math.sqrt(3)*VL*pf);\n",
    "W1=VL*IL*cos((30*math.pi/180)+ph)*10**(-3); #Wattmeter-1 in KW\n",
    "W2=VL*IL*cos((30*math.pi/180)-ph)*10**(-3); #Wattmeter-2 in KW\n",
    "#Display\n",
    "print\"W1=%f KW\"%W1;\n",
    "print\"W2=%f KW\"%W2;\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.10 Page No:39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Power=6.000000 KW\n",
      "Power factor=0.654654\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arctan\n",
    "#Given\n",
    "#In a particular measuremet\n",
    "W1=5000; #Wattmeter-1 reading\n",
    "W2=1000;#Wattmeter-2 reading\n",
    "#Calculations\n",
    "P=(W1+W2)*10**-3; #Power\n",
    "pf=cos(arctan(math.sqrt(3)*(W2-W1)/(W1+W2))); #Power Factor\n",
    "#display\n",
    "print\"Power=%f KW\"%P;\n",
    "print\"Power factor=%f\"%pf;\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.11 Page No:40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "W1=6.380724 watts\n",
      "W2=50.037023 watts\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from numpy import arctan,arccos,cos\n",
    "#Given\n",
    "# A 3-ph motor has\n",
    "VL=400.0; #Line voltage in volts\n",
    "pf=0.75; #Power factor\n",
    "P=26*10**3; #Power\n",
    "#Calculations\n",
    "ph=math.degrees(arccos(pf)); #Phase angle\n",
    "IL=P/(math.sqrt(3)*VL*pf); #Line current\n",
    "W1=VL*IL*cos(math.radians(30+ph))*10**(-3); #Wattmeter Reading-1\n",
    "W2=VL*IL*cos(math.radians(30-ph))*10**(-3);#Wattmeter Reading-2\n",
    "#Display\n",
    "print\"W1=%f watts\"%W1;\n",
    "print\"W2=%f watts\"%IL;\n",
    "#Answers differing from Textbook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Q.12 Page No:40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Power Factor=-0.804634\n"
     ]
    }
   ],
   "source": [
    "#In 3-ph supply\n",
    "#Given\n",
    "W1=1200; #Wattmeter Reading -1\n",
    "W2=300; #Wattmeter Reading-2\n",
    "#Calculations\n",
    "pf=arctan(math.sqrt(3)*(W2-W1)/(W1+W2)); #Power factor\n",
    "#Display\n",
    "print\"Power Factor=%f\"%pf;\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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}