Electrical Engineering Fundamentals V Del Toropdf
Electrical Engineering Fundamentals V Del Toropdf
Created by
Aditi Pohekar
Electrical Engineering
Electrical Engineering
IIT Bombay
College Teacher
Madhu N. Belur
Cross-Checked by
Mukul R. Kulkarni
1
Funded by a grant from the National Mission on Education through ICT,
http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and
Scilab codes written in it can be downloaded from the ”Textbook Companion
Project” section at the website http://scilab.in
Book Description
Edition: 2
Year: 2009
ISBN: 9780132475525
1
Scilab numbering policy used in this document and the relation to the
above book.
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3
means a scilab code whose theory is explained in Section 2.3 of the book.
Contents
16 Transformers 41
Scilab code Exa 1.1 force between two like charges in free space
Scilab code Exa 2.1.a Determine the current flow and voltage drop
across the resistor
1 V = 1; // v o l t a g e s u p p l y
2 R = 10; // r e s i s t a n c e i n ohms
3 I = V / R // c u r r e n t f l o w i n g through R
4 disp ( ” a ) ” )
5 disp (V , ” v o l t a g e a c r o s s t h e r e s i s t o r ( i n v o l t s )=” )
6 disp (I , ” c u r r e n t f l o w i n g t h r o u g h t h e r e s i s t o r ( i
n amps ) =”)
Scilab code Exa 2.1.b Determine the current flow and voltage drop
across each resistor
1 V = 1; // v o l t a g e s u p p l y
2 R1 = 10; // f i r s t r e s i s t a n c e i n ohms
3 R2 = 5; // r e s i s t a n c e o f t h e s e c o n d r e s i s t o r
4 Vr1 = V * ( R1 /( R1 + R2 ) ); // v o l t a g e a c r o s s R1
5 Vr2 = V - Vr1 ; // v o l t a g e a c r o s s R2
6 Ir = Vr1 / R1 ; // c u r r e n t f l o w i n g through R
7
8 disp ( Vr1 , ” v o l t a g ea c r o s s t h e f i r s t r e s i s t o r ( i
n v o l t s )=”)
9 disp ( Vr2 , ” v o l t a g ea c r o s s t h e s e c o n d r e s i s t o r ( i
n v o l t s )=”)
10 disp ( Ir , ” c u r r e n t f l o w i n g through the
r e s i s t o r ( i n amps ) =”)
Scilab code Exa 2.1.c Repeat parts A and B with the voltage source re-
placed by a current source of 1A
1 // c − a
2 R1 = 10; // f i r s t r e s i s t a n c e i n ohms
3 I = 1; // c u r r e n t s o u r c e
4 V = I* R1 ; // v o l t a g e a c r o s s R
5 disp ( ” c − a ) ” )
6 disp (V , ” v o l t a g e a c r o s s t h e r e s i s t o r ( i n v o l t s )=” )
7 disp (I , ” c u r r e n t f l o w i n g t h r o u g h t h e r e s i s t o r ( i
n amps ) =”)
8
9 // c − b
10 Vr1 = I * R1 ; // v o l t a g e a c r o s s R1
11 Vr2 = I * R2 ; // v o l t a g e a c r o s s R2
12 disp ( ” c − b ) ” )
13 disp ( Vr , ” v o l t a g ea c r o s s t h e r e s i s t o r ( i n v o l t s )=” )
14 disp (I , ” c u r r e n t f l o w i n g t h r o u g h t h e r e s i s t o r ( i
n amps ) =”)
Scilab code Exa 2.2 From the given list of resistors choose a suitable re-
sistor which can carry a current of 300mA
1 R = 100; // r e s i s t a n c e i n ohms
2 I = 0.3; // c u r r e n t i n amps
3 P = I ^2 * R ; // power
4 // power specification of
the resistors availablei
n the s t o c k
5 Pa = 5;
6 Pb = 7.5;
7 Pc = 10;
8
9 if Pa > P then
10 disp ( ”we s h o u l select resisto a ”)
11 en d r
12 if d
13 Pb > P then select b”)
14 en disp ( ”we s h o u l resisto
15 if d r
16 d select c ”)
17 en Pc > P then
disp ( ”we s h o u l resisto
d r
d
Scilab code Exa 2.3 Find the resistance of the round copper conductor
having the given specifications
1 L = 1; // l e n g t h o f t h e c o p p e r w i r e i n m e t e r s
2 A = 1 * 10^ -4; // c r o s s s e c t i o n a l a r e a o f t h e w i r
e i nmeter s q u a r e
3 rho = 1.724 * 10^ -8; // r e s i s t i v i t y o f c o p p e r i n
ohm meter
4 R = rho *L / A ; // r e s i s t a n c e o f t h e w i r e i n ohm
5
6 disp (R , ” r e s i s t a n c e o f t h e w i r e ( i n ohms )=” )
Scilab code Exa 2.4 Find the resistance of the round copper conductor
having the given specifications
1 // 1 i n c h e s = 0 . 0 2 5 4 m eter s
2 // 1
f o o t = 0 . 3 0 4 8 m eter s
3 d =0 .1 *0 .0254 ; // d i a m e t e r o f t h e w i r e i n m e te r s
4 L =10 *0 .304 8 ; // l e n g t h o f th e w i r e in m eters
5 = 1.724 *10^ -8; // r e s i s t i v i t y o f t h e w i r e i n
rho
− ohm meter
6 A = pi *( d /2) ^2; // c r o s s s e c t i o n a l a r e a o f t h e w i r e
7 R = rho * L/ A ; // r e s i s t a n c e o f the wire i n ohm
8 disp (R , ” r e s i s t a n c e o f t h e w i r e ( i n ohm )=” )
Scilab code Exa 2.5 Find the time variation of the voltage drop
appearing across the inductor terminals
1 L = 0.1; // i n d u c t a n c eo f t h e c o i l i n henry
2 t1 = [0 :0 .00 1 :0 .1 ];
3 t2 = [0 .101 :0 .0 01 :0 .3
];
4 t3 = [0 .301 :0 .0 01 :0 .6
];
5 t4 = [0 .601 :0 .0 01 :0 .7
];
6 t5 = [0 .701 :0 .0 01 :0 .9
]
7 // c u r r e n t v a r i a t i o n as a f u n c t i o n o f t ime
8 i1 = 100* t1 ;
9 i2 = ( -50* t2 ) + 15;
10 i3 = -100* sin ( pi *( t3 -0.3) /
0.3) ;
11 i4 = (100* t4 ) - 60;
12 i5 = ( -50* t5 ) + 45;
13
14 t = [ t1 , t2 , t3 , t4 , t5 ];
15 i = [ i1 , i2 , i3 , i4 , i5 ];
16 plot (t , i )
17
18 dt = 0.001;
19 di = diff ( i);
20 V = L* di / dt ; // v o l t a g e dr o p appearin
g across th e i n d u c t o r terminal
s
21 Tv = [0 :0 .001 :0 .89 9 ];
22 plot ( Tv , V , ” g r e e n ” )
Scilab code Exa 2.6 Find the time variation of the capacitor voltage
1 C = 0.01; // c a p a c i t a n c eo f t h e c a p a c i t o r i n F a r a d s
2 t1 = [0 :0 .0 01 :0 .1 ];
3 t2 = [0 .10 1 :0 .0 01 :0 .3 ];
4 t3 = [0 .30 1 :0 .0 01 :0 .6 ];
5 t4 = [0 .60 1 :0 .0 01 :0 .7 ];
6 t5 = [0 .70 1 :0 .0 01 :0 .9 ]
7 // c u r r e n t v a r i a t i o n as a f u n c t i o n o f t ime
8 i1 = 100* t1 ;
9 i2 = ( -50* t2 ) + 15;
10 i3 = -100* sin ( pi *( t3 -0.3) /0.3) ;
11 i4 = (100* t4 ) - 60;
12 i5 = ( -50* t5 ) + 45;
13
14 t = [ t1 , t2 , t3 , t4 , t5 ];
15 i = [ i1 , i2 , i3 , i4 , i5 ];
16 plot (t , i )
17
18 // v o l t a g e a c r o s s the c a p a c i t o ras a f u n c t i o n o
f t ime
19 V1 = (1/ C )* integ rate ( ’ 10 0 ∗ t ’ , ’ t ’ ,0 , t1 );
20 V2 = (1/ C )* integ rate ( ’ ( −50∗ t ) +15 ’ , ’ t ’ ,0.101 , t2 );
21 V3 = (1/ C )* integ rate ( ’ −100∗ s i n ( %pi ∗ ( t − 0 . 3 ) / 0 . 3 ) ’ , ’ t ’
,0.301 , t3 );
22 V4 = (1/ C )* integ rate ( ’ ( 1 0 0 ∗ t ) − 60 ’ , ’ t ’ ,0.601 , t4 );
23 V5 = (1/ C )* integ rate ( ’ ( −50∗ t ) + 45 ’ , ’ t ’ ,0.701 , t5 );
24 V = [ V1 , V2 , V3 , V4 , V5 ];
25
26 plot (t , V , ” g r e e n ” )
Scilab code Exa 2.7 Find A actual value of the voltage gain of the opamp
circuit B ideal value of the voltage gain C percent error
1 // a
2 Ri = 1;
3 Rf = 39;
4 A = 10^5; // open l o o p g a i n o f t h e op −amp
5 G = A /(1 + ( A * Ri /( Ri + Rf ) )) ; // a c t u a l voltag
e gain o f the circui
t
6 disp ( ” a ” )
7 disp (G , ” a c t u a l v o l t a g e o f t h e c i r c u i t =” )
8
9 // b
10 G1 = 1 + ( Rf / Ri ); //v o l t a g e g a i n o f t h e c i r c u i
t with i n f i n i t e open l o o p g a i n
11 disp ( ”b ” )
12 disp ( G1 , ” f o r i d e a l c a s e t h e v o l t a g e g a i n =” )
13
14 // c
15 er = (( G1 - G)/ G ) *100; // p e r c e n t e r r o r
16 disp ( ” c ” )
17 disp ( er , ” p e r c e n t error of t h ei d e a l
value compared to the actual valu
e=”)
Scilab code Exa 2.8 Design a non inverting opamp circuit of voltage
gain 4
1 G = 4; // v o l t a g e g a i n o f t h e c i r c u i t
2 r = G -1; // r a t i o o f t h e r e s i s t a n c e s i n t h e non −
i n v e r t i n gop−amp c i r c u i t
3 disp (r , ” Rf / Ri =” )
4 // R e s u l t :
5 //A s u i t a b l e c h o i c e f o r R1 i s 10K, Hence Rf = 30K
Scilab code Exa 2.9 Find the input resistance of an inverting opamp
cir- cuit with voltage gain of 4
1 G = 4;
2 r = G; // r a t i o o f t h e r e s i s t a n c e s i n t h e i n v e r t i n
g op
− amp c i r c u i t
3 disp (r , ” Rf / Ri ” )
4 // R e s u l t ;
5 //A s u i t a b l e c h o i c e f o r Rf=30K and R1=7 . 5K
6 // t h e r e f o r e i n p u t r e s i s t a n c e R1 = 7 . 5K
Scilab code Exa 3.1 for the given circuit calculate the current flowing
from the voltage source
1 V = 100; // v o l a t a g e s u p p l y i n v o l t s
2 Rs = 40; // r e s i s t a n c e i n s e r i e s i n ohms
3 // p a r a l l e l r e s i s t a n c e si n ohms
4 Rp1 = 33.33 ;
5 Rp2 = 50;
6 Rp3 = 20;
7 Rpinv = (1/ Rp1 ) +(1/ Rp2 ) +(1/ Rp3 ); // r e c i p r o c a l
ofequivalent resistance i
n parallel
8 Req = Rs + (1/ Rpinv ) ;
9 I = V / Req ; // c u r r e n t f l o w i n g fr om the v o
ltage s o u r c e i n amps
10 disp (I , ” c u r r e n t f l o w i n g from t h e v o l t a g e s o u r c e ( i
n amps ) = ”)
Scilab code Exa 3.2 Calculate the potential difference across terminals bc
1 V = 100; // v o l a t a g e s u p p l y i n v o l t s
2 Rs = 40; // r e s i s t a n c e i n s e r i e s i n ohms
3 // p a r a l l e l r e s i s t a n c e si n ohms
4 Rp1 = 33.33 ;
5 Rp2 = 50;
6 Rp3 = 20;
7 Rpinv = (1/ Rp1 ) +(1/ Rp2 ) +(1/ Rp3 ); // r e c i p r o c a l
ofequivalent resistance i
n parallel
8 Rp = 1/ Rpinv ; // e q u i v a l e n t e s i s t a n c e i n p a r a l l e l
9 Vbc = V *( Rp /( Rs + Rp ) ); //p o t e n t i a l d i f f e r e n c
eacross bc
10 disp ( Vbc , ” p o t e n t i a l d i f f e r e n c e a c r o s s bc = ” )
1 // r e s i s t a n c e si n ohms
2 R1 = 25;
3 R2 = 300;
4 R3 = 80;
5 R4 = 30;
6 R5 = 60;
7
8 Rcd = R5 * R4 /( R5 + R4 );
9 Rbd1 = Rcd + R3 ;
10 Rbd = Rbd1 * R2 /( Rbd1 + R2 );
11 Req = Rbd + R1 ; // e q u i v a l e n t resistance
12 disp ( Req , ” e q u i v a l e n t r e s i s t a n c e = ”)
Scilab code Exa 3.4 Value of E for which power dissipation in R5 is 15W
R5 is 15
1 // r e s i s t a n c e si n ohms
2 R1 = 25;
3 R2 = 300;
4 R3 = 80;
5 R4 = 30;
6 R5 = 60;
7
8 P5 = 15; // power d i s s i p a t e d i n R5 ( i n wa tt )
9
10 I5 = sqrt ( P5 / R5 ); // c u r r e n t flowing
t h r o u g h R5
V5 == R5
11 Vcd
12 // v; o //
V5*;I5 l t av go el t aa gc re oa sc sr cd
o s s R5
13
14 I4 = Vcd / R4 ; // c u r r e n t f l o w i n g t h r o u g h R4
15 Icd = I5 + I4 ; // c u r r e n t flowing t h r o u g h cd
16
17 Vbd = ( Icd * R3 )+ Vcd ; // v o l t a g e a c bd
ross
18 Ibd = ( Vbd / R2 )+ Icd ; // c u r r e n t bd
through
19
20 V1 = R1 * Ibd ; // v o l t a g e a c r o s s R1
21
22 E = V1 + Vbd ;
23 disp (E , ”E = ” )
24
25 // R e s u l t : Value o f E f o r which power d i s s i p a t i o ni
n R i s15W = 200V
code can be downloaded from the website wwww.scilab.in This code can be
downloaded from the website wwww.scilab.in
Scilab code Exa 3.8 Find current flowing through all the branches of
the circuit
1 // mesh e q u a t i o n s :
2 // 60 ∗ I 1 − 20 ∗ I 2 = 20
3 // −20∗ I 1 + 80 ∗ I 2 = −65
4
5 R = [60 -20; -20 80];
6 E = [120; -65];
7 I = inv ( R)* E;
8 I1 = I (1 ,:) ; // c u r r e n tf l o w i n g i n f i r s t mesh
9 I2 = I (2 ,:) ; // c u r r e n tf l o w i n g i n s e c o n d mesh
10
11 Ibd = I1 - I2 ; // c u r r e n t f l o w i n g through branch
bd
12 Iab = I1 ; // c u r r e n tf l o w i n g t h r o u g h b r a n c h ab
13 Icb = - I2 ; // c u r r e n t f l o w i n g t h r o u g h b r a n c h cb
14
15 disp ( Ibd , ” c u r r e n t f l o w i n g through b r a n c h bd =
”)
16 disp ( Iab , ” c u r r e n tf l o w i n g t h r o u g h b r a n c h ab = ” )
17 disp ( Icb , ” c u r r e n tf l o w i n g t h r o u g h b r a n c h cb = ” )
code can be downloaded from the website wwww.scilab.in This code can be
downloaded from the website wwww.scilab.in
Scilab code Exa 3.12 Find A current flowing through Rl B valye of Rl for
which the power transfer is maximum and the maximum power
1 // a
2 // c i r c u i t p a r a m e te r s
3 E1 = 120;
4 R1 = 40;
5 R2 = 20;
6 R3 = 60;
7
8 Voc = E1 * R2 /( R2 + R1 ); // open circui
t vo l t ag ea pp e ar i n g at t e r m
inal 1
9 Ri = R3 + ( R1 * R2 /( R1 + R2 )) ; // e q u i v a l e n t resis
tancelooking into the network
from terminal pair
01
10
11 function I = Il ( Rl )
12 I = Voc /( Ri + Rl ) // c u r r e n t t h r o u g h Rl
13 endfunction
14
15 Il1 = Il (10) ; // Rl = 10 ohm
16 Il2 = Il (50) ; // Rl = 50 ohm
17 Il3 = Il (200) ; // Rl = 200 ohm
18
19 disp ( ” a ” )
20 disp ( Il1 , ” I l ( Rl = 10ohm ) = ” )
21 disp ( Il2 , ” I l ( Rl = 50ohm ) = ” )
22 disp ( Il3 , ” I l ( Rl = 200 ohm ) = ” )
23
24 // b
25 // f o r maximum power Rl = Ri
26 Rl = Ri ;
27 Plmax = ( Voc /(2* Ri )) ^2 * Ri ; // maximum power t o Rl
28 disp ( ”b ” )
29 disp ( Plmax , ”maximum power t o Rl ( i n Watt ) = ” )
Scilab code Exa 3.13 Find the current flowing through R2 by using
Nor- tons current source equivalent circuit
1 // c i r c u i t p a r a m e te r s
2 // v o l t a g e s o u r c e s
3 E1 = 120;
4 E2 = 65;
5 // r e s i s t a n c e s
6 R1 = 40;
7 R2 = 11;
8 R3 = 60;
9
10 I = ( E1 / R1 ) + ( E2 / R3 ); // norton ’ s current s
ource
11 Req = R1 * R3 /( R1 + R3 ); // e q u i v a l e n t resistance
12
13 I2 = I * Req /( Req + R2 ); // c u r r e n t flowing
t h r o u g h R2
14
15 disp ( I2 , ” c u r r e n t flowing t h r o u g h R2 = ” )
This code can be downloaded from the website wwww.scilab.in This code
1 // ad
2 Zab = complex (1 , -0.5) ; // i m p e d a n c e a p p e a r i n g a c r o s
sterminals ab
3 Zbg = complex (1) ; // i m p e d a n c e a p p e a r i n g a c r o s
sterminals bg
4 Zbcd = complex (2+1 ,2) ; // i m p e d a n c e a p p e a r i n g a c r o s
sterminals bcd
5 Zad = Zab + ( Zbg * Zbcd /( Zbg + Zbcd )); //
impedance a p p e a r i n g across termin
als ad
6 disp ( Zad , ” im p ed a n c e a p p e a r i n g a c r o s s t e r m i n a l s ad
= ”)
7
8 // dg
9 Zdg = Zbg + ( Zab * Zbcd /( Zab + Zbcd )); //
impedance a p p e a r i n g across terma
inals dg
10 disp ( Zdg , ” im p ed a n c e a p p e a r i n g a c r o s s t e r m i n a l s dg
= ”)
Chapter 5
Scilab code Exa 5.2 Find the expression for the current flowing through
the circuit and the total energy dissipated in the resistor
1 C = 10*10^ -6 ; // c a p a c i t a n c e ( i n f a r a d s )
2 R = 0 .2 *10 ^6 ; // r e s i s t a n c e ( i n ohms )
3 Vi = 40; // i n i t i a l v o l t a g e o f t h e c a p a c i t o r ( i
nvolts)
4 Wc = (1/2) * C* Vi ^2; // e n e r g y s t o r e d i n the c a p a c i
tor
5 // c u r r e n t f l o w i n g i n c i r c u i t as a f u n c t i o n o f t ime
i ( t ) = 2∗10ˆ −4∗ exp(− t / 2 )
6 // power d i s s i p a t e di n the r e s i s t o r = R∗ i ˆ2
7 Wr = integrate ( ’R∗4∗10ˆ −8∗ exp (− t ) ’ , ’ t ’ ,0 ,100)
8 disp ( Wc , ” e n e r g y stored in the ca
p a c i t o r ( i n J o u l e s ) = ”)
9 disp ( Wr , ” e n e r g y dissipated in the r
esistor (in Joules
) = ”)
code can be downloaded from the website wwww.scilab.in This code can
loaded from the website wwww.scilab.in This code can be downloaded from
the website wwww.scilab.in This code can be downloaded from the website
wwww.scilab.in
Chapter 6
Scilab code Exa 6.1 Find the laplace transform of the given pulse
1 function F = laplace (s , T1 , T2 )
2 // p u l s e :
3 // f = u ( t − T1 ) − u ( t T2 )
4 F = integrate ( ’ exp (− s t ) ’ , ’ t ’ ,T1 , T2 ); // l a p l a
c e t r a n s f o r m − o f the p u l s e
5 endfunction ∗
Chapter 7
Scilab code Exa 7.1 Find the average value of the given periodic function
1 Vm = 2; // a s s u m p t i o n
2 // a v e r a g e v a l u e o f the f u n c t i o n
3 // v ( t ) = Vm∗ a l p h a /( %pi / 3 ) f o r 0 <= a l p h a <= %pi /3
4 // = Vm f o r %pi /3 <= a l p h a <= %pi /2
5 Vav = (2/ pi )* integrate ( ’Vm ∗ a l p h a ( 3 / %pi ) ’ , ’ a l p h a ’
,0 , pi /3) + (2/ pi )* integ rate ( ’Vm ∗ alpha/alph
a ’ , ’ a l p h a ’ , pi /3 , pi /2) ;
6 disp ( Vav )
Scilab code Exa 7.2 Determine the power factor and average power
deliv- ered to the circuit
1 theta = pi /6; // p h a s e d i f f e r e n c e b e t we e n c u r r e n
t and v o l t a g e
2 pf = cos ( theta ); // power f a c t o r
3 disp ( pf , ” power f a c t o r = ” )
4
5 Vm = 170; // peak v o l t a g e
6 Im = 14 .14; // pea k c u r r e n t
7
8 Pav = Vm * Im * pf /2; // a v e r a g e power deliv
ered to the c i r c u i t
9 disp ( Pav , ” a v e r a g e power d e l i v e r e d to the ci
rcuit = ”
)
Scilab code Exa 7.3 Find the expression for the sum of i1 and i2
Scilab code Exa 7.4 Find the effective value of the resultant current
1 I1 = 10; // pea k v a l u e o f i 1
2 I2 = 20; // pea k v a l u e o f i 2
3 theta = pi /3; // p h a s e d i f f e r e n c e b e t we e n i 1 and i 2
4 // complex r e p r e s e n t a t i o n o f the two c u r r e n t s
5 i1 = complex (10) ;
6 i2 = complex (20* cos ( pi /3) ,20* sin ( pi /3) );
7
8 i = i1 + i2 ; // r e s u l t a n t c u r r e n t
9 I = sqrt ( real ( i) ^2 + imag ( i) ^2) ; // c a l c u l a t i n g
t h e peak v a l u e o f th e r e s u l t a n t c u r r e n t by u s i
n g i t s r e a l and i m a g i n a r y p a r t s
10 phi = atan ( imag ( i )/ real ( i ) ); // c a l c u l a t i g t h e
p h a s e o f the r e s u l t a n t c u r r e n t by u s i n g i t s r e a l
and
imaginaryparts
11 disp (i , ” r e s u l t a n t c u r r e n t = ” )
12 disp (I , ” peak v a l u e o f t h e r e s u l t a n t c u r r e n t = ” )
13 disp ( phi , ” p h a s e o f t h e r e s u l t a n t c u r r e n t = ” )
14 // r e s u l t : i = I s i n ( wt + phi )
Scilab code Exa 7.5 Find the time expression for the resultant current
1 I1 = 3; // peak valu of i1
e
2 I2 = 5; // peak v a l u o f i 2
e
3 I3 = 6; // peak v a l u o f i 3
e
4 theta1 = pi /6; // p h a s e d i f f e r e n c e b e tw e e n i 2 and i 1
5 theta2 = -2* pi /3; // p h a s e d i f f e r e n c e b e t we e n i 3 and
i1
6 // complex r e p r e s e n t a t i o n o f the currents
7 i1 = complex (3) ;
8 i2 = complex (5* cos ( pi /6) ,5* sin ( pi /6) );
9 i3 = complex (6* cos ( -2* pi /3) ,6* sin ( -2* pi /3) );
10
11 i = i1 + i2 + i3 ; // r e s u l t a n t c u r r e n t
12 I = sqrt ( real ( i) ^2 + imag ( i) ^2) ; // c a l c u l a t i n g
t h e peak v a l u e o f th e r e s u l t a n t c u r r e n t by u s i
n g i t s r e a l and i m a g i n a r y p a r t s
13 phi = atan ( imag ( i)/ real ( i) ); // c a l c u l a t i g the phase
o f the r e s u l t a n t c u r r e n t by u s i n g its re
a l and i m a g i n a r y p a r t s
14 disp (I , ” peak v a l u e o f t h e r e s u l t a n t c u r r e n t = ” )
15 disp ( phi , ” p h a s e o f t h e r e s u l t a n t c u r r e n t = ” )
16 // r e s u l t : i = I s i n ( wt + phi )
Scilab code Exa 7.6 Find the value of the given expression
1 // f i n d V∗ Z1 / Z2
2 V = complex (45* sqrt (3) , -45) ;
3 Z1 = complex (2.5* sqrt (2) , 2.5* sqrt (2) );
4 Z2 = complex (7.5 , 7.5* sqrt (3) );
5 // we have to f i n d V∗ Z1 / Z2
6 Z = V* Z1 / Z2 ;
7 d i s p ( Z , ” V∗ Z 1 / Z 2 = ” )
Scilab code Exa 7.7 Find A value of steady state current and the
relative phase angle C magnitude and phase of voltage drops appearing
across each element D average power E power factor
1 // a
2 f = 60; // f r e q u e n c y o f the volatge source
3 V = complex (141) ; // v o l t a g e s u p p l y V = 141 s i n ( wt )
4 R = 3; // r e s i s t a n c e o f t h e c i r c u i t
5 L = 0 .0106 ; // i n d u c t a n c eo f t h e c i r c u i t
6 Z = complex (R ,2* pi * f * L); // im p e d a n c e of the circui
t
= R + jwL
7 i = V / Z ; // c u r r e n t
8 I = sqrt ( real ( i ) ^2 + imag (i) ^2) ; // c a l c u l a t i n g
the peak v a l u e o f th e c u r
r e n t by u s i n g its real and
imaginary parts
9 phi = atan ( imag ( i)/ real ( i) ); // c a l c u l a t i g the
pha s e o f the resultant c
u r r e n t by u s i n g i t s r e a l and
imaginary parts
10 disp ( ” a ” )
11 disp (I , ” e f f e c t i v e v a l u e o f t h e s t e a d y s t a t e c u r r e n t
= ”)
12 disp ( phi , ” r e l a t i v e p h a s e a n g l e = ” )
13
14 // b
15 // e x p r e s s i o n f o r the instantaneo
us current can be w r i t t e n as
16 // i = I s i n ( wt + phi )
17
18 // c
19 R = complex (3) ;
20 vr = V* R/ Z ; // v o l t a g e a c r o s s t h e r e s i s t o r
21 Vr = sqrt ( real ( vr ) ^2 + imag ( vr ) ^2) ; // pea k v
a l u eo f the voltage across the r
esistor
22 phi1 = atan ( imag ( vr )/ real ( vr ) ); // p h a s e of
the v o l t a g e a c r o s s the r e
sistor
23
24 vl = V - vr ; // v o l t a g e across the i n d u c t o r
25 Vl = sqrt ( real ( vl ) ^2 + imag ( vl ) ^2) ; // peak v
a l u eo f the voltage across the i
nductor
26 phi2 = atan ( imag ( vl )/ real ( vl )) ; // p h a s e of
the v o l t a g e a c r o s s the i n
ductor
27 disp ( ” c ” )
28 disp ( Vr , ” e f f e c t i v e v a l u e o f t h e v o l t a g e dr o p a c r o s
s the r e s i s t o r = ”)
29 disp ( phi1 , ” p h a s e o f t h e v o l t a g e d r op a c r o s s t h
e r e s i s t o r = ”)
30 disp ( Vl , ” e f f e c t i v e v a l u e o f t h e v o l t a g e dr o p a c r o s
s the i n d u c t o r = ”)
31 disp ( phi2 , ” p h a s e o f t h e v o l t a g e d r op a c r o s s t h
e i n d u c t o r = ”)
32
33 // d
34 Pav = V * I * cos ( phi ); // a v e r a g e power dissipate
d by
the c i r c u i t
35 disp ( ”d ” )
36 disp ( Pav , ” a v e r a g e power dissipated
by t h e c i r c u i t = ”)
37
38 // e
39 pf = cos ( phi ); // power f a c t o r
40 disp ( ” e ” )
41 disp ( pf , ” power f a c t o r = ” )
Scilab code Exa 7.8 Find the equivalent impedance appearing between
points a and c
1 // im p edan ces i n th e c i r c u i t
2 Z1 = complex (10 ,10) ;
3 Z2 = complex (15 ,20) ;
4 Z3 = complex (3 , -4) ;
5 Z4 = complex (8 ,6) ;
6
7 Ybc = (1/ Z2 ) +(1/ Z3 ) +(1/ Z4 ); // a d m i t t a n c e o f
the p a r a l l e l comb
ination
8 Zbc = (1/ Ybc ); // i m p e d a n c e o f t h e p a r a l l e
lcombination
9
10 Z = Z1 + Zbc ; // e q u i v a l e n t impedance of
the circuit
11
12 disp (Z , ” e q u i v a l e n tim p ed a n c e o f t h e c i r c u i t = ”)
Scilab code Exa 7.9 Find the current which flows through branch Z3
1 V1 = complex (10) ;
2 V2 = complex (10* cos (- pi /3) ,10* sin (- pi /
3) );
3 Z1 = complex (1 ,1) ;
4 Z2 = complex (1 , -
1) ; 5 Z3 = complex
(1 ,2) ; 6
7 // by mesh a n a l y s i s we g e t the f o l l o w i n ge q u a t i o n s :
8 // I 1 ∗ Z11 − I 2 Z12 = V1
9 // −I 1 ∗ Z21 + I 2∗Z22 = V2 ; where I 1 and I 2 a r e the
c u r r r e∗ n t s f l o w i n g i n th e f i r s t and se co n d meshes
r e−spectively
10 Z11 = Z1 + Z1
;
11 Z12 = Z1 + Z2
;
12 Z21 = Z12
;
13 Z22 = Z2 + Z2
;
14
15 // the mesh e q u a t i o n s can be r e p r e s e n t e d in
the
∗ m atrix form as I Z = V
16 Z = [ Z11 , - Z12 ; -Z21 , Z22 ]; // impedance ma tr i x
17 V = [ V1 ; - V2 ]; // v o l t a g e m atrix
18 I = inv (Z )* V; // c u r r e n t m a t r i x = [ I 1 ; I 2 ]
19
20 I1 = I (1 ,:) ; // I 1 = f i r s t row o f I m a t r i x
21 I2 = I (2 ,:) ; // I 1 = s e c o n d row o fI m a t r i x
22
23 Ibr = I1 - I2 ; // c u r r e n t flowing t h r o u g h Z3
24
25 disp ( Ibr , ” c u r r e n tf l o w i n g t h r o u g h Z3 = ” )
Scilab code Exa 7.10 Find the current in the Z3 branchby using the
Nodal method
1 V1 = complex (10) ;
2 V2 = complex (10* cos (- pi /3) ,10* sin (- pi /3) );
3 Z1 = complex (1 ,1) ;
4 Z2 = complex (1 , -
1) ; 5 Z3 = complex
(1 ,2) ;
6 // By a p p l i n g the n o d a l a n a l y s i s we g e t th e f o l l o w i n g
equation:
7 // Va ( ( 1 / Z1 ) +(1/ Z2 ) +(1/ Z3 ) ) = ( V1/ Z1 ) + ( V2/ Z2 )
8
9 Y = (1/ Z1 ) +(1/ Z2 ) +(1/ Z3 );
10 Va = (1/ Y ) *(( V1 / Z1 ) + ( V2 / Z2 ) ); // v o l t a g e o f node a
11
12 Ibr = Va / Z3 ; // c u r r e n t f l o w i n g t h r o u g h Z3
13
14 disp ( Ibr , ” c u r r e n tf l o w i n g t h r o u g h Z3 = ” )
Scilab code Exa 7.11 Find the current flowing through Z3 by using
Thevinins theoram
1 V1 = complex (10) ;
2 V2 = complex (10* cos (- pi /3) ,10* sin (- pi /
3) );
3 Z1 = complex (1 ,1) ;
4 Z2 = complex (1 , -1) ;
5 Z3 = complex (1 ,2) ;
6
7 Zth = Z3 + ( Z1 * Z2 /( Z1 + Z2 )) ; // thevinin resist
ance
8
9 I = ( V1 - V2 )/( Z1 + Z2 ); // c u r r e n t f l o w i n g through
the c i r c u i t when R3 i s not c o n n e c te d
10 Vth = V1 - I * Z1 ; // t h e v i n i n v o l t a g e
11
12 Ibr = Vth / Zth ; // c u r r e n t flowing t h r o u g h Z3
13
14 disp ( Ibr , ” c u r r e n tf l o w i n g t h r o u g h Z3 = ” )
Chapter 9
Semiconductor electronic
devices
Scilab code Exa 9.2 Find the values of self bais source resistance and
drain load resistance at Q point
1 // Q u i e s c e n t p o i n t
2 Idq = 0 .0034 ; // d r a i n c u r r e n t
3 Vdq = 15; // d r a i n v o l t a g e
4 Vgq = 1; // g a t e v o l t a g e
5
6 Vdd = 24; // d r a i n s u p p l y v o l t a g e
7
8 Rs = Vgq / Idq ;
9 disp ( Rs , ” The v a l u e of self bais source r
e s i s t a n c e i s ( i n ohm) : ”)
10
11 Rd = ( Vdd - Vdq )/ Idq ;
12 disp ( Rd , ” The v a l u e of drain load
r e s i s t a n c e i s ( i n ohm) : ”)
Scilab code Exa 9.3 Find A midband frequency current gain of the first
stage B bandwidth of the first stage amplifier
1 // a
2 // t r a n s i s t o r p a r a m e te r s
3 R2 = 0 .625;
4 hie = 1.67;
5 Rb = 4.16;
6 Rl = 2.4;
7 Roe = 150;
8
9 Cc = 25 * 10^ -6;
10 rBB = 0.29;
11 rBE = 1.375 ;
12 Cd = 6900 * 10^ -12;
13 Ct = 40 * 10^ -12;
14 gm = 0 .032;
15
16 Req = ( Rl * Roe ) /( Rl + Roe );
17 hfe = 44;
18 a = 1 + ( R2 / Req );
19 b = 1 + ( hie / Rb );
20 Aim = - hfe /( a* b); // mid band f r e q u e n c y g
ain
21 disp ( ” a ” )
22 disp ( Aim , ” The mid band f r e q u e n c y gain of
t h e f i r s t s t a g e o f the c i r c u i t i s : ”)
23
24 // b
25 Tl = 2* pi *( Req + R2 )* Cc *(10 ^3 ) ;
26 Fl = 1/ Tl ;
27
28 Rp = ( Req * R2 )/( Req + R2 );
29 C = Cd + Ct *(1 + gm * Rp *10^3) ;
30 d = Rb + hie ;
31 e = rBE * ( Rb + rBB )* 10^3 * C ;
32 Fh = d /(2* pi * e);
33
34 BW = Fh - Fl ;
35 disp ( ”b ” )
36 disp ( BW , ” The ba ndwidth o f t h e f i r s t s t a g
eamplifier i n Hz i s : ”)
Chapter 11
1 // a
2 N2 = ’ 101 ’ ; // b i n a r y o r d e r e d s e q u e n c e
3 N = bin 2 dec ( N2 ); // d e c i m a l e q u i v a l e n t o f N2
4 disp ( ” a ” )
5 disp (N , ” d e c i m a le q u i v a l e n t o f 101 = ” )
6
7 // b
8 N2 = ’ 11011 ’ ; // b i n a r y o r d e r e d sequence
9 N = bin 2 dec ( N2 ); // d e c i m a l e q u i v a l e n t o f N2
10 disp ( ”b ” )
11 disp (N , ” d e c i m a le q u i v a l e n t o f 11 0 1 1 = ” )
Scilab code Exa 11.3 Find the binary and octal equivalents of 247
1 N = 247;
2 N2 = dec2 bin ( N ); // b i n a r y equivalent of N
3 N8 = dec2 oct ( N); // o c t a l e q u i v a l e n t o f N
4 disp ( N2 , ” b i n a r y equivalent of 247 = ” )
5 disp ( N8 , ” o c t a l e q u i v a l e n t o f 247 = ” )
Chapter 12
This code can be downloaded from the website wwww.scilab.in This code
can be downloaded from the website wwww.scilab.in This code can be down-
Scilab code Exa 15.1 Find A magneto motive force B current C relative
permiability and reluctance of each material
1 // a
2 phi = 6*10^ -4; // g i v e n m a g n e t i c f l u x ( i n Wb)
3 A = 0.001 ; // c r o s s s e c t i o n a l a r e a ( i n m e te r s q u a r e )
4 B = phi / A ; //
5 Ha = 10; // m a g n e t i c f i e l d i n t e n s i t y of mate
rial a needed to e s t a b l i s h the g i v e n
m agn etic flux
6 Hb = 77; // m a g n e t i c f i e l d i n t e n s i t y o f m a t e r i a l b
7 Hc = 270; // m a g n e t i c f i e l d i n t e n s i t y o f m a t e r i a l c
8 La = 0.3; // a r c l e n g t o f m a t e r i a ( i n m ete r
h al s)
9 Lb = 0.2; // a r c l e n g t o f m a t e r i b ( i n m eter s )
h al
10 Lc = 0.1; // a r c l e n g t o f m a t e r i c ( i n m eters )
h al
11
12 F = Ha * La + Hb * Lb + Hc * Lc ; // m a gn e t o m o t i v e f o r c e
13 disp ( ” a ” )
14 disp (F , ” m a g n e to m o ti v e f o r c e n e e d e d t o e s t a b l i s h a
f l u x o f 6∗10ˆ −4( i n At ) = ”)
15
16 // b
17 N = 100; // no . o f t u r n s
18 I = F / N ; // c u r r e n t i n amps
19 disp ( ”b ” )
20 disp (I , ” c u r r e n t t h a t must be made t o f l o w t h r o u g h
the c o i l ( i n amps ) = ”)
21
22 // c
23 MU0 = 4* pi *10^ -7;
24 MUa = B/ Ha ; // p e r m e a b i l i t o f m a t e r i a a
y l
25 MUb = B/ Hb ; // p e r m e a b i l i t o f m a t e r i a b
y l
26 MUc = B/ Hc ; // p e r m e a b i l i t o f m a t e r i a c
y l
27
28 MUra = MUa / MU0 // r e l a t i v e permeabili of materi
a
29 MUrb = ; MUb / // r e l a t i v e typermeab of almat e
b
30 MUrc = MU0 ; // r e l a t i v e ility of rial
c
MUc / MU0 permeabili materi
; ty al
31
32 Ra = Ha * La / phi ; // r e l u c t a n c o f m a t e r i a
e al
33 Rb = Hb * Lb / phi ; // r e l u c t a n c o f m a t e r i b
e al
34 Rc = Hc * Lc / phi ; // r e l u c t a n c o f m a t e r i c
e al
35
36 disp ( ” c ” )
37 disp ( MUra , ” r e l a t i v p e r m e a b i l i o f m a t e r i a a = ”)
e ty l
38 disp ( MUrb , ” r e l a t i v p e r m e a b i l i o f m a t e r i a b = ”)
e ty l
39 disp ( MUrc , ” r e l a t i v p e r m e a b i l i o f m a t e r i a c = ”)
e ty l
40 disp ( Ra , ” r e l u c t a n c o f m a t e r i a a = ”)
e l
41 disp ( Rb , ” r e l u c t a n c o f m a t e r i a b = ”)
e l
42 disp ( Rc , ” r e l u c t a n c o f m a t e r i a c = ”)
e l
Scilab code Exa 15.3 Find the mmf produced by the coil
1 // b
2 mu0 = 4* pi *10^ -7 ;
3 // p l u n g e r magnet d i m e n s i o n s ( i nm ete r s )
4 x = 0.025 ;
5 h = 0.05;
6 a = 0.025 ;
7 g = 0 .00125
;
8
9 mmf = 1414; // ( i n At )
10
11 F = pi *a* mu0 *( mmf ^2) *( h ^2) *(1/( x + h) ^2) /g;
// magnitude o f the force
12 disp (F , ” m a gn i t u de o f t h e f o r c e ( i n Newtons ) = ” )
Chapter 16
Transformers
1 // a
2 V1 = 1100; // h i g h e r v o l t a g e
3 V2 = 220; // l o w e r v o l t a g e
4 a = V1 / V2 ; // t u r n s r a t i o
5 r1 = 0.1; // h i g h v o l t a g e w i n d i n g r e s i s t a n c e ( i n ohms )
6 x1 = 0.3; // h i g h v o l t a g e l e a k a g e r e a c t a n c e ( i n ohms )
7 r2 = 0.004; // low v o l t a g e w i n d i n g r e s i s t a n c e ( i n ohms
)
8 x2 = 0.012; // low v o l t a g e l e a k a g e r e a c t a n c e ( i n ohms )
9
10 Re1 = r1 + ( a ^2)* r2 ; // e q u i v a l e n t wi ndi ng
r e s i s t a n c e r e f e r r e d to th e primary s i d e
11 Xe1 = x1 + ( a ^2)* x2 ; // e q u i v a l e n tl e a k a g r e a c t a n c
e e
r e f e r r e d to the primary s i d e
12 Re2 = ( r1 / a ^2) + ; // e q u i v a l e n t
r2 w in di ng
r e s i s t a n c e r e f e r r e d to th e secondary side
13 Xe2 = ( x1 / a ^2) + x2 ; // e q u i v a l e n tl e a k a g r e a c t a n c
e e
r e f e r r e d to the secondary side
14
15 disp ( ” a ” )
16 disp ( Re1 , ” e q u i v a l e n t winding resistance
r e f e r r e dto the p rim ary s i d e ”)
17 disp ( Xe1 , ” e q u i v a l e n t leakage reactance
r e f e r r e dto the primary s i d e ”)
18 disp ( Re2 , ” e q u i v a l e n t winding resistance
r e f e r r e d to the s e c o n d a r y s i d e ”)
19 disp ( Xe2 , ” e q u i v a l e n t leakage reactance
r e f e r r e d to the secondary si
d e ”)
20
21 // b
22 P = 100; // power ( i n kVA)
23 I21 = P *1000 / V1 ; // p r i m a r yw i n d i n g c u r r e n t r a t i n g
24 Vre1 = I21 * Re1 ; // e q u i v a l e n t resista
nce d r op (involt
s)
25 VperR1 = Vre1 *100/ V1 ; // % e q u i v a l e n t r e s i s t a n
c e drop
26
27 Vxe1 = I21 * Xe1 ; // e q u i v a l e n t reactan
ce dr o p (involt
s)
28 VperX1 = Vxe1 *100/ V1 ; // % e q u i v a l e n t reactan
ce d r op
29
30 disp ( ”b ” )
31 disp ( Vre1 , ” e q u i v a l e n t resistance
d r op expressed i n terms o
f p rim ary quantities(in v o l t s ) = ”)
32 disp ( VperR1 , ”% e q u i v a l e n t resistance
dr o p e x p r e s s e d i n terms of primary q
u a n t i t i e s = ”)
33 disp ( Vxe1 , ” e q u i v a l e n t reactance
d r op expressed i n terms o
f p rim ary q u a n t i t i e s ( i nv o l t s ) =”)
34 disp ( VperX1 , ”% e q u i v a l e n t reactance
dr o p e x p r e s s e d i n terms of p rim ary
q u a n t i t i e s = ”)
35
36 // c
37 I2 = a* I21 ; // s e c o n d a r yw i n d i n g c u r r e n t r a t i n g
38 Vre2 = I2 * Re2 ; // e q u i v a l e n t resista
nce dr o p (involt
s)
39 VperR2 = Vre2 *100/ V2 ; // % e q u i v a l e n t r e s i s t a n c e
drop
40
41 Vxe2 = I2 * Xe2 ; // e q u i v a l e n t r e a c t a n c e d r op ( i
n volts
)
42 VperX2 = Vxe2 *100/ V2 ; // % e q u i v a l e n t reactan
ce d r op
43
44 disp ( ” c ” )
45 disp ( Vre2 , ” e q u i v a l e n t resistance
d r op e x p r e s s e d i n terms o
f secondary q u a n t i t i e s ( i nv o l t s ) = ”)
46 disp ( VperR2 , ”% e q u i v a l e n t resistan
c e dr o p e x p r e s s e d i n terms of seconda
r y q u a n t i t i e s = ”)
47 disp ( Vxe2 , ” e q u i v a l e n t reactance
d r op e x p r e s s e d i n terms o
f secondary q u a n t i t i e s ( i nv o l t s ) =”)
48 disp ( VperX2 , ”% e q u i v a l e n t reactanc
e dr o p e x p r e s s e d i n terms of seconda
r y q u a n t i t i e s = ”)
49
50 // d
51 Ze1 = complex ( Re1 , Xe1 ); // e q u i v a l e n t l e a
k a g e impedance referred to the
primary
52 Ze2 = Ze1 / a ; // e q u i v a l e n t leakage
impedance r e f e r r e d to the
secondary
53
54 disp ( ”d ” )
55 disp ( Ze1 , ” e q u i v a l e n t leakage im p ed a n c e r
eferred to the primary = ”)
56 disp ( Ze2 , ” e q u i v a l e n t leakage im p ed a n c e r
eferred to the s e c o n d a r y = ”)
Scilab code Exa 16.2 Compute the 6 parameters of the equivalent
circuit referred to the high and low sides
1 Pl = 396; // w a t t m e t e r r e a d i n g on open c i r c u i t t e s t
2 Vl = 120; // v o l t m e t e r r e a d i n g on open c i
rcuit test
3 Il = 9.65; // ammeter r e a d i n g o open c i r c u i t t e s t
4 a = 2400 /120 ; // t u r n s ratio
5
6 theata = acos ( Pl /( Vl * Il ) ); // p h a s e d i f f e r e n c
e between v o l t a g e and current
7 Irl = Il * cos ( theata ); // r e s i s t i v e p a r t o f Im
8 Ixl = Il * sin ( theata ); // r e a c t i v e part o f Im
9
10 rl = Vl / Irl ; // low v o l t a g e w i n d i n g r e s i s t a n c e
11 rh = ( a ^2)* rl; // r l on th e h i g h s i d e
12 xl = Vl / Ixl ; // m a g n e t i z i n g reactance ref
e r r e d to the l o w e r s i d e
13 xh = ( a ^2) * xl ; // c o r r e s p o n d i n g h i gh s i d e value
14
15 Ph = 810; // w a t t m e t e r r e a d i n g on s h o r t c i r c u i t t e s t
16 Vh = 92; // v o l t m e t e r r e a d i n g on short ci
rcuit test
17 Ih = 20.8; // ammeter r e a d i n g ons h o r t c i r c u i t t e s t
18
19 Zeh = Vh / Ih ; // e q u i v a l e n t im p e a d a n c e r e f
e r r e d to the h i g h e r s i d e
20 Zel = Zeh /( a ^2) ; // e q u i v a l e n t impedance r
eferred to the lower side
21 Reh = Ph /( Ih ^2) ; // e q u i v a l e n t resistance
referred to the higher si
de
22 Rel = Reh /( a ^2) ; // e q u i v a l e n t resistance
referred to the lower si
de
23 Xeh = sqrt (( Zeh ^2) - ( Reh ^2) ); // e q u i v a l
entreact ance r e f e r r e d to the
higher side
24 Xel = Xeh /( a ^2) ; // e q u i v a l e n t reactance
referred to the lower si
de
25
26 disp ( Zeh , ” e q u i v a l e n t im p e a d a n c e r e f
e r r e d to the h i g h e r side = ”)
27 disp ( Zel , ” e q u i v a l e n t im p ed a n c e r e f e r r e d t o
the l o w e r s i d e = ”)
28 disp ( Reh , ” e q u i v a l e n t resistance ref
e r r e d to the h i g h e r s i d e = ”)
29 disp ( Rel , ” e q u i v a l e n t resistance ref
e r r e d to the l o w e r s i d e = ”)
30 disp ( Xeh , ” e q u i v a l e n t reactance referred to
the
h i g h e r s i d e = ”)
31 disp ( Xel , ” e q u i v a l e n t reactance referred
to the lowerside=
”)
1 // a
2 P = 50; // power r a t i n g ( i n kVA)
3 Ph = 810; // w a t t m e t e r r e a d i n g on s h o r t c i r c u i t t e s t
4 Pl = 396; // w a t t m e t e r r e a d i n g on open c i r c u i t t e s t
5 Ih = 20.8; // ammeter r e a d i n g on s h o r t c i r c u i t t e s t
6 pf = 0.8; // power f a c t o r = 0 . 8 l a g g i n g
7
8 losses = ( Ph + Pl ) /1000 ; // l o s s e si n kW
9 outputP = P* pf ; // o u t p u t power
10 inputP = outputP + losses ; // i n p u tpower
11
12 efficiency = outputP / inputP ;
13 disp ( ” a ” )
14 disp ( efficiency , ” e f f i c i e n c y = ” )
15
16 // b
17 Xeh = 4; // e q u i v a l e n tr e a c t a n c e r e f e r r e d t o the
higherside
18 Reh = 1.87; // e q u i v a l e n tr e s i s t a n c e r e f e r r e d t o the
h i g h e rs i d e
19 Zeh = complex ( Reh , Xeh ); // e q u i v a l e n t
im peda nce r e f e r r e d to th e h i
gher side
20 ih = complex ( Ih * pf , - Ih * sqrt (1 - ( pf ^2) ) );
21 V1 = 2400 + Zeh * ih ; // p r i m a r y v o l t a g e
22
23 v olta ge Re gu lation = ( real ( V1 ) -2400) *10 0 /2400 ;
// p e r c e n t voltage regulation
24 disp ( ”b ” )
25 disp ( voltage Regulation , ” p e r c e n t voltage r
e g u l a t o n = ”)
Chapter 18
Scilab code Exa 18.1 Find A input line current and power factor B
devel- oped electromagnetic torque C horse power output D efficiency
1 // a
2 V1 = 440/ sqrt (3) ;
3 s = 0.025 ; // s l i p
4 r1 = 0.1;
5 r2 = 0.12;
6 x1 = 0.35;
7 x2 = 0.4;
8
9 z = complex ( r1 + r2 /s , x1 + x2 );
10 i2 = V1 / z ; // i n p u t line current
11 I2 = sqrt ( real ( i2 ) ^2 + imag ( i2 ) ^2) ; // m a g n i tu d e
ofinput li
ne current
12 disp ( ” a ” )
13 disp ( i2 , ” i n p u tl i n e c u r r e n t = ” )
14
15 i1 = complex (18* cos ( -1.484) , 18* sin ( -1.484) );
// m a g n e t i z i n g c u r r e n t
16 I1 = sqrt ( real ( i1 ) ^2 + imag ( i1 ) ^2) ; // m a g n i tu d e o f
magnetizing current
17 i = i1 + i2 ; // t o t a lc u r r e n t drawn from t h e v o l t a g
esource
18 I = sqrt ( real ( i ) ^2 + imag ( i ) ^2) ; // m a gn i t u d e
oftotal c
urrent
19 theta = atan ( imag ( i )/ real ( i ) ); // p h a s e d i f f e r e n
c e between current and vol
tage
20 pf = cos ( theta ); // power f a c t o r
21 disp ( pf , ” power f a c t o r = ” )
22 if theta >= 0 then
23 disp ( ” l e a d i n g ” )
24 else disp ( ” l a g g i n g ” )
25 end
26
27 // b
28 f = 60; // h e r t z
29 ns = 1800;
30 ws = 2* pi * ns / f ; // s t a t o r angular velocity
31 Pg = 3* I2 ^2* r2 / s ; // power
32 T = Pg / ws ; // d e v e l o p e d electromagnetic
torque
33 disp ( ”b ” )
34 disp (T , ” d e v e l o p e d electromagneic −
torque ( i n Newton meter )
= ”)
35
36 // c
37 Prot = 950; // r o t a t i o n a l l o s s e s ( i n w a t t s )
38 Po = Pg *(1 - s ) - Prot ; // o u t p u t power
39 HPo = Po /746; // o u t p u t h o r s e power
40 disp ( ” c ” )
41 disp ( HPo , ” o u t p u t h o r s e power = ” )
42
43 // d
44 Pc = 1200; // c o r e l o s s e s ( i n W)
45 SCL = 3* I ^2* r1 ; // s t a t o r copper loss
46 RCL = 3* I2 ^2* r2 ; // r o t a r copper loss
47 loss = Pc + SCL + RCL + Prot ; // t o t a ll o s s e s
48 Pi = real (3* V1 * i); // i n p u t power
49 efficiency = 1 - ( loss / Pi );
50 disp ( efficiency , ” e f f i c i e n c y = ” )
Chapter 19
Computations of Synchronous
Motor Performance
Scilab code Exa 19.1 Find A induced excitation voltage per phase B line
current C power factor
1 // a
2 efficiency = 0.9;
3 Pi = 200 *746 / eff iciency ; // i n p u t power
4 x = 11; // r e a c t a n c e o f t h e motor
5 V1 = 2300/ sqrt (3) ; // v o l t a g er a t i n g
6 delta = 15* pi /180; // power a n g l e
7 Ef = Pi * x /(3* V1 * sin ( delta )) ; // t h e in
ducedexcitation voltage per
phase
8 disp ( ” a ” )
9 disp ( Ef , ” t h e i n d u c e d e x c i t a t i o n v o l t a g e p e r p h a s e
= ”)
10
11 // b
12 z = complex (0 , x ); // im p e d a n c e o f t h e motor
13 ef = complex ( Ef * cos (- delta ) , Ef * sin (- delta ) );
14
15 Ia = ( V1 - ef )/ z ; // a r m a t u r e current
16 disp ( ”b ” )
17 disp ( Ia , ” a rm a t u r c u r r e n t = ” )
18
19 // c
20 theata = atan ( imag ( Ia )/ real ( Ia )) ; // p h a s e d i f f e r e
n c e between I a and V1
21 pf = cos ( theata ); // power f a c t o r
22
23 disp ( ” c ” )
24 disp ( pf , ” power f a c t o r = ” )
25
26 if sin ( theata ) > 0 then
27 disp ( ” l e a d i n g ” )
28 else
29 disp ( ” l a g g i n g ” )
30 end
Chapter 20
DC
machines
Scilab code Exa 20.2 Caculate A electromagnetic torque B flux per pole C
rotational losses D efficiency E shaft laod
1 // a
2 Vt = 230; // ( i n v o l t s )
3 Ia = 73; // a r m a t u r e c u r r e n t ( i n amps )
4 If = 1.6; // f e i l d c u r r e n t ( i n amps )
5 Ra = 0.188; // a r m a t u r e c i r c u i t r e s i s t a n c e ( i n ohms )
6 n = 1150; // r a t e d s p e e d o f t h e r o t o r ( i n rpm )
7 Po = 20 *746 ; // output power ( i n watts )
8
9 Ea = Vt - ( Ia * Ra ); // a r m a t u r e v o l t a g e
10 wm = 2* pi * n /60; // r a t e d sp eed o f the r o t o
r
sec) ( i n rad /
11 T = Ea * Ia / wm ; // e l e c t r o m a g n e t i c t o r q u e
12
13 disp ( ” a ” )
14 disp (T , ” e l e c t r o m a g n e t i c t o r q u e = ” )
15
16 // b
17 a = 4; // no . o f p a r a l l e l a r m a t u r e p a t h s
18 p = 4; // no . o f p o l e s
19 z = 882; // no . o f a r m a t u r e c o n d u c t o r s
20 flux = Ea *60* a /( p* z * n); // f l u x per p o l e ( i n Wb)
21
22 disp ( ”b ” )
23 disp ( flux , ” f l u x p e r p o l e = ” )
24
25 // c
26 Prot = ( Ea * Ia ) - Po ; // r o t a t i o n a l loss(in wa tt )
27 disp ( ” c ” )
28 disp ( Prot , ” r o t a t i o n a l l o s s e s = ” )
29
30 // d
31 losses = Prot + ( Ia ^2 * Ra ) + ( Vt * If ) ;
32 Pi = ( Ea * Ia ) + ( Ia ^2 * Ra ) + ( Vt * If ); // i
n p u t power
33 efficiency = 1 - ( losses / Pi );
34
35 disp ( ”d ” )
36 disp ( efficiency , ” e f f i c i e n c y = ” )
1 // f i n a l f l u x = 0 . 8∗ i n i t i a l f l u x
2 Ia1 = 73; // i n i t i a l a r m a t u r e c u r r e n t ( i n amps )
3 Vt = 230; // ( i n v o l t s )
4 Ra = 0.188; // a r m a t u r e c i r c u i t r e s i s t a n c e
5 n1 = 1150; // i n i t i a l r o t o r s p e e d ( i n rpm )
6 Ea1 = 216.3 ; // i n i t i a l a r m a t u r e v o l t a g e
7
8 Ia2 = (1 /0 .8 ) * Ia1 ; // f i n a l a r m a t u r ec u r r e n t
9 Ea2 = Vt - ( Ia2 * Ra ); // f i n a l armature voltag
e
10
11 n2 = ( Ea2 / Ea1 ) *(1 /0 .8 ) * n1 ; // f i n a l rotor sp eed
12
13 disp ( n2 , ” f i n a l r o t o r s p e e d ( i n rpm ) = ” )
Scilab code Exa 20.4 find A motor speed B required pulse frequency C
repeat part A and B for the given ON time to cycle time ratio
1 // a
2 rop = 0.4; // r a t i o o f ON t i m e T0 t o c y c l e t i m e Tp
3 Vb = 550; // r a t e d t e r m i n a l v o l t a g e o f t h e dc motor
4 Ia = 30; // c u r r e n t drawn by t h e motor ( i n amps )
5 Ra = 1; // a r m a t u r e c i r c u i t r e s i s t a n c e ( i n ohms )
6 ts = 5.94; // t o r q u e and s p e e d p a r a m e t e r o f t h e motor
( i n N−m/A)
7
8 Vm = rop * Vb ; // a v e r a g e value o f the
armature
t e r m i n a lv o l t a g e
9 Ea = Vm - ( Ia * Ra ); // i n d u c e d armature
voltage
10
11 wm = Ea / ts ; // motor s p e e d ( i n r a d / s )
12 disp ( ” a ” )
13 disp ( wm , ” motor s p e e d ( i n r a d / s ) = ” )
14
15 // b
16 delta I = 5; // c h a n g e o f armature c u r r e n t d u r i n the
g
ON p e r i o d
17 La = 0.1; // a r m a t u r e win din g i n d u c t a n c e ( i n H)
18 To = La * delta I /( Vb Ea ); //ON t i m e
-
19 Tp = To / rop ; // c y c l t ime
e
20
21 f = 1/ Tp ; // r e q u i r e d pulses per sec on d
22 disp ( ”b ” )
23 disp (f , ” r e q u i r e d p u l s e s p e r s e c o n d = ” )
24
25 // c
26 rop = 0.7; // new r a t i o o f ON t i m e T0 t o c y c l e t
ime Tp
27 Vm = rop * Vb ; // a v e r a g e v a l u e o f the armature
t e r m i n a lv o l t a g e
28 Ea = Vm - ( Ia * Ra ); // i n d u c e d armature voltag
e
29
30 wm = Ea / ts ; // motor s p e e d ( i n r a d / s )
31 disp ( ” c ” )
32 disp ( wm , ” motor s p e e d w i t h To/Tp e q u a l t o 0 . 7 ( i n r a d
/ s ) = ”)
33
34 To = La * delta I /( Vb - Ea ); //ON t i m e
35 Tp = To / rop ; // c y c l et i m e
36
37 f = 1/ Tp ; // r e q u i r e d pulses per sec on d
38 disp (f , ” r e q u i r e d p u l s e s p e r s e c o n d w i t h To/Tp e q u a
l to 0 . 7 = ”)
Chapter 23
Principles of Automatic
Control
Scilab code Exa 23.1 Determine the new transfer gain and feedback factor
Dynamic behaviour of
Control systems
Scilab code Exa 24.2 find A dynamic response of the system B position
lag error C change in amplifier gain D damping ratio and maximum
percent overshoot E output gain factor for maximum overshoot equal to
25percent
1 // a
2 // p ar am et er v a l u e s
3 Kp = 0.5; //V/ r a d
4 Ka = 100; //V/V
5 Km = 2*10^ -4 ; // lb − f t /V
6 F = 1.5*10^ -4; // l b − f t / r a d / s
7 J = 10^ -5 // s l u g − f t ˆ2
8
9 K = Kp* Ka* Km ; // l o o p p r o p o t i o n a l g a i n
10 dr = F /(2* sqrt ( K * J ) ); // dampingr a t i o
11 wn = sqrt ( K/ J );
12 ts = 5/( dr * wn );
13 wd = wn * sqrt (1 - dr ^2) ; // f r e q u e n c y a t whic h
damped o s c i l l a t i o n s occur
14 disp ( ” a ” )
15 disp ( wd , ” damped o s c i l l a t i o n s o c c u r a t a f r e q u e n c y
= ”)
16 disp ( dr , ” damping r a t i o = ” )
17
18 // b
19 Tl = 10^ -3; // l o a d d i s t u r b a n c e( l b − f t )
20 e = Tl / K; // p o s i t i o n l a g e r r o r
21 disp ( ”b ” )
22 disp (e , ” p o s i t i o n l a g e r r o r ( i n r a d ) = ” )
23
24 // c
25 KaNew = ( e /0 .025 ) * Ka ; // new l o o p g a i n
26 disp ( ” c ” )
27 disp ( KaNew , ” new l o o p g a i n f o r which t h e p o s i t i o n l a
gerror is e q u a l to 0 . 0 2 5 rad = ”)
28
29 // d
30 drNew = F /(2* sqrt ( Kp * Ka New * Km * J ) ); // new
damping r a t i o
31 disp ( ”d ” )
32 disp ( drNew , ” new damping r a t i o = ” )
33
34 // e
35 // f o r a maximum o v e r s h o o t of 25% ,( F + Qo) / 2 ∗ s q r t
(K
∗ J)=0.4
36 Qo = (0 .4 *2 * sqrt ( Kp * Ka New * Km * J )) - F ;
37 Ko = Qo /( Ka New * K ) ; // o u t p u t gain factor
38 disp ( ” e ” )
39 disp ( Ko , ” o u t p u t g a i n f a c t o r = ” )