1
2 / / calculating cur re nt flo wi ng in t he circu it 3 L=0.1 // induc tance
4 f=50 // frequ ency 5 Xl=2*%pi*f*L
6 R=15 // tota l resista nce in t h e circuit 7 Z =sqrt(R^2+Xl^2)
8 V=230 // vo lt ag e ap pl ie d t o series circuit 9 I=V/Z
10 mprintf (”Cu rr e nt flow ing in th e cir cui t=%f A \ n ”,I )
11 // calculat ing power factor 12 pf=R/Z
13 mprintf (”P ower factor of th e circu it is %f( lag gin g ) \
nVo lta ge acros s react or= %f V \ nV ol ta ge across
re si st or= %f V”,pf,I*Xl,I*R)
1
2 V1=200 // voltage applied to non −induct ive lo ad 3 I1=20 // curren t flowing th ro ug h th e loa d
4 R=V1/I1
5 V=230 // app lie d vol tag e to serie s co nn ec ti on of R a nd L 6 I=I1 7 Z=V/I 8 Xl =sqrt(Z^2-R^2) 9 L=Xl/(2*%pi*50) 10 phi=atand(Xl/R)
11 mprintf (”Induc tan ce of th e reactor= %f H, ph as e angl e
b e tw e en appl ied volt age and th e cur ren t is %f
deg ree s ”,L,phi)
Scilab code Exa 7.3 Example on AC Series Circuit
1
2 // calc ulat ing resistan ce , reactanc e and im pe da nc e of ch ok e coi l
3 I=7.5 // cur ren t flow ing th ro ug h th e cir cui t 4 V1=110 // voltage across non −in du ct iv e resistor 5 R=V1/I
6 V2=180 // volta ge across ch ok e coi l 7 Z=V2/I
8 Zt=230/I //im pe da nc e of wh ol e ci rc ui t 9 r=(Zt^2-R^2-Z^2)/(2*R)
10 Xl =sqrt(Z^2-r^2)
11 mprintf (”Reacta nce of co il= %f o hm \ nResi stanc e of
coil=%f ohm \ nIm pe dan ce of c o i l=%f o hm \ n ”,Xl,r,Z)
12 // calculat ing total resist ance and i m p e d a n c e of th e circuit
13 Rt=r+R
14 Zt =sqrt(Rt^2+Xl^2)
imp ed anc e of ci rc ui t=%f o hm \ n ”,Rt,Zt) 16 // calculat ing power ab so rb ed by th e coi l 17 P1=I^2*r
18 mprintf (”P ower absorb ed by the co i l=%f W \n ”,P1)
19 // calc ulat ing power drawn by ci rc ui t 20 P2=I^2*(r+R)
21 mprintf (”P ower drawn by the ci rc u it= %f W \n ”,P2)
22 // calculating power factor of w h o l e circu it 23 pf=Rt/Zt
24 mprintf (”P ower facto r of th e who le ci rc ui t=%f
lag gin g ”,pf)
25 // an sw er s va ry from th e te xt boo k due to rou nd off error
Scilab code Exa 7.4 Example on AC Series Circuit
1
2 // calc ulat ing current drawn at 50 Hz 3 V=220 // volt age appl ied to c ho ke coi l 4 f=50 // frequenc y of supp ly
5 I1=12 // curren t ta ke n by ch ok e co il 6 R1=0 // res ist anc e of coil is negligi ble 7 Xl=V/I1
8 I2=16.5 // curr ent ta ke n by th e res is tor 9 R=V/I2
10 Z =sqrt(R^2+Xl^2) 11 I=V/Z
12 mprintf (”Cur re nt ta ke n by th e ci rc ui t at 50 Hz=%f A \
n ”,I )
13 // calc ulat ing current drawn at 30 Hz 14 Xl_dash=30/50*Xl
15 Z_dash= sqrt(Xl_dash^2+R^2) 16 I=V/Z_dash
17 mprintf (”Curr en t drawn by the ci rc ui t at 30 H z=%f A \
Scilab code Exa 7.5 Example on AC Series Circuit
1
2 // let resistance and in du ct an ce of th e coil be R and L respectively
3 V=220 // vol tag e app lie d to coil 4 f=50 // frequenc y of supp ly
5 I=60 // current indic ated by ammeter 6 Z1=V/I
7 // when th e fr equ enc y is increase d to 10 0 H z 8 I=40 // current indic ated by ammeter
9 Z2=V/I
10 / /o n sol vin g for L
11 L =sqrt((Z2^2-Z1^2)/3)/(100*%pi) 12 R =sqrt(Z1^2-(100*%pi*L)^2)
13 mprintf (” Resistance of co il= %f ohm \ nInd uct anc e of
coil=%f H” ,R,L)
Scilab code Exa 7.6 Example on AC Series Circuit
1
2 // calculat ing pa ra me te rs of e ac h coi l 3 I =3// cur ren t th ro ug h th e cir cui t 4 // for coil A
5 Ra=12/3 // res ist anc e 6 Va=15 // volt age dr op 7 Za=Va/I
8 Xa =sqrt(Za^2-Ra^2) 9 // for coil B
10 Rb=6/3 // res ist anc e 11 Vb=9 // volt age dr op
12 Zb=Vb/I
13 Xb =sqrt(Zb^2-Rb^2) 14 // for coil C
15 Rc=9/3 // res ist anc e 16 Vc=12 // volt age dr op 17 Zc=Vc/I
18 Xc =sqrt(Zc^2-Rc^2)
19 mprintf (”Para met er s of \ nCo ilA : Ra=%f ohm , Xa=%f ohm \
nC oi l B: Rb=%f oh m , Xb=%f oh m \ nCo il C: Rc=%f ohm ,
Xc=%f ohm\ n ”,Ra,Xa,Rb,Xb,Rc,Xc)
20 // calculating power factor of e a c h coil 21 pf_a=Ra/Za
22 pf_b=Rb/Zb 23 pf_c=Rc/Zc
24 mprintf (”p ower factor of th e coi ls ar e \ npf a=%f(
laggi ng ) \ npf b=%f( la gg in g ) \ npf c=%f( la gg in g ) \ n”,
pf_a,pf_b,pf_c)
25 // calculating power dissipate d for e a c h coil 26 Pa=I^2*Ra
27 Pb=I^2*Rb 28 Pc=I^2*Rc
29 mprintfnPb=%f W\ nPc=%f W\ n ”(”P ower dissi pated ,Pa,Pb,Pc)in these co il s : \ nPa=%f W \
30 // calculating power factor of w h o l e circu it 31 Rt=Ra+Rb+Rc
32 Xt=Xa+Xb+Xc
33 Zt =sqrt(Rt^2+Xt^2) 34 pf=Rt/Zt
35 mprintf (”P ower facto r of th e who le ci rc ui t=%f
lagging \ n ”,pf)
36 // calculat ing volt age appl ied across th e w h ol e circuit
37 V=I*Zt
38 mprintf (”Vol ta ge appl ied across th e w h ol e cir cui t=%f
Scilab code Exa 7.7 Example on AC Series Circuit
1
2 // r 1 be th e variab le resistance
3 X=10 // total indu cti ve re ac tan ce of circu it 4 V=200 //r ms va lu e of appl ied volta ge
5 //RMS val ue of cu rr en t I =2 00 / sq rt ((2 + r1 ) ˆ2+1 0ˆ2) 6 //powe r co nsu me d i s P=I ˆ2 ∗ r 1
7 //For max pow er , dP/dr= 0 8 //o n solving
9 r1 =sqrt (104)
10 mprintf (”V a l u e of var iab le resistor a t t h e ins tan t
of max pow er con sum ed in it is %f o hm \ n ”,r1)
11 // solving pa rt ( i i ) , let r2 be th e variable
resistance −I =200/ s q r t ((200 + r2 ) ˆ2+1 0ˆ2) ,P=I ˆ2 ∗(2+ r 2 )
12 // f o r max pow er , dP/dr= 0 13 //o n solving
14 r2=10-2
15 mprintf (”V a l u e of variable res is tor= %d ohm for th e
condition of max po wer consumed by th e ci rc ui t \ n ”
,round (r2))
16 I1=200/ sqrt((2+r1)^2+10^2) 17 I2=200/ sqrt((2+r2)^2+10^2) 18 pf1=(2+r1)/ sqrt((2+r1)^2+10^2) 19 pf2=(2+r2)/ sqrt((2+r2)^2+10^2)
20 mprintf (”Curr en t in case ( i )=%f A at %f pf laggi ng \
nC ur re nt in case ( i i )=%f A at %f pf laggi ng \ n ”,I1,
pf1,I2,pf2)
1
2 //bo th th e co il s draw lagging curr ents , he nc e bo th ar e induct ive
3 // for coil A
4 Va=10 // voltage applied 5 Ia=2 // cur ren t dr aw n 6 Za=Va/Ia 7 pf=.8 //p ow er fac tor 8 Ra=pf*Za 9 Xa =sqrt(Za^2-Ra^2) 10 // for coil B 11 Vb=5 // voltage applied 12 Ib=2 // cur ren t dr aw n 13 Zb=Vb/Ib
14 pf=.7 //p ow er fac tor 15 Rb=pf*Zb
16 Xb =sqrt(Zb^2-Rb^2) 17
18 Rt=Ra+Rb // total resist ance of circuit 19 Xt=Xa+Xb // total re act anc e of circu it 20 Z =sqrt(Rt^2+Xt^2)
21 V=Ia*Z 22 pf=Rt/Z
23 mprintf (”V ol t ag e t o be ap pl ie d t o t h e circuit of
co il s A and B in se ri es= %f V and pf =%f laggi ng ” ,V
,pf)
Scilab code Exa 7.9 Example on AC Series Circuit
1
2 // calculat ing capa cita nce 3 Xc=4 // capaci tive reactan ce 4 f=50
5 omega=2*%pi*f 6 C=1/(omega*Xc)
7 mprintf (” Capac itan ce C=%f micr oF \ n ”,C*1D+6) 8 // cal cul at in g im pe da nc e
9 R =5// resist ance of circuit 10 Z =sqrt(R^2+Xc^2)
11 mprintf (”Imp ed an ce of ci rc ui t=%f o hm \ n”,Z )
12 // calculating cur re nt t ak e n by circu it 13 V=200
14 I=V/Z
15 mprintf (”Curr en t drawn by ci rc ui t=%f A \n ”,I )
16 // calculating vol tag e d r o p acr oss t he resistance 17 Vr=I*R
18 mprintf (”Vol ta ge d r o p across th e resist ance= %f V \n ”,
Vr )
19 // calculat ing volt age d r o p across th e reac tanc e 20 Vc=I*Xc
21 mprintf (”Volt age dr op across th e reactanc e=%f V \n ”,
Vc )
22 // calculat ing power factor 23 pf=R/Z
24 mprintf (”P ower factor of th e cir cui t=%f leadi ng ” ,pf)
Scilab code Exa 7.10 Example on AC Series Circuit
1
2 // rating of bu lb is 1 00 W,11 0 V 3 P=100
4 V=110
5 I=P/V //no rm al curre nt of bu lb
6 // volt age across bu lb sh ou ld be 11 0 V
7 Vc =sqrt (230^2-V^2) // volt age across th e capa cita nce 8 Xc=Vc/I
9 C=1/(100*%pi*Xc)
10 mprintf (”Capacit ance of %f mi cro F must be conn ect ed
Scilab code Exa 7.11 Example on AC Series Circuit
1
2 C=35D-6 // capac itan ce 3 f=50 // frequ ency 4 Xc=1/(2*%pi*f*C)
5 Z=2*Xc // volta ge appl ied across th e capa cit ance is eq ua l t o half of tota l vo lt ag e ap pl ie d
6 R =sqrt(Z^2-Xc^2)
7 mprintf (” Resistance of vari abl e re si st or , R =%f o hm” ,
R )
Scilab code Exa 7.12 Example on AC Series Circuit
1
2 // calc ulat ing current drawn 3 V=230 // voltage applied
4 R=15+10 // tota l resist ance of t h e circuit 5 L=.04+.1 // tota l indu cta nce
6 Xl=2*%pi*50*L 7 C=100D-6 // capa citan ce 8 Xc=1/(2*%pi*50*C) 9 X=Xl-Xc 10 Z =sqrt(R^2+X^2) 11 I=V/Z 12 mprintf (” Curren t dr aw n=%f A \ n ”,I )
13 // calc ulat ing voltages V1 and V2 14 Z1 =sqrt (15^2+(2*%pi*50*.04)^2) 15 V1=I*Z1
16 phi1=atand(2*%pi*50*.04/15)
17 mprintf (”V1=%f V a nd leads the current by %f degrees
18 Z2 =sqrt (10^2+(2*%pi*50*.1-1/(2*%pi*50*100D-6))^2) 19 V2=I*Z2
20 phi2=acosd(10/Z2)
21 mprintf (”V2=%f V a nd lags the current by %f degrees \
n ”,V2,phi2)
22 // calcu lating power fac tor of overa ll circuit 23 pf=R/Z
24 mprintf (”P ower factor of overall cir cui t=%f lagging ”
,pf)
25 //T he ans we rs va ry fro m the text book due to ro un d off er ro r
Scilab code Exa 7.13 Example on AC Series Circuit
1
2 // so lvi ng part ( i )
3 Rb=5 // resist ance of coil B
4 Xb=2*%pi*50*.02 // indu cti ve re ac tan ce of coil B 5 Zb =sqrt(Rb^2+Xb^2)
6 phi_b=atand(Xb/Rb) //ph as e diffe renc e of V b wi t h cu rr en t as referen ce ph as or
7 phi_a=90*%pi/180-phi_b*%pi/180 // Va and V b are in quadrature
8 //Xc/R =tan ( p h i a )
9 //Vb=2 ∗Va−−>Rˆ2+Xcˆ2=Zbˆ2/4
10 //o n solving for R a nd X c
11 R =sqrt((Zb^2/4)/(1+ tan(phi_a)^2)) 12 Xc =tan(phi_a)*R
13 C=1/(2*%pi*50*Xc)
14 mprintf (”R=%f ohm\nC=%f mic roF \n ”,R,C*1D+6)
15 // so lv in g part ( i i )
16 Rt=5+R // total resist ance of circuit
17 Xt=Xb-Xc // result ant re ac tan ce of circu it 18 Zt =sqrt(Rt^2+Xt^2)
20 I=V/Zt
21 mprintf (”Curr en t drawn by the ci rc ui t=%f A \n ”,I )
22 // so lv in g part ( i i i )
23 / /a s t h e re ac ta nc e is pos iti ve , circuit is in duc ti ve 24 pf=Rt/Zt // lag gin g
25 mprintf (”P ower facto r of th e ci rc ui t=%f( lagging ) \n ”,
pf )
26 // the ans we rs va ry fr om the text book due to ro un d off er ro r
Scilab code Exa 7.14 Example on AC Series Circuit
1
2 // calculat ing fr equ enc y of appl ied volt age 3 C=25.5D-6 // capa citan ce
4 I=.4 // current th ro ug h ci rc ui t 5 V=50 // volt age across capacitor 6 Xc=V/I
7 f=1/(2*%pi*C*Xc)
8 mprintf (”Frequency=%d Hz \ n ”,round (f))
9 // calculat ing pa ra me te rs of c h ok e coi l 10 V=35 // volt age across c h ok e coi l
11 Z=V/I //im pe da nc e of ch ok e co il 12 // r ˆ2+(100 ∗ %p i ∗L)ˆ2=Zˆ2
13 R=20/.4
14 Vac=45 // vol tag e acr oss a c por tio n of circu it 15 Zac=Vac/I //im pe da nc e of ac portion
16 // (R+r ) ˆ2+ (10 0 ∗ %p i ∗L)ˆ2=Zacˆ2 17 // solvi ng for r and L
18 r=(Zac^2-Z^2-R^2)/(2*R) 19 L =sqrt(Z^2-r^2)/(100*%pi) 20 Xl=2*%pi*50*L
21 mprintf (”Par am et er s of ch ok e co il : \ nRes is ta nce= %f
ohm\ nIndu ctance= %f H \ nInductiv e reacta nce= %f ohm \
22 // calculat ing appl ied volt age 23 Z =sqrt((R+r)^2+(Xl-Xc)^2) 24 V=I*Z
25 mprintf (”Vol ta ge appl ied to th e cir cui t=%f V \ n ”,V )
26 // calcu lating losses in c h o k e coil 27 W=I^2*r
28 mprintf (” Losses in ch ok e co il= %d W \ n ”,round (W))
Scilab code Exa 7.15 Example on AC Series Circuit
1
2 // calculat ing capa cita nce to give re son anc e 3 Xl=2*%pi*50*.4
4 Xc=Xl
5 C=1/(2*%pi*50*Xc)
6 mprintf (” Capac itan ce= %f mic roF \n ”,C*1D+6)
7 // calculat ing curr ent 8 R =5
9 Z = R 10 V=110 11 I=V/Z
12 mprintf (” cu rr en t dr aw n=%f A \ n ”,I )
13 // calculat ing volt age across in duc ta nc e 14 Xl=2*%pi*50*.4
15 Vl=I*Xl
16 mprintf (”Voltag e across inductanc e=%f V \ n ”,Vl)
17 // calculat ing volt age across capa cita nce 18 Xc=Xl
19 Vc=I*Xc
20 mprintf (”Voltag e across capacitance= %f V \n ”,Vc)
21 // calculat ing Q −factor 22 Q_factor=Vl/V