# EXAMPLE-2-1 EXAMPLE-59
t=0.5;
x=115.;
z=310.6 # time
AV=0.2*x; # average value
RMS=(1./10.)*z; # rms value
F=RMS/AV; # form factor
PF=60./RMS; # peak factor
S=60./(2.)**0.5; # rms value of sine wave
print '%s %.2f %s' %('i)R.M.S =',RMS,' V')
print '%s %.2f %s' %('i) average value = ',AV,' V')
print '%s %.2f' %('i)orm factor = ',F)
print '%s %.2f' %('i peak factor =',PF)
print '%s %.2f %s' %('i)sine wave =',S,' V')
# EXAMPLE 2-3 PG NO-59-60
Vm=1.;
AV1=0.318*Vm; # avegare value
RMS1=0.5*Vm; # RMS value
FF1=RMS1/AV1; # Form Factor
PF1=Vm/RMS1; # Peak Factor
AV2=0.637*Vm; # Average value
RMS2=0.707*Vm; # RMS value
FF2=RMS2/AV2; # Form Factor
PF2=Vm/RMS2; # Peak Factor
print'i)Form Factor = ',round(FF1,2)
print'i)peak Factor = ',round(PF1,2)
print'i)Form Factor = ',round(FF2,2)
print'i)PEAK Factor = ',round(PF2,2)
# EXAMPLE 2-7 PG NO 64-65
V1=24.15+1j*6.47; # VOLTAGE
V2=7.5+1j*12.99; # VOLTAGE
X=V1+V2; # ADITION fo v1&v2
print'i)ADITION is in rectangular form = ',X,' V'
X1=V1-V2; # subsraction of v1&v2
print'i)substraction is in rectangular form = ',X1,' V'
# EXAMPLE 2-8 PG NO-65
A=3.+1j*1;
B=4.+1j*3;
X=A+B; # ADDITION
Y=A-B; # SUBSTRACTION
Z=A*B; # MULTIPLICATION
U=A/B; # DIVISION
V=A**4.;
P=B**(1./3.);
print'ii) ADDITION (A+B) is in polar form = ',X,'ohm'
print'ii) SUBSTRACTION (A-B) is in polar form = ',Y,'ohm'
print'ii) MULTIPLICATION (A*B) is in polar form = ',Z,'ohm'
print'ii) DIVISION (A/B) is is in polar form = ',U,'ohm'
print'ii) SQUARE OF A(A**4) is in polar form = ',V,'ohm'
print'ii) CUBE ROOT OF B (B**(1/3)) is in polar form = ',P,'ohm'
# EXAMPLE 2-9 PG NO-65
from math import cos
t1=0.0025; # time
t2=0.005; # time
t3=0.01; # time
i1=10.*314.16*cos(314.16*t1); # i1 is derivatives of i wrt t;
print'i) Current = ',round(i1,2),'A'
i2=10*314.16*cos(314.16*t2);
print'ii) Current = ',round(i2,2),'A'
i3=10*314.16*cos(314.16*t3);
print'iii) Current = ',round(i3,2),'A'
# EXAMPLE 2-10 PG NO-66
I1=5; # current
I2=7.071; # current
RMS=(I1*I1+I2*I2)**0.5; # resultant rms value
print '%s %.2f %s' %('i) RMS = ',RMS,'A ')
# EXAMPLE 2-11 PG NO-66
import math
W=314.16;
PV=14.14; # PEAK VALUE
t=0.0025; # TIME
i=PV*math.sin(W*t); # CURRENT
T=0.0175; # TOTAL TIME
I=PV*math.sin(W*T);
print '%s %.2f' %('ii) CURRNT (i) is = ',i);
print '%s %.2f' %('ii) CURRNT (I) is = ',I);
# EXAMPLE 2-12 PG NO-66-67
import math
W1=80*math.pi; # womega
W2=100*math.pi;
PV=14.14; # peak value
t1=0.025; # time
t2=0.05;
t3=0.075;
I1=PV*(math.cos(80.*math.pi*t1)+math.cos(100.*math.pi*t1)); # current
I2=PV*(math.cos(80.*math.pi*t2)+math.cos(100.*math.pi*t2)); # current
I3=PV*(math.cos(80.*math.pi*t3)+math.cos(100.*math.pi*t3)); # current
print '%s %.2f %s' %('ii) CURRNT (I) is = ',I1,' A');
print '%s %.2f %s' %('ii) CURRNT (I) is = ',I2,' A ');
print '%s %.2f %s' %('ii) CURRNT (I) is = ',I3,' A ');
# EXAMPLE 2-13 PG NO-67
T=20.*10.**-3.; # TIME PERIOD
Ta=300.*10.**-3.; # TOTAL AREA
A=(Ta)/T; # AVERAGE VALUE
print '%s %.2f %s' %('ii) AVERAGE VALUE (A) is = ',A,' V ');
# EXAMPLE 2-14 PG NO-67
Ta=5.; # TOTAL AREA
T=20.*10.**-3.; # TIME
Av=Ta/T; # AVERAGE VALUE
Ev=(Av)**0.5; # EFFECTIVE VALUE
FF=Ev/15.; # FORM FACTOR
print '%s %.2f' %('ii) AVERAGE VALUE (Av) is = ',Av);
print '%s %.2f %s' %('ii) EFFECTIVE VALUE (Ev) is = ',Ev,'V');
print '%s %.2f' %('ii) FORM FACTOR (FF) is = ',FF);
import math
Eav=50.; # in volts
T=2; # time
E=((1./T)*2500.*2.66)**0.5; # energy # integrate('0','t',2)=2.66
print '%s %.2f %s' %('i) Energy = ',E,'V ');
FF=E/Eav; # form factor
print '%s %.2f' %('i) Form Factor = ',FF);
# EXAMPLE 2-16 PG NO 68
import math
Eav=2.5; # AVERAGE ENERGY
E=8.333;
print '%s %.2f %s' %('i) ENERGY (E) is = ',math.sqrt(E),' V ');
FF=math.sqrt(E)/Eav;
print '%s %.2f' %('ii) Form Factor (FF) is = ',FF);
# EXAMPLE 2-17 PG NO-69
I1=10.; # CURRENT
I2=-4.;
I3=2.;
I4=0;
T=8.; # TIME
Irms=(((I1*I1*2)+(I2*I2*2)+(I3*I3*2)+(I4*I4*2))/T)**0.5; # RMS
print '%s %.2f %s' %('ii) CURRENT R.M.S (Irms) is = ',Irms,' A ');
# EXAMPLE 2-20 PG NO-70
import math
T=0.03; # TIME
# (1000*integrate('0','t',0.01,0.01))**2=-0.333
# 100*integrate('0.01','t',0.02,0.02)=-1
# integrate('0.02', '',0.03,0.03)]=0
V=(-0.33-1.)/T;
print '%s %.2f %s' %('i) Voltage (V) is = ',V,' V ');
print '%s %.2f %s' %('i) Square Root of Voltage (V) is = ',math.sqrt(-V),' seconds ');
# EXAMPLE 2-21 PG NO-70
import math
T=0.05; # TIME
# (400*integrate('0','t',0.025,))**2=--0.8333
# 100*integrate('0.01','t',0.02,0.02)=-1.738
V=(-0.833-1.738*10**-86)/T;
print '%s %.2f %s' %('i) Voltage (V) is = ',V,' V ');
print '%s %.2f %s' %('i) Square Root of Voltage (V) is = ',math.sqrt(-V),' seconds ');
# EXAMPLE 2-22 PG NO-70-71
import math
A=math.pi/2.;
# integrate(wt)=math.pi/6
Eavg=1./A*(math.pi+math.pi)/6.;
print '%s %.2f %s' %('i) Average Energy (Eavg) is =',Eavg,' Em ');
# EXAMPLE 2-23 PG NO-71
import math
A=math.pi/2;
# [integrate('0',wt,'math.pi/3')]**2=math.pi/9
# integrate('math.pi/3',wt,'math.pi/2')=math.pi/6;
E=1./A*((math.pi/9.)+(math.pi/6.));
print '%s %.2f %s' %('i) Energy (E) is = ',E,' ');
print '%s %.2f' %('ii) Square Energy (E) is = ',math.sqrt(E));
FF=(math.sqrt(E)*3.)/2.;
print '%s %.2f' %('iii) FORM FACTOR (FF) is = ',FF);
# EXAMPLE 2-24 PG NO 71
# integration of is=1008sinQ**2=0.5
import math
I=150.; # CURRENT
print '%s %.2f %s' %('i) CURRENT (I**2) is = ',I,' A ');
print '%s %.2f %s' %('ii) CURRENT (I) is = ',math.sqrt(I),' A ');
# EXAMPLE 2-25 PG NO-72
V1=50.+1j*0;
V2=37.5-1j*64.95;
X=V1+V2; # ADDITION OF V1&V2
print 'ii) ADDITION (X) is in polar form = ',X,' V '
# EXAMPLE 2-26 PG NO-72
import math
V=200.;
R=100.;
R1=500.;
R2=0.9009; # resistance
RMS1=V/(R+R); # RMS
print '%s %.2f %s' %('ii) CURRENT R.M.S in forward (R.M.S.1) is = ',RMS1,' A ');
RMS2=-V/(R+R1);
print '%s %.2f %s' %('ii) CURRENT R.M.S in Backward (R.M.S.2) is = ',RMS2,' A ');
I1=RMS1*R2; # Current
print '%s %.2f %s' %('ii) Average CURRENT in forward (I1) is = ',I1,' A ');
I2=RMS2*R2;
print '%s %.2f %s' %('ii) Average CURRENT in Backward (I2) is = ',I2,' A ');
A=(I1+I2)/2; # Ammeter
print '%s %.2f %s' %('ii) Reading of moving coil ammeter (A) is = ',A,' A ');
HA=(0.5*(RMS1+(RMS2)**2))**0.5; # HOT AMMETER
print '%s %.2f %s' %('ii) Reading of hot wire ammeter (H.A) is = ',HA,' A ');
P=0.5*((RMS1*V)+(RMS2*RMS2*600)); # POWER
print '%s %.2f %s' %('ii) TOTAL AVERAGE POWER (P) is = ',P,' W ');
P1=0.5*((RMS1*R)+(RMS2*RMS2*R1));
print '%s %.2f %s' %('ii) TOTAL POWER dissipated in rectifier (P) is = ',P1,' W ');
# EXAMPLE 2-27 PG NO 74
import math
F=50.
V=230.; # voltage
R=20.; # resisance
I=V/R; # current
P=V*I; # power
Im=I*1.414; # Maximum current
W=2.*math.pi*F;
print '%s %.2f %s' %(' current is = ',I,' A');
print '%s %.2f %s' %(' POWER is = ',P,' W');
print '%s %.2f %s' %(' MAXIMUM CURENT is = ',Im,' A');
print '%s %.2f %s' %(' W is = ',W,' ');
# EXAMPLE 2-28 PG NO-76
import math
F=50.; # Frequency
L=0.2; # inductance
XL1=500.;
XL=(2*math.pi*F*L);
f=XL1/(2.*math.pi*L); # FREQUENCY
print '%s %.2f %s' %(' XL is = ',XL,' ohms');
print '%s %.2f %s' %(' frequency is = ',f,' Hz');
# EXAMPLE 2-29 PG NO=77-78
import math
V=230.;
F=50.; # Frequency
C=10.*10.**-6.; # Capacitor
Xc=1./(math.pi*2.*F*C);
Bc=1./Xc;
I=V/Xc; # susceptance current
print '%s %.2f %s'%(' Xc is = ',Xc,' ohms');
print '%s %.2e %s'%(' Bc is = ',Bc,' siemens');
print '%s %.2f %s'%(' Current is = ',I,' A');
# EXAMPLE 2-30 PG NO-81-82
from math import pi,cos,sin
V=230.+1j*0;
F=50.;
L=0.03;
R=20.;
XL=2.*pi*F*L;
print'i) INDUCTANCE (XL) is in polar form = ',XL,' ohm '
Z=R+1j*XL;
print'ii) IMPEDANCE (Z) is in polar form = ',Z,' ohm '
Y=1/Z;
print'iii) ADMITTANCE (Y) is in polar form = ',Y,' siemens '
I=V/Z;
print'iv) CURRENT (I) is in polar form = ',I,'A '
Vr=I*R;
print'v) VOLTAGE (Vr) is in polar form = ',Vr,' V '
VL=1j*XL*I
print'vi) VOLTAGE (VL) is in polar form = ',VL,' V '
Q=25.23; # TETA
PF=cos(Q);
print'vi) POWER FACTOR (PF) is = ',PF,' lagging '
P=V*I*cos(Q); # ACTIVE POWER
print'vi) ACTIVE POWER (P) is in polar form = ',P,' W '
q=V*I*sin(Q)
print'vi) REACTIVE POWER (q) is in polar form = ',q,' W '
S=230*10.4;
print'vi) APPARENT POWER (S) is in polar form = ',S,' VA '
# EXAMPLE 2-31 PG NO=82
Z1=20.15+1j*15.18;
Z2=6.99+1j*17.29;
Z=Z1+Z2; # impedance
V=230+1j*0;
I=V/Z; # Current
PF=0.64; # Power Factotr
S=V*I; # Apparent Power
P=S*PF; # Active Power
print' Impedanceis in rectangular form = ',Z,' ohm'
print' current is in rectangular form = ',I,' A'
print' S is in rectangular form = ',S,'VA'
print' POWER is in rectangular form = ',P,'W'
# EXAMPLE 2-32 PG NO-83
cos30=0.866;
sin30=0.5;
E1=141.42+1j*0;
E2=144.566+1j*11.976;
V=E1+141.42*(cos30 * sin30 );
print'1) Voltage is in rectangular form = ',V,'W'
Z=8+1j*6; # IMPEDANCE
I=V/Z;
print'1) Current is in rectangular form = ',I,'A'
P=I*V*0.743;
print' POWER is in rectangular form = ',P,'W'
# EXAMPLE 2-33 PG NO-84-85
from math import pi
V=230.+1j*0; # Voltage
F=50.; # Frequency
C=10.**-4.; # Capacitor
R=10.; # Resistance
XC=1./(2.*pi*F*C); # Capacitor
print'i) CAPACITOR (XC) is in polar form = ',XC,'ohm '
Z=R-1j*XC; # Impedance
print'ii) IMPEDANCE (Z) is in polar form = ',Z,' ohm '
Y=1/Z; # Admittance
print'iii) ADMITTANCE (Y) is in polar form = ',Y,' siemens '
I=V/Z; # current
print'iv) CURRENT (I) is in polar form = ',I,' A '
Vr=I*R; # Voltage
print'v) VOLTAGE (Vr) is in polar form = ',Vr,' V '
VC=1j*XC*I # Voltage
print'vi) VOLTAGE (VL) is in polar form = ',VC,'V'
# EXAMPLE 2-34 PG NO-85
V=80.+1j*60; # voltage
I=-4.+1j*10; # current
Z=V/I; # Impedance
PF=0.26; # power factor
P=V*I*PF; # Power
print' IMPEDANCE is in rectangular form = ',Z,'ohm'
print' POWER is in rectangular form = ',P,' W'
# EXAMPLE-2-35 PG NO-86
from math import pi,sqrt
Vr=100.; # VOLTAGE
P=300.; # POWER
I=P/Vr; # CURRENT
V=240.; # voltage
F=50.; # frequency
Z=V/I; # IMPEDANCE
R=Vr/I;
Xc=(Z**2.-R**2.)**0.5;
C=1./(2.*F*pi*Xc); # CAPACITOR
Vc=((V*V)-(Vr*Vr))**0.5;
Vm=sqrt(2.)*Vc;
Qm=(sqrt(2.)*Vc)*(C); # CHARGE
Em=0.5*(Xc*Vm*Vm); # MAXIMUM ENERGY
print'i) CURRENT (I) is = ',round(I,2),'A'
print'ii) IMPEDANCE (Z) is = ',round(Z,2),'ohm'
print'iii) RESISTANCE (R) is = ',round(R,2),'ohm'
print'i) CAPACITOR (Xc) is = ',round(Xc,2),'ohm'
print'i) CAPACITOR (C) is = ',round(C,2),'F'
print'i) VOLTAGE (Vc) is = ',round(Vc,2),'V'
print'i) MAXIMUM VOLTAGE (Vm) is = ',round(Vm),'V'
print'i) MAXIMUM CHARGE (Qm) is = ',round(Qm,2),'C'
print'i) MAXIMUM ENERGY (Em) is = ',round(Em,2),'J'
# EXAMPLE 2-36 PG NO-87
from math import pi
F=50.; # FREQUENCY
L=0.2; # INDUCTANCE
C=150.*10.**-6.; # CAPACITOR
R=20.;
V=230.;
XL=2.*pi*L*F;
print'i) INDUCTANCE (XL) is = ',XL,' ohm '
XC=1./(2.*pi*F*C)
print'i) CAPACITOR (Xc) is = ',XC,' ohm '
Z=R+1j*(XL-XC)
print'i) IMPEDANCE (Z) is in polar form = ',Z,' ohm '
I=V/Z; # CURRENT
print'i) CURRENT (I) is in polar form = ',I,' ohm '
AP=V*I; # APPARENT POWER
print'i) Apparent Power (AP) is in polar form = ',AP,' VA '
P=V*I*0.433; # active power
print'i) ACTIVE POWER (P) is in polar form = ',P,' W '
Q=V*I*0.9013; # Reactive Power
print'i) Reactive Power (Q) is in polar form = ',Q,' vars '
# EXAMPLE 2-37 PG NO-88
Xc=4.;
XL=6.;
R=2.; # RESISTANCE
v=8.48+1j*30.;
Z=R+1j*(XL-Xc); # IMPEDANCE
V=v;
I=V/Z; # CURRENT
VL=1j*I*XL;
Vc=-1j*I*Xc;
P=V*I*0.707; # ACTIVE POWER
print'i) Active Power = ',P,' W'
print'ii) Impedance = ',Z,' ohm'
print'iii) Current is = ',I,' A'
print'iv) VL is = ',VL,' V'
print'v)Vc is = ',Vc,' V'
# EXAMPLE 2-38 PG N0-88-89
Z=12.-1j*5;
V=100.; # VOLTAGE
I=V/Z; # CURRENT
print'i) CURRENT (I) is in polar form = ',I,'A'
Z1=4.+1j*3;
Z2=6.-1j*8; # impedance
V1=I*Z1;
print'i) voltage (V1) is in polar form = ',V1,' V '
V2=I*Z2; # voltage
print'i) voltage (V2) is in polar form = ',V2,' V '
V3=2.*I; # voltage
print'i) voltage (V3) is in polar form = ',V3,' V '
P=V*I*0.9230; # ACTIVE POWER
print'i) Active Power (P) is in polar form = ',P,' W '
# EXAMPLE-2-39 PG NO-89
V=7.07;
I=4.24;
W=500;
S=V*I;
cosQ=0.6428;
sinQ=0.766;
P=S*cosQ; # ACTIVE POWER
Q=S*sinQ; # REACTIVE POWER
Z=V/I; # IMPEDANCE
R=Z*cosQ; # RESISTANCE
Xc=Z*sinQ; # Xc
C=1/(W*Xc); # CAPACITOR
P2 =S*(cosQ-1); # NEGATIVE PEAK POWER
P3 =S*(cosQ+1); # POSITIVE PEAK POWER
P1=(P3 +P2)/2; # POWER
S1=(P3-P1); # apparent power
print' S is = ',round(S,2),' VA'
print' ACTIVE POWER is = ',round(P,2),' W'
print' REACTIVE POWER is = ',round(Q,2),' VAr'
print' IMPEDANCE is = ',round(Z,2),' ohm'
print' RESISTANCE is = ',round(R,2),'ohm '
print' Xc is = ',round(Xc,2),' ohm'
print' CAPACITOR is = ',round(C,2),' F'
print' POWER CURVE is = ',round(P2,2),' W'
print' POWER CURVE is = ',round(P3,2),' W'
print' POWER is = ',round(P1,2),' W'
print' S is = ',round(S1,2),' VA'
# EXAMPLE 2-40 PG NO-89-90
V1=52.33-1j*34.15878;
Z1=7.5-1j*9.999; # IMPEDANCE
Z2=3.488+1j*12; # IMPEDANCE
Z3=11.99+1j*5;
V2=(Z2/Z1)*V1;
print'i) voltage (V2) is in polar form = ',V2,' V '
V3=(Z3/Z1)*V1; # voltage
print'ii) voltage (V3) is in polar form = ',V3,' V '
V=V1+V2+V3; # total voltage
print'i) voltage (V) is in polar form = ',V,' V '
Z=Z1+Z2+Z3; # Total Impedance
print'i) IMPEDANCE (Z) is in polar form = ',Z,' V '
Y=1./Z; # Admittance
print'i) Y (Y) is in polar form = ',Y,' ohm '
# EXAMPLE 2-41 PG NO-90
import math
F1=50.; # frequency
W=(2.*math.pi*F1);
L=1.; # inductar
C=10.**-6.; # capacitor
XL1=W*L;
Xc1=1./(W*C);
Z1=XL1-Xc1;
F2=1000.;
XL2=(2.*math.pi*F2*L);
Xc2=1./(2.*math.pi*F2*C);
Z2=(XL2-Xc2); # impedance
print' IMPEDANCE(Z1) is = ',round(Z1,2),'ohm'
print' IMPEDANCE(Z2) is = ',round(Z2,2),'ohm'
print' XL1 is = ',round(XL1,2),'ohm'
print' Xc1 is = ',round(Xc1,2),'ohm'
print' XL2 is = ',round(XL2,2),'ohm'
print' Xc2 is = ',round(Xc2,2),'ohm'
# EXAMPLE 2-42 PG NO-90
import math
F=50.; # frequency
C=100.*10.**-6.; # capacitor
W=(2.*math.pi*F);
Xc=1./(W*C);
R=19.1; # resistance
XL=25.46;
L=XL/(2.*math.pi*F); # inductance
print' Xc is = ',round(Xc,2),'ohms'
print' INDUCTANCE is = ',round(L,2),'H'
# EXAMPLE 2-43 PG NO-91
R1=6.; # RESISTANCE
R2=3.; # RESISTANCE
R3=8.; # RESISTANCE
Z1=7.; # IMPEDANCE
Z2=5.; # IMPEDANCE
Z3=10.; # IMPEDANCE
V=7.;
I=1.;
PF1=R1/Z1; # POWER FACTOR
print'i) Power Factor (PF1) is = ',round(PF1,2)
PD1=V*I*0.857; # POWER dissipated
print'i) Power Dissipated (PD1) is = ',round(PD1,2),'W'
PF2=R2/Z2;
print'iii) Power Factor (PF2) is = ',round(PF2,2),'W'
PD2=Z2*PF2;
print'i) Power Dissipated (PD2) is = ',round(PD2,2),'W'
PF3=R3/Z3;
print'iii) Power Factor (PF3) is = ',round(PF3,2),'W'
PD3=Z3*PF3;
print'i) Power Dissipated (PD3) is = ',round(PD3,2),' W '
A=(Z1**2-R1**2)**0.5;
print'i) REACTANCE OF COIL (A) is = ',round(A,2),' ohm '
B=(Z2**2-R2**2)**0.5;
print'i) REACTANCE OF COIL (B) is = ',round(B,2),' ohm '
C=(Z3**2-R3**2)**0.5;
print'i) REACTANCE OF COIL (C) is = ',round(C,2),' ohm '
TR=R1+R2+R3; # TOTAL RESISTANCE
print'i) TOTAL RESISTANCE (TR) is = ',round(TR,2),' ohm '
TRC=A+B+C; # TOTAL RACTANCE
print'i) TOTAL REACTANCE (TRC) is = ',round(TRC,2),' ohm '
TI=(TR**2+TRC**2)**0.5; # TOTAL IMPEADNCE
print'i) TOTAL IMPEDANCE (TI) is = ',round(TI,2),'ohm'
PF=TR/TI;# POWER FACTOR
print'i) POWER FACTOR (PF) is = ',round(PF,2),'lagging'
# EXAMPLE 2-44 PG NO 91-92
import math
R=20.; # Resistance
V=125.; # VOLTAGE
I=2.2; # CURRENT
Z=V/I; # IMPEDANCE
print'i) Impedance is = ',round(Z,2)
F=50.; # FREQUENCY
XC=53.18
C=1./(2.*math.pi*F*XC); # CAPACITANCE
print'ii) Capacitor is = ',round(C,2),'F'
# EXAMPLE 2-45 PG NO-92
import math
I=10.; # CURRENT
R=5.; # RESISTANCE
P=I*I*R; # POWER
IL=250.; # IRON LOSS
Z=20.;
r=5.;
F=50.;
W=2.*math.pi*F;
p1=750.;
v=200.; # voltage
L=(Z*Z-r*r)**0.5/W; # iductance
cosQ=p1/(v*I);
print' power is = ',round(P,2),'W'
print' inductance is = ',round(L,2),'H'
print' cos Q is = ',round(cosQ,2),'lagging'
# Example 2-46 PG NO-92
from math import sin,pi,sqrt
Z=50.+1j*49.95; # IMPEDANCE
V=283.; # VOLTAGE
T=1.; # ASSUMING
i=(V/70.675)*(sin(100.*pi-44.97));
print'i) Current (i) is in polar form = ',i,'A'
P=(V/sqrt(2))*(4/sqrt(2.))*(0.707);
print'ii) POWER (P) is = ',P,'W'
# EXAMPLE 2-47 PG NO 92
import math
V=100./math.sqrt(2.); # VOLTAGE
F=100.; # FREQUENCY
L=0.018; # INDUCTANCE
XL=2.*math.pi*F*L;
print'i) INDUCTANCE (XL) is in polar form = ',XL,'ohm'
I=V/((11.3+1j*11.3));# current
print'ii) CURRENT (I) is in polar form = ',I,'A'
VR=I*10.; # voltage
print'i) Voltage Across Resister (VR) is = ',VR,'V'
# EXAMPLE 2-49 PG NO-93
import math
K=0.35; # CONSTANT
L1=0.1; # INDUCTANCE
L2=0.2; # INDUCTANCE
M=K*(L1*L2)**0.5;
V=125.; # VOLTAGE
F=50.; # FREQUENCY
L=0.2; # TOTAL INDUCTANCE
I=V/(2.*math.pi*F*L); # CURRENT
print' M is = ',round(M,2),'H'
print' current is = ',round(I,2),'A'
# example 2-51 pg no-94
import math
V=230.+1j*0; # VOLTAGE
F=50.; # FREQUENCY
C=10.**-4.; # CAPACITOR
R=10.; # RESISTANCE
#cos(72.56)=0.299;
XC=1./(2.*math.pi*F*C);
print'i) INDUCTANCE (XC) is = ',XC,'ohm'
Z=R-1j*XC; # impedance
print'i) IMPEDANCE (Z) is in rectangular form = ',Z,'ohm'
Y=1/Z; # admittance
print'i) ADMITTANCE (Y) is in rectangular form = ',Y,'ohm'
I=V/Z; # CURRENT
print'i) CURRENT (I) is in rectangular form = ',I,'A'
PF=0.299; # POWER FACTOR
print'i) POWER FACTOR (PF) is = ',PF,'leading'
S=V*I; # APPARENT POWER
print'i) APPARENT POWER (S) is IN rectangular FORM = ',S,'VA'
P=V*I*0.3; # ACTIVE POWER
print'i) ACTIVE POWER (P) is in rectangular form = ',P,'W'
Q=V*I*-0.1315; # REACTIVE POWER
print'i) REACTIVE POWER (Q) is in rectangular form = ',Q,'vars'
Vr=I*R;
print'i) VOLTAGE (Vr) is in rectangular form = ',Vr,'V'
Vc=-1j*I*XC;
print'i) VOLTAGE (Vc) is = ',Vc,'V'
# EXAMPLE 2-52 PG NO-96
W=1000.;
L=0.02;
XL=W*L;
Z=4.85;
V=(100./1.414);
I=(20.62/1.414);
#cos(14.06)=0.97; #
P=V*I*0.97;
z=1.18;
Leq=z/W;
print' XL is = ',round(XL,2),'ohms'
print' POWER is = ',round(P,2),'W'
print' Leq is = ',round(Leq,2),'H'
# EXAMPLE 2-53 PG NO=97
import math
R=15.; # RESISTANCE
V=240+1j*0; # VOLTAGE
I=22.1;
Ir=V/R; # CURENT
print'i) CURRENT (Ir) is = ',Ir,'A'
IL=(I**2.-Ir**2.)**0.5;
print'i) CURRENT (IL) is = ',IL,'A'
XL=V/IL;
print'i) INDUCTANCE (XL) is = ',XL,'ohm'
L=XL/(2.*math.pi*50.);
print'i) INDUCTANCE (L) is = ',L,'H'
IL1=(34.**2.-Ir**2.)**0.5;
print'i) INDUCTANCE (IL1) is = ',IL1,'A'
F=8./(2.*math.pi*0.05);
print'i) FREQUENCY (F) is = ',F,'Hz'
# EXAMPLE 2-54 PG NO-98
from math import pi
C=159.*10.**-6.; # capacitor
F=50.; # frequency
Xc=1./(2.*pi*F*C);
Z=8.94; # impedance
V=100.; # voltage
I=V/Z; # Current
PF=0.894 # power factor
S=V*I;
P=V*I*PF;
Q=V*I*(-0.447);
print' CURRENT is = ',round(P,2),'A'
print' APPARENT POWER is = ',round(S,2),'VA'
print' active power is = ',round(P,2),'W'
print' reactive power is = ',round(Q,2),'vars'
# EXAMPLE 2-55 PG NO-99
Q=72.4;
tanQ=3.1524;
W=3000.;
C=35.*10.**-6.;
Xc=1./(W*C);
R=3.1524*Xc
print'i) CAPACITOR (XC) is = ',round(Xc,2),'ohm'
print'i) RESISTANCE (R) is = ',round(R,2),'ohm'
# EXAMPLE 2-56 PG NO-99-100
import math
V=230.+1j*0;
R=15.+1j*0;
L=1j*7.5;
Ir=V/R;
Z1=-1j*12.
print'i) CURRENT (Ir) is = ',Ir,' A'
IL=V/L;
print'i) INDUCTANCE CURRENT (IL) is = ',IL,'A'
Ic=V/Z1;
print'i) CAPACITOR CURRENT (Ic) is = ',Ic,'A'
I=Ir+IL+Ic;
print'i) CURRENT (I) is = ',I,'A'
Z=V/I;
print'i) IMPEDANCE (Z) is = ',Z,'A'
PF=0.8;
Leq=7.2/(2.*math.pi*50.);
print'i) EQUIVALENT CURRENT (Ieq) is = ',Leq,'H'
# EXAMPLE 2-57 PG N0-100-101
V=240.+1j*0;
R=400.+1j*0;
Z1=1j*50.;
Z2=-1j*40.;
IR=V/R;
print'i) CURRENT (IR) is = ',IR,'A'
IL=V/Z1;
print'i) CURRENT (IL) is = ',IL,'A'
IC=V/Z2;
print'i) CURRENT (IC) is = ',IC,'A'
I=IR+IL+IC;
print'i) CURRENT (I) is = ',I,'A'
Z=V/I;
print'i) IMPEDANCE (Z) is = ',Z,'ohms'
Y=1/Z;
print'i) ADMITTANCE (Y) is = ',Y,'ohm'
S=V*I;
print'i) APPARENT POWER (S) is = ',S,'VA'
P=V*I*0.448;
print'i) ACTIVE POWER (P) is = ',P,'W'
Q=V*I*-0.94;
print'i) REACTIVE POWER (Q) is = ',Q,'vars'
# EXAMPLE 2-58 PG NO-101-102
Z1=2.+1j*3;
Z2=1.-1j*5;
Z3=4.+1j*2;
Zeq=(Z2*Z3)/(Z2+Z3);
print'i) IMPEDANCE EQUVALENT (Zeq) is = ',Zeq,'ohms '
Z=Z1+Zeq;
print'i) TOTAL IMPEDANCE (Z) is = ',Z,'ohm '
V=10.;
R=5.65+1j*1.588;
I=V/R;
print'i) CURRENT (I) is = ',I,'A'
VBC=I*Zeq;
print'i) VOLTAGE (VBC) is = ',VBC,'V'
I2=VBC/Z2;
print'i) CURRENT (I2) is = ',I2,'A'
I3=VBC/Z3;
print'i) CURRENT (I3) is in polar form = ',I3,'A'
S=V*I;
print'i) APPARENT POWER (S) is in polar form = ',S,'VA'
P=V*I*0.963;
print'i) ACTIVE POWER (P) is in polar form = ',P,'W'
Q=V*I*-0.27;
print'i) REACTIVE POWER (Q) is in polar form = ',Q,'vars'
# EXAMPLE 2-59 PG NO-103
import math
C1=15.5*10**3;
L=1000.;
V=230.;
PL1=10.; # active load power
PL2=6.; # active load power
QL1=7.5; # reactive load power
QL2=8.; # reactiveload power
P=PL1+PL2; # total active power
Q=QL1+QL2; # total reactive power
AP=(P*P+Q*Q)**0.5; # total apparent power
I=(AP*L)/V; # TOTAL CURRENT
Ic=(C1/V);
Xc=V/Ic;
K=16.;
C=1./(2.*math.pi*50.*Xc);
I1=(L*K)/V;
print' total active power is = ',round(P,2),'KW'
print' total reactive power is = ',round(Q,2),'K var'
print' total apparent power is = ',round(AP,2),'KVA'
print' total current(I) is = ',round(P,2),'A'
print' Ic is = ',round(P,2),'A'
print' Xc is = ',round(Xc,2),'ohm'
print' capacitor is = ',round(C,2),'F'
print' current(I1) is = ',round(I1,2),'A'
# EXAMPLE 2-60 PG NO-103-104
Z1=6.+1j*8;
V=230.; # VOLTAGE
Y1=1./Z1;
print'i) ADMITTANCE (Y1) is = ',Y1,' siemens '
G1=0.06;
B1=-0.08;
Z2=4.-1j*3;
Y2=1./Z2;
print'ii) ADMITTANCE (Y2) is = ',Y2,' siemens '
G2=0.16;
B2=0.12;
TL=G1+G2; # TOTAL CONDUCTANCE
print'iii) TOTAL CONDUCTANCE (TL) is = ',TL,' siemens'
TS=B1+B2; # TOTAL SUSCEPTANCE
print'iv) TOTAL SUSCEPTANCE (TS) is = ',TS,' siemens '
I1=V*Y1; # CURRENT
print'v) CURRENT (I1) is = ',I1,' A '
I2=V*Y2;
print'vi) CURRENT (I2) is = ',I2,' A '
TI=I1+I2; # TOTAL CURRENT
print'vii) TOTAL CURRENT (TI) is = ',TI,' A '
PF=0.983;#cos(degree(10.3));
print'i) POWER FACTOR (PF) is = ',PF,' leading '
# EXAMPLE 2-61 PG NO-104-105
V=100.+1j*0;
Zab=1.6+1j*7.2;
Yab=1./Zab;
print'i) ADMITTANCE (Yab) is in polar form = ',Yab,' siemens'
Zcd=4.+1j*3;
Ycd=1./Zcd;
print'i) ADMITTANCE (Ycd) is in polar form = ',Ycd,' siemens '
Zef=6.-1j*8;
Yef=1./Zef;
print'i) ADMITTANCE (Yef) is in polar form = ',Yef,' siemens '
Ybg=Yef+Ycd;
print'i) ADMITTANCE (Ybg) is in polar form = ',Ybg,' siemens '
Zbg=1./Ybg;
print'i) IMPEDANCE (Zbg) is in polar form = ',Zbg,' ohms '
TZ=1.6+1j*7.2+4.4+1j*0.8;
print'i) TOTAL IMPEDANCE (TZ) is in polar form = ',TZ,' ohms '
TI=V/TZ;
print'i) TOTAL CURRENT (TI) is in polar form = ',TI,' A '
Icd=TI*(Zef/(Zcd+Zef))
print'i) CURRENT (Icd) is in polar form = ',Icd,' A '
Ief=TI*(Zcd/(Zcd+Zef));
print'i) CURRENT (Ief) is in polar form = ',Ief,' A '
Pab=TI*TI*1.6;
print'i) POWER (Pab) is in polar form = ',Pab,' W '
Pcd=Icd*Icd*4;
print'i) POWER (Pcd) is in polar form = ',Pcd,' W '
Pef=Ief*Ief*6;
print'i) POWER (Pef) is in polar form = ',Pef,' W '
TP=Pab+Pcd+Pef;
print'i) TOTAL POWER (TP) is in polar form = ',TP,' W '
# EXAMPLE 2-62 PG NO-105-106
Z1=24.+1j*18;
Z2=24.-1j*10;
Z3=2.-1j*0.148;
R1=24.;
R2=24.;
R3=32.;
R4=16.;
V=2.;
v1=128.3;
I=2.;
I3=32.+1j*24;
I4=16.-1j*30;
Z=Z1+Z2;
print'i) IMPEDANCE (Z) is in polar form = ',Z,' ohms '
I1=(Z2/(Z1+Z2))*Z3;
print'i) CURRENT (I1) is in polar form = ',I1,' ohms '
I2=(Z1/(Z1+Z2))*Z3;
print'i) CURRENT (I2) is in polar form = ',I2,' ohms '
P1=I1*I1*R1;
print'i) POWER (P1) is in polar form = ',P1,' W '
P2=I2*I2*R2;
print'i) POWER (P2) is in polar form = ',P2,' W '
P3=V*V*R3;
print'i) POWER (P3) is in polar form = ',P3,' W '
P4=V*V*R4;
print'i) POWER (P4) is in polar form = ',P4,' W '
P=P1+P2+P3+P4;
print'i) TOTAL POWER (P) is in polar form = ',P,' W '
V1=I1*Z1;
print'i) VOLTAGE (V1) is in polar form = ',V1,' V '
V2=V1;
print'i) VOLTAGE (V2) is in polar form = ',V2,' V '
V3=I3*Z3;
print'i) VOLTAGE (V3) is in polar form = ',V3,' V '
V4=I4*Z3;
print'i) VOLTAGE (V4) is in polar form = ',V4,' V '
V=V1+V4+V3;
print'i%) VOLTAGE (V) is in polar form = ',V,' V '
S=v1*I;
print'i) Apparent Power (S) is = ',S,' VA '
Q=S*0.0726;
print'i) Reactive Power (Q) is = ',Q,' Var '
# EXAMPLE 2-63 PG NO-106-107
Z1=14.+1j*48;
Z2=30.+1j*40;
Z3=24.+1j*70;
V=230.+1j*0;
Y1=1./Z1;
print'i) ADMITTANCE (Y1) is in polar form = ',Y1,' siemens'
Y2=1./Z2;
print'ii) ADMITTANCE (Y2) is in polar form = ',Y2,' siemens'
Y3=1./Z3;
print'iii) ADMITTANCE (Y3) is in polar form = ',Y3,' siemens'
Y=Y1+Y2+Y3;
print'i) ADMITTANCE (Y) is in polar form = ',Y,' siemens'
Z13=29.763+1j*21.62;
Z14=10.-1j*24;
X=Z13+Z14;
Y=18.+1j*80;
A=8.-1j*6;
print'i) IMPEDANCE (X) is in polar form = ',X,' ohm'
Z=((X*Y)/(X+Y))+A;
print'i) IMPEDANCE (Z) is in polar form = ',Z,' ohm'
I=V/Z;
print'vi) CURRENT (I) is = ',I,' A '
S=V*I;
print'i) Apparent Power (S) is = ',S,' VA '
P=V*I*0.989;
print'i) Active Power (P) is = ',P,' W '
Q=V*I*0.146;
print'i) Reactive Power (Q) is = ',Q,' Var '
ZA=15.+1j*15.708;
ZB=20.+1j*0;
V=200.+1j*0;
IA=V/ZA;
print'i) CURRENT (IA) is =',IA,' A '
IB=V/ZB;
print'ii) CURRENT (IB) is =',IB,' A '
I=IA+IB;
print'vi) TOTAL CURRENT (I) is =',I,' A '
# EXAMPLE 2-66 PG NO-108
I=15.;
Z1=10.+1j*15
Z2=6.-1j*8;
I1=(I*Z2)/(Z1+Z2);
print'ii) CURRENT (I1) is in polar form = ',I1,' A '
I2=(I*Z1)/(Z1+Z2);
print'ii) CURRENT (I2) is in polar form = ',I2,' A '
P1=8.59**2*10;
print'ii) Power (P1) is in polar form = ',P1,' W '
P2=15.49**2*6;
print'ii) Power (P2) is in polar form = ',P2,' W '
# EXAMPLE 2-67 PG NO-108-109
Z1=5.;
V=100.+1j*200;
I1=16.; # CURRENT
P1=I1*I1*Z1;
print'i) POWER (P1) is = ',P1,' W '
P2=5000.-P1;
print'ii) POWER (P2) is = ',P2,' W '
Q1=-69.02;
#cos(-69.02)=0.35;
Z2=Z1/0.358;
print'iii) IMPEDANCE (Z2) is in polar form = ',Z2,' ohms '
X1=Z2*-0.933;
print'i) (X1) is in polar form = ',X1,' ohms '
Z3=5-1j*13.04;
I1=V/Z3;
print'ii) CURRENT (I1) is in polar form = ',I1,' A '
P3=3720;
I2=P3/(223.6*0.8);
print'ii) CURRENT (I2) is in polar form = ',I2,' A '
z2=8.6+1j*6.45;
I3=V/z2;
print'ii) CURRENT (I3) is in polar form = ',I3,' A'
I=I1+I3;
print'ii) CURRENT (I) is in polar form = ',I,' A '
Z=V/I;
print'iii) IMPEDANCE (Z) is in polar form = ',Z,'ohms '
# EXAMPLE 2-68 PG NO-109-110
V=100.;
Y1=0.16+1j*0.12;
Y2=-1j*0.15;
I1=V*Y1;
print'i) CURRENT (I1) is in polar form = ',I1,' A '
I2=V*Y2;
print'ii) CURRENT (I2) is in polar form = ',I2,' A '
P=(V*I1*0.8)+(V*I2*0);
print'iii) Power (P) is in polar form = ',P,' W '
I=I1+I2;
print'ii) CURRENT (I) is in polar form = ',I,' A '
# EXAMPLE 2-69 PG NO-110
import math
F=50.;
L=0.6;
R=100.;
XL=(math.pi*2.*F*L)
print'i) INDUCTANCE (XL) is = ',XL,' ohm '
V=230.+1j*0;
IR=V/R;
print'ii) CURRENT (IR) is in polar form = ',IR,' A '
IL=V/(0+1j*XL);
print'iii) CURRENT (IL) is in polar form = ',IL,' A '
I=IR+IL;
print'iv) CURRENT (I) is in polar form = ',I,' A '
#cos(degree(27.9))=0.8837;
P=V*I*0.8837;
print'v) POWER (P) is in polar form = ',P,' W '
Z=V/I;
print'vi) IMPEDANCE (Z) is = ',Z,' ohm '
LEQ=41.39/(2.*math.pi*F);
print'ii) INDUCTANCE (LEQ) is = ',LEQ,' H '
# EXAMPLE 2-70 PG NO-110-111
ZA=-1j*227.36; # IMPEDANCE
ZB=-1j*795.77; # IMPEDANCE
ZC=500.; # IMPEDANCE
V=230.+1j*0; # VOLTAGE
IA=V/ZA; # CURRENT
print 'i) CURRENT (IA) is in polar form = ',IA,' A '
IB=V/ZB;
print 'i) CURRENT (IB) is in polar form = ',IB,' A '
IC=V/ZC;
print 'i) CURRENT (IC) is in polar form = ',IC,' A '
I=IA+IB+IC;
print 'i) CURRENT (I) is in polar form = ',I,' A '
P=V*I*0.334;
print 'i) POWER (P) is in polar form = ',P,' W '
Z=V/I;
print 'vi) IMPEDANCE (Z) is = ',Z,' ohm '
# EXAMPLE 2-71 PG NO-111
V=240.;
#cos (degree(62.74))=0.458;
Pm=V*2*0.458;
print 'i) POWER (Pm) is in rectangular form = ',Pm,' W '
I=(2.*0.458+1.5)-1j*(2*0.89);
print 'i) CURRENT (I) is in rectangular form = ',I,' A '
P=V*3*0.805
print 'i) Power (P) is in rectangular form = ',P,' W '
# EXAMPLE 2-72 PG NO 111
PF=0.5;
cosQ=0.5;
sinQ=0.866;
V=552.;
I=2.3;
v=240;
PF1=0.89;
P=v*I*PF1;
Q=(V*V-P*P)**0.5;
print '%s %.2f %s' %(' ACTIVE POWER is = ',P,' W');
print '%s %.2f %s' %(' REACTIVE POWER is = ',Q,' vars');
# EXAMPLE 2-73 PG NO-112
import math
R=44.074;
V=230.;
I=3.05;
Z=V/I;
Y=2.475;
X=(Z*Z-R*R)**0.5;
L=X/(2.*math.pi*50.)
Xc=V/Y;
C=1./(2.*50.*Xc*math.pi);
print '%s %.2f %s' %(' impedance is = ',Z,' ohm');
print '%s %.2f %s' %(' X is = ',X,' W');
print '%s %.2f %s' %('inductance is = ',L,'H ');
print '%s %.2f %s' %(' Xc is = ',Xc,' ohm');
print '%s %.2e %s' %(' Capacitor is = ',C,' F');
# EXAMPLE 2-74 PG NO-112
ZA=10.+1j*7.226; # IMPEDANCE
ZB=5.+1j*10.99; # IMPEDANCE
V=200.+1j*0; # VOLTAGE
IA=V/ZA; # CURRENT
print'i) CURRENT (IA) is in polar form = ',IA,' A '
IB=V/ZB;
print'ii) CURRENT (IB) is in polar form = ',IB,' A '
I=IA+IB;
print'iii) CURRENT (I) is in polar form = ',I,' A '
S=V*I;
print'i) Apparent Power (S) is = ',S,' VA '
P=V*I*0.63;
print'i) Active Power (P) is = ',P,' W '
Q=V*I*0.775;
print'i) Reactive Power (Q) is = ',Q,' Var '
# EXAMPLE 2-75 PG NO-113
V=100.+1j*0;
R=3.+1j*2.;
I=V/R;
print'i) CURRENT (I) is in polar form = ',I,' A '
ZA=10.+1j*8.;
ZB=9.-1j*6.;
ZC=3.+1j*2.;
IB=I*(ZA/(ZA+ZB));
print'i) CURRENT (IB) is in polar form = ',IB,' A '
IA=I*(ZB/(ZA+ZB));
print'i) CURRENT (IA) is in polar form = ',IA,' A '
Z=((ZA*ZB)/(ZA+ZB))+ZC;
print'vi) IMPEDANCE (Z) is = ',Z,' ohm '
V1=I*Z;
print'vi)VOLTAGE (V1) is = ',V1,' V '
S=V1*I;
print'i) Apparent Power (S) is = ',S,' VA '
P=V1*I*0.984;
print'i) Active Power (P) is = ',P,' W '
Q=(S**2-P**2)**0.5;
print'i) Reactive Power (Q) is = ',Q,' Var '
Z1=8.+1j*10.;
Z2=7.+1j*9.;
Z3=5.-1j*2.;
Z=(Z1*Z2)/(Z1+Z2);
print'vi) IMPEDANCE (Z) is in polar form = ',Z,' ohm '
TZ=Z+Z3;
print'vi) TOTAL IMPEDANCE (TZ) is = ',TZ,' ohm '
# EXAMPLE 2-77 PG NO-114
import math
R=math.sqrt(2.5**2-1.724**2)-0.69;
print '%s %.2f %s' %('i) Resistance (R) is = ',R,' ohm ');
R1=math.sqrt(2.5**2-1.92**2)-0.384;
print '%s %.2f %s' %('ii) Resistance (R1) is = ',R1,' ohm ');
r=5;
PF=(0.69+R)/2.5;
print '%s %.2f %s' %('iii) Power Factor (PF) is = ',PF,' lagging ');
r1=10;
PF1=(0.384+R1)/2.5;
print '%s %.2f %s' %('iv) Power Factor (PF1) is = ',PF1,' lagging ');
# EXAMPLE 2-78 PG NO-114-115
import math
I=10.;
L1=0.0318; # INDUCTANCE
L2=0.0191;
F=50.; # FREQUENCY
C=398.*10.**-6.; # CAPACITOR
XL1=(2.*math.pi*F*L1);
print 'i) INDUCYANCE (XL1) is = ',XL1,' ohm '
XL2=(2.*math.pi*F*L2);
print 'ii) INDUCYANCE (XL2) is = ',XL2,' ohm '
XC=1./(2.*math.pi*F*C);
print 'iii) CAPACITOR (XC) is = ',XC,' ohm '
Z1=5.+1j*6.;
Z2=7.-1j*8.;
Z3=8.+1j*9.99;
Z=((Z1*Z2)/(Z1+Z2))+Z3;
print 'iv) IMPEDANCE (Z) is in polar form = ',Z,' ohm '
VAB=I*Z;
print 'i) VOLTAGE (VAB) is in polar form = ',VAB,' V '
# EXAMPLE 2-79 PG NO-115
I2=10.+1j*0;
Z1=7.-1j*8.;
Z2=5.+1j*6.
V=I2*Z1;
print 'i) VOLTAGE (V) is in polar form = ',V,' V '
I1=V/Z2;
print 'i) CURRENT (I1) is in polar form = ',I1,' A '
I=I2-1j*13.44;
print 'i) CURRENT (I) is in polar form = ',I,' A '
VAB=15.57*18.52;
print 'i) VOLTAGE (VAB) is in polar form = ',VAB,' V '
# EXAMPLE 2-80 PG NO-115-16
I=12.+1j*0;
X2=13.33;
R=10.+1j*13.33;
V=I*R;
print'i) VOLTAGE (V) is in polar form = ',V,'V'
V1=30.-1j*27.67;
Z1=10.6165+1j*1.5;
R1=V1/Z1;
print'i) RESISTANCE (R1) is in polar form = ',R1,'ohm'
# EXAMPLE 2-81 PG NO-116-117
Z1=10.+1j*10;
Z2=20.+1j*0;
Z3=20.-1j*0.2;
V=100.+1j*0;
I1=V/Z1;
print'i) CURRENT (I1) is in polar form = ',I1,'A'
I2=V/Z2;
print'i) CURRENT (I2) is in polar form = ',I2,'A'
I3=V/Z3;
print'i) CURRENT (I3) is in polar form = ',I3,'A'
I=I1+I2+I3;
print'i) CURRENT (I) is in polar form = ',I,'A'
S=V*I;
print'i) Apparent Power (S) is in polar form = ',S,'A'
P=V*I*0.95;
print'i) Active Power (P) is in polar form = ',P,'W'
Q=(S**2.-P**2.)**0.5;
print'i) Reactive Power (Q) is in polar form = ',Q,'Var'
# EXAMPLE 2-82 PG NO-117
import math
Z1=4.+1j*314.16; # Impedance
I1=1./Z1; # CURRENT
print'i) Current (I1) is = ',I1,'A'
I2=I1+1j*90; # CURRENT
print'ii) Current (I2) is = ',I2,'A'
Z2=1/I2; # IMPEDANCE
print'i) Impedance (Z2) is = ',Z2,'ohm'
R=310.16; # RESISTANCE
Xc=310.16;
F=50.;
C=1./(2.*math.pi*F*Xc);
print'i) Capacitor (C) is = ',C,'F'
# EXAMPLE 2-83 PG NO-117-118
import math
V=125+1j*0;
I1=5+1j*0;
I2=1.2+1j*1.964;
Z2=28.316333-1j*46.344399 ;#V/I2;
print'iv) IMPEDANCE (Z2) is in polar form = ',Z2,'ohm'
R=28.26;
XC=46.43;
F=50;
C=0.0000686 ;#1./(2.*math.pi*F*XC);
print'iv) CAPACITOR (C) is in polar form = ',C,'F'
I=6.2+1j*1.964;#I1+I2;
print'iv) CURRENT (I) is in polar form = ',I,'A'
S=775+1j*245.5;#V*I;
print'i) Apparent Power (S) is in polar form = ',S,'VA'
P=738.575+1j*233.9615;#S*0.953;
print'i) Active Power (P) is in polar form = ',P,'W'
Q=234.05+1j*74.141;#S*0.302;
print'i) Reactive Power (Q) is in polar form = ',Q,'Var'
# EXAMPLE 2-84 PG NO 121-122
from math import sqrt,pi
L=0.01; # Inductance
C=0.04*10.**-6.; # Capacitor
Fo=1/(2.*pi*(sqrt(L*C)));
print'i) Resonant Frequency (Fo) is = ',round(Fo,2),'Hz'
Z=50.;
R=Z;
V=100.;
Io=V/R;
print'ii) Current (Io) is = ',round(Io,2),'A'
Fc=(1./(2.*pi))*((1./(L*C))-(R**2./(2.*L**2.)))**0.5;
print'iii) Cutt Frequency (Fc) is = ',round(Fc,2),'Hz'
Z1=50-1j*2.5;
Xc=1/(2.*pi*Fc*C);
print'iv) Xc (Xc) is = ',round(Xc,2)
Vc=1000.0094+1j*50.00047;#(100./Z1)*Xc;
print 'v) VOLTAGE (Vc) is = ',Vc,'V'
FL=1./((2.*pi)*((L*C)-((R**2.*C**2.)/2.))**0.5);
print'vi) Frequency (FL) is = ',round(FL,2),'Hz'
Z2=50.+1j*2.5;
VL=10000.094-1j*500.0047;#(100./Z2)*(2.*pi*FL*0.1);
print'i) VOLTAGE (VL) is = ',VL,'V'
# example 285 pg no-126
import math
I1=0.707;
I2=0.707;
db=20*math.log10(0.707);
print' Ration in db is = ',round(db,2)
# EXAMPLE 2-86 PG NO 126
from math import pi
L=0.5; # inductance
C=40.*10.**-6.; # capacitor
Wo=1./(L*C)**0.5;
R=10.; # resistance
V=100.; # voltage
Fo=Wo/(2.*pi); # frequency
Q=(Wo*L)/R;
W2=233.6; # frequency
W1=213.6; # frequency
BW=W2-W1; # Band width
Io=V/R; # current at resonance
Io1=0.707*Io; # current at half power points
V1=Q*V; # voltage aacross inductance at resonance
print' frequency is = ',round(Wo,2),'rad/sec'
print' frequency is = ',round(Fo,2),'Hz'
print' Q is = ',round(Q,2)
print' BAND WIDTH is = ',round(BW,2),'rad/sec'
print' current at resonance is = ',round(Io,2),'A'
print' current at half power points is = ',round(Io1,2),'A'
print'voltage aacross inductance at resonance is = ',round(V1,2),'V'
# EXAMPLE 2-87 PG NO-127
Wo=1000.;
C=20.*10.**-6.;
R=2.;
V=10.;
L=1./((Wo**2.)*C);
Q=(Wo*L)/R;
I=V/R;
Vr=I*R;
VL=Q*V;
Vc=Q*V;
print' INDUCTANCE is = ',round(L,2),'H'
print' Q is = ',round(Q,2)
print' CURRENT(I) is = ',round(I,2),'A'
print'VOLTAGE ACROSS RESISTANCE is = ',round(Vr,2),'V'
print'VOLTAGE ACROSS INDUCTANCE is = ',round(VL,2),'V'
print' VOLTAGE ACROSS CAPACITANCE is = ',round(Vc,2),'V'
# EXAMPLE 2-88 PG NO-130
L=10.**-3.; # INDUCTANCE
C=20.*10.**-6.; # CAPACITOR
Rc=4.; # CAPACITOR RESISTANCE
RL=6.; # LOAD RESISTANCE
Wo=(1./(L*C)**0.5)*(((RL*RL)-(L/C))/((Rc*Rc)-(L/C)))**0.5;
print' Wo is = ',round(Wo,2),'rad/sec'
# example 2-89 pg no-134
from math import pi
L=8.*10.**-3.; # INDUCTANCE
C=16.*10.**-9.;
Wo=1./(L*C)**0.5;
R=10.; # RESISTANCE
Fo=Wo/(2.*pi); # FREQUENCY
Q=(Wo*L)/R;
Rp=((R*R)+(Wo*Wo*L*L))/R
Vo1=100.;
BW1=Wo/Q;
R2=10.*10.**3.;
R3=60.*10.**3.;
LR=(Rp*R2)/R3;
Q1=(Q*LR)/Rp
Vo2=16.666;
BW2=Wo/Q1;
print' Wo is = ',round(Wo,2),'rad/sec'
print' Q is = ',round(Q,2)
print' Rp is = ',round(Rp,2),'ohm'
print'BAND WIDTH 1 is = ',round(BW1,2),'rad/sec'
print'Load resistance is = ',round(LR,2),'ohm'
print' Q1 is = ',round(Q1,2)
print'BAND WIDTH2is = ',round(BW2,2),'rad/sec'
# EX 2-90 PG NO-135
import math
R=20.; # RESISTANCE
Vc=250.; # VOLTAGE
I=1.; # CURRENT
F=50.; # FREQUENCY
W=2.*math.pi*F;
C=1./(W*50.); # CAPACITOR
L=1./(W*W*C); # INDUTANCE
print'W is = ',round(W,2)
print'CAPACITANCE(C) is = ',round(C,2),'F'
print'INDUCTANCE(L) is = ',round(L,2),'H'
# EXAMPLE 2-91 PG NO-135
L=10.*10.**-6.; # INDUCTANCE
R=1.; # RESISTANCE
C=10.**4.*10.**-12.; # CAPACITOR
V=100.; # VOLTAGE
Z=L/(C*R); # IMPEDANCE
I=V/Z; # CURRENT
print'IMPEDANCE is = ',round(Z,2),'ohm'
print'CURRENT is = ',round(I,2),'A'
# EXAMPL2-92 PG NO-136
L=0.5;
R=25.;
C=10.**-6.;
Wo= ((L- (R*R*C))/(5.*10.**-6.*(0.5*0.5)))**0.5;
Q=(Wo*L)/R;
BW=Wo/Q;
print'FREQUENCY is = ',round(Wo,2),' rad/sec'
print'Q is = ',round(Q,2)
print'band width is = ',round(BW,2),'rad/sec'
# EXAMPLE 2-93 PG NO-139
N1=100.;
Q1=0.05*10.**-3.;
I1=5.;
L1=0.01;
L2=0.01;
K=0.6;
i=1000.; # (di/dt=20/0.02)
M=K*((L1*L2)**0.5);
V=M*i;
print'mutual induction is = ',round(M,2),'H'
print'voltage induce is = ',round(V,2),'v'
# EXAMPLE 2.94 PG NO-139-140
from math import pi
L=0.6; # LENGTH
a=20.*10.**-4.; # AREA
MU=(4.*pi*10.**-7.);
R=L/(MU*a);
N1=1500.;
N2=500.;
i=250.;
M=(N1*N2)/R;
e=M*(i);
print'R = ',round(R,2)
print'mutual induction is = ',round(M,2),'H'
print'E.M.F INDUCE is = ',round(e,2),'V'
# EXAMPLE 2-95 PG NO-140
from math import pi
L=1.5; # INDUCTANCE
a=(2000.*0.01);
R=L/(4.*pi*10.**-7.*a); # RESISTANCE
print'i) Resistance (R) is = ',round(R,2),'ohm'
N1=30.;
N2=600.;
M=(N1*N2)/R;
print'ii) M (M) is = ',round(M,2),'H'
e=M*(10./0.01);
print'iii) e (e) is = ',round(e,2),'V'
# EXAMPLE-2.96 PG NO-140
M=0.125;
L1=0.2;
L2=0.15;
K=M/((L1*L2)**0.5)
print'i) K = ',round(K,2)
# EXAMPLE-2.97 PG NO-140
N1=500; # NUMBER OF TURN
N22=1500;
N12=500
Q1=0.6*10**-3; # FLUX OF COIL
I1=5; # CURRENT
Q12=0.3*10**-3;
L1=(N1*Q1)/I1
K=Q12/Q1;
L2=(N22/N12)*L1;
M=K*((L1*L2)**0.5);
print'i) L1 = ',round(L2,2)
print'ii) K = ',round(K,2),'H'
print'iii) L2 = ',round(L2,2),'H'
print'i) M = ',round(M,2),'H'
# example-2.98 pg no-141
L1=37.5*10.**-3.;
M=63.75*10.**-3.;
K=0.85;
N1=250.;
L2=((M/K)**2.)/L1;
N2=250./((L1/L2)**0.5);
print 'i) L2 = ',round(L2,2)
print 'i) N2 = ',round(N2,2)
# EXAMPLE 2-99 PG NO -141
import math
L1=6.8;
L2=4.5;
C1=19.6;
C2=3;
M=(C1-C2)/4.;
print'i) M (M) is = ',round(M,2),'mH'
K=M/math.sqrt(L1*L2);
print'ii) K (K) is = ',round(K,2)
# example 2.100 pg no-141
L1=15.;
L2=35.;
M=10.;
K=M/((L1*L2)**0.5); # coefficient of coupling
print '%s %.2f' %('i) COEFFICENT OF CUPLING (K) = ',K)
# EXAMPLE 2-102 PG NO-142
import math
L1=0.3;
L2=0.8; # INDUCTANCE
K=0.7;
M=K*math.sqrt(L1*L2);
print '%s %.2f %s' %('i) M (M) is = ',M,' H ');
Lp=((L1*L2)-M**2)/(L1+L2-(2*M));
print '%s %.2f %s' %('ii) Lp (Lp) is = ',Lp,' H ');
# Example 2-103 pg no-142
L1=10.;
L2=5.;
L3=6.;
M12=2.;
M23=1.;
M13=1.;
X=1.#X=di/dt
V1=(L1*X)+(M12*X)+(M13*X);
V2=(M12*X)+(L2*X)+(M23*X);
V3=(-M13*X)+(-M23*X)+(L3*X);
V=V1+V2+V3;
Ls=L1+L2+L3+(2.*M12)-(2.*M23)-(2.*M13);
print '%s %.2f ' %('i) V1 = ',V1)
print '%s %.2f ' %('ii) V2 = ',V2)
print '%s %.2f ' %('iii) V3 = ',V3)
print '%s %.2f ' %('iv) V = ',V)
print '%s %.2f %s' %('v)equivlent indutance (Ls) = ',Ls,'mH')
# EXAMPLE-2.105 PG-NO143
N1=250.; # number of turn
I1=2.; # current
Q1=0.3*10.**-3.; # phi
L1=(N1*Q1)/I1;
V2=63.75;
K=0.85;
x=10.**3.; # x=di/dt
M=V2/x;
L2=((V2/K)**2.)/((37.510**-3.)**0.5);
Q12=0.255*10.**-3.;
y=1.275*10.**-7.; # y=dQ12/dt
N2=V2/y;
print '%s %.2f %s' %('i) L1 = ',L1,' Tesla')
print '%s %.2f' %('ii) M = ',M)
print '%s %.2e' %('iii) L2 = ',L2)
print '%s %.2e' %('iv) N2 = ',N2)
# EXAMPLE-2.106 PG NO-144
import math
Fo=35.59; # frequency in HZ
V=50.;
R=100.;
I=V/R;
L=0.5;
XL=(2.*math.pi*Fo*L);
VI=XL*L; # VOLTAGE ACROSS INDUCTION
XC=XL;
Q=XC/R;
S=L/Q;
W2=323.55; # UPPER HALF REQUENCY
W1=123.65; # LOWER HAL FREQUENCY
BW=W2-W1; # BAND WIDTH
print '%s %.2f %s' %('i) INDUCTION = ',XL, ' ohm ');
print '%s %.2f %s' %('i)VOLTAGE ACROSS INDUCTION = ',VI, ' V ');
print '%s %.2f' %('i) Q = ',Q);
print '%s %.2f %s' %('i) REQUENCY = ',S,' ohm ');
print '%s %.2f %s' %('i) BAND WIDTH = ' ,BW,' rad/sec');
# EXAMPLE 2-107 PG NO-145
import math
Vm=100.;
RMS=Vm/(math.sqrt(3));
print '%s %.2f' %('i) RMS (RMS) is = ',RMS);
AVG=50.;
FF=RMS/AVG;
print '%s %.2f' %('ii) Form Factor (FF) is = ',FF);
# EXAMPLE 2-108 PG NO-146
I1=(100./1.414)**2.;
I2=(10./1.414)**2.;
RMS=(I1+I2)**0.5;
print '%s %.2f %s' %('R.M.S VALUE is = ',RMS,'A');
# EXAMPLE 2-109 PG NO-146
V=200.;
I=10.;
W=314.;
Z=V/I;
print '%s %.2f %s' %('i) IMPEDANCE (Z) is = ',Z,' ohm ');
R=Z*0.707;
print '%s %.2f %s' %('ii) RESISTANCE (R) is = ',R,' ohm ');
XC=Z*0.707;
print '%s %.2f %s' %('iv) INDUCTANCE (XC) is = ',XC,' ohm ');
C=1./(W*XC);
print '%s %.2f %s' %('iv) CAPACITOR (C) is = ',C,' F ');
P=V*I*0.707;
print '%s %.2f %s' %('i) Active Power (P) is in polar form = ',P,' W ');
Q=V*I*0.707;
print '%s %.2f %s' %('i) Reactive Power (Q) is in polar form = ',Q,' Var ');
# EXAMPLE 2-111 PG NO-147
VCB=2.49-1j*12.50;
R=4.+1j*2.;
I1=VCB/R;
print 'i) CURRENT (I1) is in polar form = ',I1,' A '
I2=2.5+1j*0;
I=I1+I2;
print 'i) CURRENT (I) is in polar form = ',I,' A '
VAC=11.8-1j*0.12;
VCB=2.5-1j*12.5;
VAB=VAC+VCB;
print 'i) VOLTAGE (VAB) is in polar form = ',VAB,' V '
# EXAMPLE 2-112 PG NO-148
I=5.;
R=25.;
Z=50.;
Z1=40.;
R1=(Z**2.-R**2.-1600.)/50.;
print '%s %.2f %s' %('i) RESISTANCE (R1) is = ',R1,' ohm ')
X1=(1600.-R1**2.)**0.5;
print '%s %.2f %s' %('ii) INDUCTANCE (X1) is = ',X1,' ohm ')
Pc=I*I*R1;
print '%s %.2f %s' %('iii) Power (Pc) is = ',Pc,' W ');
P=I*I*(R+R1);
print '%s %.2f %s' %('iv) Power (P) is = ',P,' W ');
# example-2.113 pg no -149
Wo=9.798*10.**3.;
Fo=1559.39;
C=2.;
R=10.*10.**-6.;
L=10.**-3.;
DR=L/(C*R); # DYNAMIC RESISTANCE
Q=(1./C)*((L/R)**0.5);
BW=Wo/Q; # BAND WIDTH
print '%s %.2f %s' %('i) DYNAMIC RESISTANCE = ',DR, ' ohm ');
print '%s %.2f' %('ii) Q = ',Q);
print '%s %.2f %s' %('iii) BAND WIDTH = ',BW,'rad/sec ');