Electrical Engineering Fundamentals_V. Del Toro

download Electrical Engineering Fundamentals_V. Del Toro

of 62

Transcript of Electrical Engineering Fundamentals_V. Del Toro

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    1/62

    Scilab Textbook Companion for

    Electrical Engineering Fundamentals

    by V. Del Toro1

    Created byAditi Pohekar

    Electrical EngineeringElectrical Engineering

    IIT BombayCollege Teacher

    Madhu N. BelurCross-Checked by

    Mukul R. Kulkarni

    August 10, 2013

    1Funded by a grant from the National Mission on Education through ICT,http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilabcodes written in it can be downloaded from the Textbook Companion Projectsection at the website http://scilab.in

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    2/62

    Book Description

    Title: Electrical Engineering Fundamentals

    Author: V. Del Toro

    Publisher: Prentice - Hall International

    Edition: 2

    Year: 2009

    ISBN: 9780132475525

    1

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    3/62

    Scilab numbering policy used in this document and the relation to theabove book.

    Exa Example (Solved example)

    Eqn Equation (Particular equation of the above book)

    AP Appendix to Example(Scilab Code that is an Appednix to a particularExample of the above book)

    For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 meansa scilab code whose theory is explained in Section 2.3 of the book.

    2

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    4/62

    Contents

    List of Scilab Codes 5

    1 The Fundamental laws of Electrical Engineering 8

    2 The circuit elements 9

    3 Elementary network theory 16

    4 Circuit differential equations Forms and Solutions 22

    5 Circuit dynamics and forced responses 23

    6 The laplace transform method of finding circuit solutions 25

    7 Sinusoidal steady state response of circuits 26

    9 Semiconductor electronic devices 34

    11 Binary logic Theory and Implimentation 37

    12 Simplifying logical functions 39

    15 Magnetic circuit computations 40

    16 Transformers 44

    18 The three phase Induction motor 50

    19 Computations of Synchronous Motor Performance 53

    3

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    5/62

    20 DC machines 55

    23 Principles of Automatic Control 59

    24 Dynamic behaviour of Control systems 60

    4

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    6/62

    List of Scilab Codes

    Exa 1.1 force between two like charges in free space . . . . . . 8Exa 2.1.a Determine the current flow and voltage drop across the

    resistor . . . . . . . . . . . . . . . . . . . . . . . . . . 9Exa 2.1.b Determine the current flow and voltage drop across each

    resistor . . . . . . . . . . . . . . . . . . . . . . . . . . 9Exa 2.1.c Repeat parts A and B with the voltage source replaced

    by a current source of 1A . . . . . . . . . . . . . . . . 10Exa 2.2 From the given list of resistors choose a suitable resistor

    which can carry a current of 300mA . . . . . . . . . . 10Exa 2.3 Find the resistance of the round copper conductor hav-

    ing the given specifications . . . . . . . . . . . . . . . 11Exa 2.4 Find the resistance of the round copper conductor hav-

    ing the given specifications . . . . . . . . . . . . . . . 11

    Exa 2.5 Find the time variation of the voltage drop appearingacross the inductor terminals . . . . . . . . . . . . . . 12

    Exa 2.6 Find the time variation of the capacitor voltage . . . . 13Exa 2.7 Find A actual value of the voltage gain of the opamp

    circuit B ideal value of the voltage gain C percent error 14Exa 2.8 Design a non inverting opamp circuit of voltage gain 4 14Exa 2.9 Find the input resistance of an inverting opamp circuit

    with voltage gain of 4 . . . . . . . . . . . . . . . . . . 15Exa 3.1 for the given circuit calculate the current flowing from

    the voltage source . . . . . . . . . . . . . . . . . . . . 16Exa 3.2 Calculate the potential difference across terminals bc . 16

    Exa 3.3 Determine the equivalent series circuit . . . . . . . . . 17Exa 3.4 Value of E for which power dissipation in R5 is 15W R5

    is 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    5

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    7/62

    Exa 3.8 Find current flowing through all the branches of the

    circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Exa 3.12 Find A current flowing through Rl B valye of Rl forwhich the power transfer is maximum and the maximumpower . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    Exa 3.13 Find the current flowing through R2 by using Nortonscurrent source equivalent circuit . . . . . . . . . . . . 21

    Exa 4.3 Determine the operational driving point impedances ap-pearing at terminals ad and dg . . . . . . . . . . . . . 22

    Exa 5.2 Find the expression for the current flowing through thecircuit and the total energy dissipated in the resistor . 23

    Exa 6.1 Find the laplace transform of the given pulse . . . . . 25

    Exa 7.1 Find the average value of the given periodic function . 26Exa 7.2 Determine the power factor and average power delivered

    to the circuit . . . . . . . . . . . . . . . . . . . . . . . 26Exa 7.3 Find the expression for the sum of i1 and i2 . . . . . . 27Exa 7.4 Find the effective value of the resultant current . . . . 27Exa 7.5 Find the time expression for the resultant current. . . 28Exa 7.6 Find the value of the given expression . . . . . . . . . 29Exa 7.7 Find A value of steady state current and the relative

    phase angle C magnitude and phase of voltage dropsappearing across each element D average power E power

    factor . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Exa 7.8 Find the equivalent impedance appearing between pointsa and c . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Exa 7.9 Find the current which flows through branch Z3 . . . 31Exa 7.10 Find the current in the Z3 branchby using the Nodal

    method . . . . . . . . . . . . . . . . . . . . . . . . . . 32Exa 7.11 Find the current flowing through Z3 by using Thevinins

    theoram. . . . . . . . . . . . . . . . . . . . . . . . . . 33Exa 9.2 Find the values of self bais source resistance and drain

    load resistance at Q point . . . . . . . . . . . . . . . . 34Exa 9.3 Find A midband frequency current gain of the first stage

    B bandwidth of the first stage amplifier . . . . . . . . 34Exa 11.1 Determine th decimal equivalents of the binary numbers

    A 101 B 11011 . . . . . . . . . . . . . . . . . . . . . . 37Exa 11.2 Determine the decimal equivalent of A octal number 432

    B hexadecimal number C4F . . . . . . . . . . . . . . . 37

    6

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    8/62

    Exa 11.3 Find the binary and octal equivalents of 247. . . . . . 38

    Exa 15.1 Find A magneto motive force B current C relative per-miability and reluctance of each material . . . . . . . 40Exa 15.3 Find the mmf produced by the coil . . . . . . . . . . . 41Exa 15.5 B Find the magnetic force exerted on the plunger . . . 43Exa 16.1 Find A equivalent resistance and reactance referred to

    both the sides B voltage drops across these in Volts andin per cent of the rated winding voltage C Repeat B forthe low voltage side D equivalent leakage impedancesreferred to both the sides . . . . . . . . . . . . . . . . 44

    Exa 16.2 Compute the 6 parameters of the equivalent circuit re-ferred to the high and low sides . . . . . . . . . . . . . 46

    Exa 16.3 For the transformer compute A efficiency B voltage reg-ulation . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    Exa 18.1 Find A input line current and power factor B developedelectromagnetic torque C horse power output D efficiency 50

    Exa 19.1 Find A induced excitation voltage per phase B line cur-rent C power factor . . . . . . . . . . . . . . . . . . . 53

    Exa 20.2 Caculate A electromagnetic torque B flux per pole Crotational losses D efficiency E shaft laod . . . . . . . 55

    Exa 20.3 Determine the new operating speed. . . . . . . . . . . 56Exa 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 57Exa 23.1 Determine the new transfer gain and feedback factor . 59Exa 24.2 find A dynamic response of the system B position lag

    error C change in amplifier gain D damping ratio andmaximum percent overshoot E output gain factor formaximum overshoot equal to 25percent . . . . . . . . 60

    7

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    9/62

    Chapter 1

    The Fundamental laws of

    Electrical Engineering

    Scilab code Exa 1.1 force between two like charges in free space

    1 E 0 = 1 /( 3 6* % p i * 10 ^9 ) ; // p e r m i t i v i t y i n f r e e s pa ce2 k = 4* %pi *E0 ;

    3 q 1 = 1; / / c ha r ge on t he f i r s t p a r t i c l e i n c ou lo mb s4 q 2 = 1; // c ha rg e on t he s ec on d p a r t i c l e i n co ul om bs5 d = 1 ; // d i s t a n ce b et we e n t he p a r t i c l e s i n m e te r6 F = ( q 1 * q2 ) / ( k* d ^ 2) ; / / f o r c e b et we en t h e two

    p a r t i c l e s i n n ew t ons7

    8 disp (F , f o r c e i n f r e e s pa ce b et w ee n t he twop a r t i c l e s i s i n Newtons i s : )

    8

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    10/62

    Chapter 2

    The circuit elements

    Scilab code Exa 2.1.a Determine the current flow and voltage drop acrossthe resistor

    1 V = 1 ; // v o l t a g e s up pl y2 R = 10; // r e s i s t a n c e i n ohms3 I = V / R / / c u r r e nt f l o w i n g t hr ou gh R4 disp ( a ) )5 disp (V , v o l t ag e a c r o s s t he r e s i s t o r ( i n v o l t s )= )

    6 disp (I , c u r r e nt f l o wi n g t hr ou gh t he r e s i s t o r ( i namps) = )

    Scilab code Exa 2.1.b Determine the current flow and voltage drop acrosseach resistor

    1 V = 1 ; // v o l t a g e s up pl y2 R 1 = 10; // f i r s t r e s i s t a n c e i n ohms3 R 2 = 5; // r e s i s t a n c e o f t h e s ec o nd r e s i s t o r4 Vr1 = V * ( R1 /( R1 + R2 )) ; / / v o l t a g e a c r o s s R15 Vr2 = V - Vr1 ; / / v o l t a g e a c r o s s R26 I r = V r1 / R1 ; / / c u r r e nt f l o w i n g t hr ou gh R

    9

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    11/62

    7

    8 disp ( V r 1 , v o l t a g e a c r o s s t he f i r s t r e s i s t o r ( i nv o l t s )= )9 disp ( V r 2 , v o l t a ge a c r o s s t he s ec on d r e s i s t o r ( i n

    v o l t s )= )10 disp ( I r , c u r r e nt f l o w i n g t hr ou gh t he 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 a2 R 1 = 10; // f i r s t r e s i s t a n c e i n ohms3 I = 1 ; // c u r r e nt s o ur c e4 V = I *R1 ; // v o l t a ge a c r o s s R5 disp ( c a ) )6 disp (V , v o l t ag e a c r o s s t he r e s i s t o r ( i n v o l t s )= )7 disp (I , c u r r e nt f l o wi n g t hr ou gh t he r e s i s t o r ( i n

    amps) = )8

    9 // c b10 Vr1 = I * R1 ; // v o l t a ge a c r o s s R111 Vr2 = I * R2 ; / / v o l t a g e a c r o s s R212 disp ( c b ) )13 disp ( V r , v o l t a g e a c r o s s t he r e s i s t o r ( i n v o l t s )= )14 disp (I , c u r r e nt f l o wi n g t hr ou gh t he 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 ohms2 I = 0.3; // c u r r e nt i n amps

    10

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    12/62

    3 P = I ^2 * R ; / / p ow er

    4 // power s p e c i f i c a t i o n o f t h e r e s i s t o r s a v a i l a b l e i nt he s t o ck5 P a = 5;

    6 P b = 7. 5;

    7 P c = 10;

    8

    9 if Pa > P then

    10 disp ( we s ho u ld s e l e c t r e s i s t o r a )11 end

    12 if Pb > P then

    13 disp ( we s h o u ld s e l e c t r e s i s t o r b )

    14 end15 if Pc > P then

    16 disp ( we s ho u ld s e l e c t r e s i s t o r c )17 end

    Scilab code Exa 2.3 Find the resistance of the round copper conductorhaving the given specifications

    1 L = 1 ; // l e ng t h o f t he c op pe r w ir e i n m et er s2 A = 1 * 10^ -4; // c r o s s s e c t i o n a l a re a o f t h e w i re

    i n m et er s q ua r e3 rho = 1 .7 24 * 10^ - 8; / / r e s i s t i v i t y o f c o p p e r i n ohm

    me t e r4 R = rho *L / A ; // r e s i s t a n c e o f t he w ir e i n ohm5

    6 disp (R , r e s i s t a n c e o f t he w i re ( i n ohms )= )

    Scilab code Exa 2.4 Find the resistance of the round copper conductorhaving the given specifications

    1 / / 1 i n c h e s = 0 . 0 2 5 4 m e te r s

    11

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    13/62

    2 // 1 f o o t = 0 . 3 04 8 m et er s

    3 d = 0 . 1* 0 .0 2 54 ; // d ia me te r o f t he w ir e i n m et er s4 L = 1 0* 0. 30 48 ; // l e ng t h o f t he w ir e i n m et er s5 r ho = 1 .7 24 *1 0^ - 8 ; / / r e s i s t i v i t y o f t h e w i r e i n ohm

    me t e r6 A = % pi * ( d /2 ) ^ 2; // c r o s s s e c t i o n a l a re a o f t h e w i re7 R = r ho * L /A ; // r e s i s t a n c e o f t he w ir e i n ohm8 disp (R , r e s i s t a n c e o f t he w i re ( i n ohm )= )

    Scilab code Exa 2.5 Find the time variation of the voltage drop appearingacross the inductor terminals

    1 L = 0.1; // i nd uc ta nc e o f t h e c o i l i n he n r y2 t 1 = [ 0 :0 . 00 1 :0 . 1] ;

    3 t 2 = [ 0 .1 0 1: 0 .0 0 1: 0 .3 ] ;

    4 t 3 = [ 0 .3 0 1: 0 .0 0 1: 0 .6 ] ;

    5 t 4 = [ 0 .6 0 1: 0 .0 0 1: 0 .7 ] ;

    6 t 5 = [ 0 .7 0 1: 0 .0 0 1: 0 .9 ]

    7 // c u r r e n t v a r i a t i o n a s a f u nc t i o n o f t i m e8 i 1 = 1 00 * t1 ;

    9 i 2 = ( -50* t2 ) + 15;

    10 i 3 = -100* sin ( % p i * ( t 3 - 0 . 3 ) / 0 . 3 ) ;

    11 i 4 = ( 10 0* t4 ) - 60;

    12 i 5 = ( -50* t5 ) + 45;

    13

    14 t = [ t1 , t 2 , t3 , t 4 , t5 ] ;

    15 i = [ i1 , i 2 , i3 , i 4 , i5 ] ;

    16 plot (t , i )

    1718 d t = 0 .0 01 ;

    19 di = diff ( i ) ;

    20 V = L *di / dt ; // v o l t a g e d ro p a p pe a ri n g a c r o s s t hei n d uc t or t e r mi n a l s

    12

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    14/62

    21 T v = [ 0 :0 . 00 1 :0 . 89 9 ];

    22 plot ( T v , 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 pa c it a nc e o f t h e c a p ac i t o r i n F a r ad s2 t 1 = [ 0 :0 . 00 1 :0 . 1] ;

    3 t 2 = [ 0 .1 0 1: 0 .0 0 1: 0 .3 ] ;4 t 3 = [ 0 .3 0 1: 0 .0 0 1: 0 .6 ] ;

    5 t 4 = [ 0 .6 0 1: 0 .0 0 1: 0 .7 ] ;

    6 t 5 = [ 0 .7 0 1: 0 .0 0 1: 0 .9 ]

    7 // c u r r e n t v a r i a t i o n a s a f u nc t i o n o f t i m e8 i 1 = 1 00 * t1 ;

    9 i 2 = ( -50* t2 ) + 15;

    10 i 3 = -100* sin ( % p i * ( t 3 - 0 . 3 ) / 0 . 3 ) ;

    11 i 4 = ( 10 0* t4 ) - 60;

    12 i 5 = ( -50* t5 ) + 45;

    13

    14 t = [ t1 , t 2 , t3 , t 4 , t5 ] ;15 i = [ i1 , i 2 , i3 , i 4 , i5 ] ;

    16 plot (t , i )

    17

    18 / / v o l t a g e a c r o ss t h e c a p a c i t o r a s a f u n c t i o n o f t i m e

    19 V 1 = (1 /C )* i n t e g r a t e ( 10 0t , t , 0 , t 1 ) ;20 V 2 = (1 /C )* i n t e g r a t e ( (50 t )+15 , t , 0 . 1 01 , t 2 ) ;21 V 3 = (1 /C )* i n t e g r a t e ( 100s i n ( %pi ( t 0 . 3 ) / 0 . 3 ) , t

    , 0 . 3 0 1 , t 3 ) ;

    22 V 4 = (1 /C )* i n t e g r a t e ( ( 100

    t )

    60 , t , 0 . 6 01 , t 4 ) ;23 V 5 = (1 /C )* i n t e g r a t e ( (50 t ) + 4 5 , t , 0 . 7 01 , t 5 ) ;24 V = [ V 1 , V 2 , V 3 , V 4 , V 5 ] ;

    25

    26 plot (t , V , g r e e n )

    13

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    15/62

    Scilab code Exa 2.7 Find A actual value of the voltage gain of the opampcircuit B ideal value of the voltage gain C percent error

    1 // a2 R i = 1;

    3 R f = 39;

    4 A = 10 ^5 ; // open l oo p g ai n o f t he opamp5 G = A /( 1 + ( A *Ri / ( Ri + Rf ) )) ; // a c t ua l v o l t a g e g ai n o f

    t h e c i r c u i t6 disp ( a )7 disp (G , a c t u a l v o l t a ge o f t h e c i r c u i t = )8

    9 // b10 G1 = 1 + ( Rf /Ri ); // v o l t a g e g ai n o f t h e c i r c u i t

    w i t h i n f i n i t e o pe n l o o p g a i n11 disp ( b )12 disp ( G 1 , f o r i d e a l c as e t h e v o l t a ge g ai n = )13

    14 // c15 e r = (( G 1 - G ) /G ) *1 00 ; / / p e r c e n t e r r o r16 disp ( c )17 disp ( e r , p e rc e nt e r r o r o f t he i d e a l v al ue compared

    t o t he a c t u a l v a lu e= )

    Scilab code Exa 2.8 Design a non inverting opamp circuit of voltage gain4

    1 G = 4 ; // v o l t a g e g ai n o f t h e c i r c u i t2 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 g opamp c i r c u i t3 disp (r , R f /R i = )

    14

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    16/62

    4 // R e su l t :

    5 //A s u i t a b l e c h o i ce 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 gopamp c i r c u i t

    3 disp (r , R f / R i )4 // R e su 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 .5K6 // t h e r e f o r e i np ut r e s i s t a n c e R1 = 7 . 5K

    This code can be downloaded from the website wwww.scilab.in

    15

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    17/62

    Chapter 3

    Elementary network theory

    Scilab code Exa 3.1 for the given circuit calculate the current flowing fromthe voltage source

    1 V = 100; // v o l a ta g e s up pl y i n v o l t s2 R s = 40; // r e s i s t a n c e i n s e r i e s i n ohms3 // p a r a l l e l r e s i s t a n c e s i n ohms4 R p1 = 3 3. 33 ;

    5 R p2 = 50;

    6 R p3 = 20;7 R p i n v = ( 1 / R p1 ) + ( 1 / R p 2 ) + (1 / R p 3 ) ; / / r e c i p r o c a l o f

    e q u i v a l e n t r e s i s t a n c e i n p a r a l l e l8 Req = Rs + (1/ Rpinv ) ;

    9 I = V / R e q ; // c u r r e n t f l o wi n g from t he v o l t ag e s o ur c ei n amps

    10 disp (I , c u r r e nt f l o w i n g fr om t he v o l t a g e s o u r ce ( i na m p s ) = )

    Scilab code Exa 3.2 Calculate the potential difference across terminals bc

    1 V = 100; // v o l a ta g e s up pl y i n v o l t s

    16

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    18/62

    2 R s = 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 s i n ohms4 R p1 = 3 3. 33 ;5 R p2 = 50;

    6 R p3 = 20;

    7 R p i n v = ( 1 / R p1 ) + ( 1 / R p 2 ) + (1 / R p 3 ) ; / / r e c i p r o c a l o f e q u i v a l e n t r e s i s t a n c e i n p a r a l l e l

    8 R p = 1/ R pi nv ; // 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 l9 V b c = V *( Rp / ( Rs + Rp ) ); // 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 bc10 disp ( V b c , p o t e n t i a l d i f f e r e n c e a c r o ss bc = )

    Scilab code Exa 3.3 Determine the equivalent series circuit

    1 / / r e s i s t a n c e s i n ohms2 R 1 = 25;

    3 R 2 = 30 0;

    4 R 3 = 80;

    5 R 4 = 30;

    6 R 5 = 60;

    78 R c d = R5 * R4 / ( R5 + R4 ) ;

    9 Rbd1 = Rcd + R3 ;

    10 R bd = R bd 1 * R2 / ( Rb d1 + R 2) ;

    11 Req = Rbd + R1 ; // e q u i v a l e nt r e s i s t a n c e12 disp ( R e q , e q ui 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 s i n ohms2 R 1 = 25;

    3 R 2 = 30 0;

    17

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    19/62

    4 R 3 = 80;

    5 R 4 = 30;6 R 5 = 60;

    7

    8 P 5 = 15; // p ower d i s s i p a t e d i n R5 ( i n wa tt )9

    10 I5 = sqrt ( P 5 / R 5 ) ; / / c u r r e n t f l o w i n g t h ro u gh R511 V5 = R5 *I5 ; / / v o l t a g e a c r o s s R512 Vcd = V5 ; / / v o l t a g e a c r o s s cd13

    14 I 4 = V cd / R4 ; / / c u r r e n t f l o w i n g t h ro u gh R415 Icd = I5 + I4 ; / / c u r r e nt f l o w i n g t hr ou gh cd

    1617 V bd = ( I cd * R3 ) + Vc d ; / / v o l t a g e a c r o s s bd18 I b d = ( V bd / R 2 ) + Ic d ; / / c u r r e n t t h ro u g h bd19

    20 V 1 = R1 * Ib d; / / v o l t a g e a c r o s s R121

    22 E = V1 + Vbd ;

    23 disp (E , E = )24

    25 / / R e s ul t : V al ue o f E f o r which power d i s s i p a t i o n i n

    R i s 1 5W = 2 00V

    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

    18

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    20/62

    downloaded from the website wwww.scilab.in

    Scilab code Exa 3.8 Find current flowing through all the branches of thecircuit

    1 / / mesh e q u a t i o n s :2 / / 6 0I 1 20I 2 = 203 //20 I 1 + 80I 2 = 654

    5 R = [60 -20; -20 8 0] ;

    6 E = [ 12 0; - 6 5] ;7 I = inv ( R ) * E ;

    8 I 1 = I (1 , :) ; / / c u r r e n t f l o w i n g i n f i r s t mesh9 I 2 = I (2 , :) ; / / c u r r e nt f l o w i n g i n s ec on d mesh

    10

    11 Ibd = I1 - I2 ; / / c u r r e n t f l o w i n g t h ro u gh b ra nc h bd12 Iab = I1 ; // c u r r e n t f l o w i n g t h ro ug h b ra nc h ab13 I cb = - I2 ; // c u r r e n t f l o w i n g t hr o ug h b ra nc h cb14

    15 disp ( I b d , c u r r e n t f l o w i n g t hr ou gh b ra nc h bd = )16 disp ( I a b , c u r r e nt f l o w i n g t hr ou gh b ra nc h ab = )

    17 disp ( I c b , c u r r e nt f l o w i n g t hr ou gh b ra nc h cb = )

    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

    19

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    21/62

    downloaded from the website wwww.scilab.in

    Scilab code Exa 3.12 Find A current flowing through Rl B valye of Rl forwhich the power transfer is maximum and the maximum power

    1 // a2 // c i r c u i t p ar am et er s3 E 1 = 12 0;

    4 R 1 = 40;

    5 R 2 = 20;

    6 R 3 = 60;7

    8 V o c = E1 * R2 / ( R2 + R1 ) ; // open c i r c u i t v o l t a gea p pe ar i n g a t t e rm i na l 1

    9 R i = R3 + ( R1 * R2 /( R1 + R2 )) ; // e q u i v a l e n t r e s i s t a n c el o o k i n g i n t o th e ne t w o r k from t e rm in al p ai r

    0110

    11 function I = Il ( Rl )

    12 I = Voc /( Ri + Rl ) / / c u r r e n t t h ro u g h Rl13 e n d f u n c t i o n

    14

    15 I l 1 = Il ( 10 ) ; / / R l = 1 0 o h m16 I l 2 = Il ( 50 ) ; / / R l = 5 0 o h m17 I l3 = Il ( 20 0) ; / / R l = 2 0 0 ohm18

    19 disp ( a )20 disp ( I l 1 , I l ( R l = 10 ohm ) = )21 disp ( I l 2 , I l ( R l = 50 ohm ) = )22 disp ( I l 3 , I l ( R l = 2 00 ohm ) = )23

    24 // b25 // f o r maximum pow er R l = R i26 R l = Ri ;

    27 P lm ax = ( V oc / (2 * Ri ) ) ^2 * Ri ; //maximum power to Rl28 disp ( b )

    20

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    22/62

    29 disp ( P l m a x , maximum p o we r t o R l ( 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 ra m et er s2 // v o l t a g e s o u r c e s3 E 1 = 12 0;

    4 E 2 = 65;

    5 // r e s i s t a n c e s6 R 1 = 40;

    7 R 2 = 11;

    8 R 3 = 60;

    9

    10 I = ( E1 / R1 ) + ( E2 / R3 ); / / n o rt on s c u r r e n t s o u r c e11 R e q = R1 * R3 / ( R1 + R3 ) ; // e q u i v a l e n t r e s i s t a n c e12

    13 I2 = I * Req /( Req + R2 ); / / c u r r e n t f l o w i n g t h ro u gh R214

    15 disp ( I 2 , c u r r en t f l o w i n g t hr ou gh R2 = )

    This code can be downloaded from the website wwww.scilab.in This code

    can be downloaded from the website wwww.scilab.in

    21

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    23/62

    Chapter 4

    Circuit differential equations

    Forms and Solutions

    Scilab code Exa 4.3 Determine the operational driving point impedancesappearing at terminals ad and dg

    1 //ad2 Z ab = c om p le x ( 1 , - 0. 5) ; // i m pe da nc e a p p e ar i n g a c r o s s

    t e r m i n a l s ab3 Z b g = c om p le x ( 1) ; // i m pe da nc e a p p e ar i n g a c r o s s

    t e r m i n a l s bg4 Z bc d = c o mp le x ( 2 +1 , 2 ) ; // i m pe da nc e a p p e ar i n g a c r o s s

    t e r m i n a l s bcd5 Z ad = Z ab + ( Z bg * Z bc d /( Z bg + Z bc d )) ; / / i m p e d a n c e

    a p pe ar i n g a c r o s s t e r mi n a l s ad6 disp ( Z a d , i mp ed an ce a p pe a ri n g a c r o s s t e r m i n a l s ad =

    )7

    8 //dg

    9 Z d g = Z bg + ( Z ab * Z b cd / ( Z ab + Z b cd ) ) ; / / i m p e d a n c ea p pe ar i n g a c r o s s t e r m a i n al s dg10 disp ( Z d g , i mp ed an ce a p pe a ri n g a c r o s s t e r m i n a l s dg =

    )

    22

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    24/62

    Chapter 5

    Circuit dynamics and forced

    responses

    This code can be downloaded from the website wwww.scilab.in

    Scilab code Exa 5.2 Find the expression for the current flowing throughthe 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 *1 0^ 6; // r e s i s t a n c e ( i n ohms )3 V i = 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 n

    v o l t s )4 W c = ( 1/ 2) * C * Vi ^ 2 ; / / e ne rg y s t o r e d i n t he c a p a c i t o r5 / / c ur r e nt f l o w i n g i n c i r c u i t a s a f u n c t i o n o f t i m e i

    ( t ) = 2104 exp( t /2 )6 / / power d i s s i p a t e d i n t he r e s i s t o r = Ri 27 Wr = i n t e g r a t e (R4108 exp( t ) , t ,0,100)

    23

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    25/62

    8 disp ( W c , e ne rg y s t o r e d i n t he c a p a c i t or ( i n J o u l e s ) =

    )9 disp ( W r , e ne rg y d i s s i p a t e d i n t he r e s i s t o r ( i n J o ul e s) = )

    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 downloaded from the website wwww.scilab.in This code can be down-

    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

    24

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    26/62

    Chapter 6

    The laplace transform method

    of finding circuit solutions

    Scilab code Exa 6.1 Find the laplace transform of the given pulse

    1 function F = l ap la ce ( s, T1 , T2 )

    2 / / p u l s e :3 // f = u ( t T1 ) u ( t T2 )4 F = i n t e g r a t e ( e xp ( s t ) , t , T 1 , T 2 ) ; // l a p l a c e

    t r a ns f o r m o f t he p u l se5 e n d f u n c t i o n

    25

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    27/62

    Chapter 7

    Sinusoidal steady state

    response of circuits

    Scilab code Exa 7.1 Find the average value of the given periodic function

    1 V m = 2; / / a s s u mp t i on2 // a v e ra ge v al ue o f t he f u n c t i o n3 // v ( t ) = Vm a l ph a / ( %pi / 3 ) f o r 0

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    28/62

    4

    5 V m = 17 0; // p ea k v o l t a g e6 I m = 1 4. 14 ; // p ea k c u r r e n t7

    8 P a v = V m * Im * p f /2 ; / / a v er a ge power d e l i v e r e d t o t hec i r c u i t

    9 disp ( P a v , a v e ra ge power d e l i v e r e d t o t he c i r c u i t = )

    Scilab code Exa 7.3 Find the expression for the sum of i1 and i2

    1 / / l e t s assume t ha t i 1 and i 2 a re s t a t i o n a r y and t h ec o or d i n a t e s y s t e m i s r o t a t i n g w i t h an a ng ul ar

    f r qu e n cy o f w . And i 1 l i e s on t he xa x i s ( i . e .making an a n gl e o f 0 d e g r ee w i th t he xa x i s )

    2 t h e ta = % pi / 3 ; // p ha se d i f f e r e n c e b et w ee n i 1 and i 2 ;3 I 1 = 10* sqrt ( 2 ) ; // peak v al ue o f i 14 I 2 = 20* sqrt ( 2 ) ; // peak v al ue o f i 25 I = sqrt ( I1 ^ 2 + I2 ^ 2 + 2* I 1* I2 * cos ( t h e t a ) ) ; / / p e a k

    v al ue o f t h e r e s u l t a n t c u r r e n t

    67 p hi = atan ( I 2 * sin ( t h et a ) /( I 1 + I 2 *cos ( t h e t a ) ) ) ; //

    p ha se d i f f e r e n c e b et we e n t he r e s u l t a n t and i 1 ( i nr a d i a n s )

    8 disp (I , peak v al ue o f t he r e s u l t a n t c u rr e n t = )9 disp ( p h i , p ha se d i f f e r e n c e bet w ee n t he r e s u l t a n t and

    i 1 = )10 // r e s u l t : i = I s i n ( wt + ph i )

    Scilab code Exa 7.4 Find the effective value of the resultant current

    1 I 1 = 10; // p eak v al ue o f i 12 I 2 = 20; // p eak v al ue o f i 2

    27

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    29/62

    3 t h e ta = % pi / 3 ; // p ha se d i f f e r e n c e b et w ee n i 1 and i 2

    4 / / compl ex r e p r e s e n t a t i o n o f t he two c u r r en t s5 i 1 = c o mp l ex ( 1 0) ;6 i 2 = c o mp l ex ( 2 0* cos (%pi /3) ,20* sin ( % p i / 3 ) ) ;

    7

    8 i = i 1 + i2 ; / / r e s u l t a n t c u r r e n t9 I = sqrt ( real ( i) ^2 + imag ( i ) ^ 2 ) ; // c a l c u l a t i n g t he

    peak v al ue o f t h e r e s u l t a n t c u r r e n t by u si ng i t sr e a l and i m ag i na r y p a r t s

    10 p hi = atan ( imag ( i ) / real ( i ) ) ; / / c a l c u l a t i g t he p ha seo f t h e r e s u l t a n t c ur r e nt by u si ng i t s r e a l andi m a gi n a ry p a r t s

    11 disp (i , r e s u l t a n t c u r r e n t = )12 disp (I , peak v al ue o f t he r e s u l t a n t c u rr e n t = )13 disp ( p h i , 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 + p hi )

    Scilab code Exa 7.5 Find the time expression for the resultant current

    1 I 1 = 3; // peak v al ue o f i 1

    2 I 2 = 5; // peak v al ue o f i 23 I 3 = 6; // peak v al ue o f i 34 t h e ta 1 = % pi / 6 ; // p ha se d i f f e r e n c e be tw e en i 2 and i 15 t he t a2 = - 2* % pi / 3 ; // p ha se d i f f e r e n c e be t we en i 3 and

    i 16 // compl ex r e p r e s e n t a t i o n o f t he c u r r e n t s7 i 1 = c o mp l ex ( 3 ) ;

    8 i 2 = c o mp l ex ( 5 * cos ( % p i / 6 ) , 5 * sin ( % p i / 6 ) ) ;

    9 i 3 = c o mp l ex ( 6 * cos ( - 2 * % p i / 3 ) , 6 * sin ( - 2 * % p i / 3 ) ) ;

    10

    11 i = i1 + i2 + i3 ; / / r e s u l t a n t c u r r e nt12 I = sqrt ( real ( i) ^2 + imag ( i ) ^ 2 ) ; // c a l c u l a t i n g t hepeak v al ue o f t h e r e s u l t a n t c u r r e n t by u si ng i t sr e a l and i m ag i na r y p a r t s

    28

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    30/62

    13 p hi = atan ( imag ( i ) / real ( i ) ) ; / / c a l c u l a t i g t he p ha se

    o f t h e r e s u l t a n t c ur r e nt by u si ng i t s r e a l andi m a gi n a ry p a r t s14 disp (I , peak v al ue o f t he r e s u l t a n t c u rr e n t = )15 disp ( p h i , 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 + p hi )

    Scilab code Exa 7.6 Find the value of the given expression

    1 / / f i n d VZ1/Z22 V = c om p le x ( 4 5* sqrt ( 3) , - 45 ) ;

    3 Z 1 = c o mp l ex ( 2 . 5* sqrt ( 2) , 2 .5 * sqrt ( 2 ) ) ;

    4 Z 2 = c o mp l ex ( 7 .5 , 7 .5 * sqrt ( 3 ) ) ;

    5 / / we h ave t o f i n d VZ1/Z26 Z = V *Z1 / Z2 ;

    7 disp (Z , VZ 1 / Z 2 = )

    Scilab code Exa 7.7 Find A value of steady state current and the relativephase angle C magnitude and phase of voltage drops appearing across eachelement D average power E power factor

    1 // a2 f = 60; / / f r eq u en c y o f t he v o l a tg e s o ur c e3 V = c o mp le x ( 1 41 ) ; / / v o l t a g e s u p p l y V = 1 41 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 t5 L = 0 .0 10 6; // i nd uc ta nc e o f t h e c i r c u i t6 Z = c o mp le x ( R , 2* % p i *f * L ); // i mpeda nce o f t he c i r c u i t

    = R + j w L7 i = V / Z ; / / c u r r e n t8 I = sqrt ( real ( i) ^2 + imag ( i ) ^ 2 ) ; // c a l c u l a t i n g t he

    peak v al ue o f t h e c u r r e n t by u si ng i t s r e a l andi m a gi n a ry p a r t s

    29

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    31/62

    9 p hi = atan ( imag ( i ) / real ( i ) ) ; / / c a l c u l a t i g t he p ha se

    o f t h e r e s u l t a n t c ur r e nt by u si ng i t s r e a l andi m a gi n a ry p a r t s10 disp ( a )11 disp (I , e f f e c t i v e v al ue o f t he s te ad y s t a t e c u r r e n t

    = )12 disp ( p h i , r e l a t i v e p ha se a n gl e = )13

    14 // b15 / / e x p r e ss i o n f o r t h e i n st a nt a ne o us c u rr e n t can be

    w r i t t e n a s16 / / i = I s i n ( wt + p h i )

    1718 // c19 R = c om pl ex ( 3) ;

    20 vr = V *R /Z ; // v o l t a g e a c ro s s t h e r e s i s t o r21 Vr = sqrt ( real ( vr ) ^2 + imag ( v r ) ^ 2 ) ; // p ea k v a l ue o f

    t h e v o l t a g e a c r o s s t h e r e s i s t o r22 p h i1 = atan ( imag ( v r ) / real ( v r ) ) ; // p h as e o f t he

    v o l t a g e a c r o s s t h e r e s i s t o r23

    24 v l = V - v r ; / / v o l t a g e a c r o s s t he i n d uc t or25 Vl = sqrt ( real ( vl ) ^2 + imag ( v l ) ^ 2 ) ;

    // p ea k v a l ue o f t h e v o l t a ge a c r o s s t he i n d u ct o r26 p h i2 = atan ( imag ( v l ) / real ( v l ) ) ; // p h as e o f t he

    v o l t a ge a c r o s s t he i n d u ct o r27 disp ( c )28 disp ( V r , e f f e c t i v e v al ue o f t h e v o l t a ge dr op a c r o s s

    t h e r e s i s t o r = )29 disp ( p h i 1 , p h a s e o f t he v o l t a ge dr op a c r o s s t h e

    r e s i s t o r = )30 disp ( V l , e f f e c t i v e v al ue o f t h e v o l t a ge dr op a c r o s s

    t he i n d uc t or = )

    31 disp ( p h i 2 , p h a s e o f t he v o l t a ge dr op a c r o s s t h ei n d u c t o r = )

    32

    33 // d

    30

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    32/62

    34 P av = V *I *cos ( p h i ) ; / / a v er a ge power d i s s i p a t e d by

    t h e c i r c u i t35 disp ( d )36 disp ( P a v , a v e ra ge power d i s s i p a t e d by t h e c i r c u i t =

    )37

    38 // e39 pf = cos ( p h i ) ; // p ower f a c t o r40 disp ( e )41 disp ( p f , power f a c t o r = )

    Scilab code Exa 7.8 Find the equivalent impedance appearing betweenpoints a and c

    1 // i mp ed an ce s i n t he c i r c u i t2 Z 1 = c o mp l ex ( 1 0 , 10 ) ;

    3 Z 2 = c o mp l ex ( 1 5 , 20 ) ;

    4 Z 3 = c o mp l ex ( 3 , - 4) ;

    5 Z 4 = c o mp l ex ( 8 , 6) ;

    6

    7 Y b c = ( 1/ Z 2 ) + ( 1 / Z 3 ) + (1 / Z 4 ) ; / / a d mi t ta n ce o f t h ep a r a l l e l c om bi na ti on

    8 Z bc = ( 1/ Y bc ) ; // i mpeda nce o f t he p a r a l l e lc o m b i n a t i o n

    9

    10 Z = Z1 + Zbc ; // e q u i v al e n t i mpe danc e o f t he c i r c u i t11

    12 disp (Z , e q u i v a l e n t i mp eda nce o f t he c i r c u i t = )

    Scilab code Exa 7.9 Find the current which flows through branch Z3

    1 V 1 = c o mp l ex ( 1 0) ;

    2 V 2 = c o mp l ex ( 1 0* cos (-%pi /3) ,10* sin ( - % p i / 3 ) ) ;

    31

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    33/62

    3 Z 1 = c o mp l ex ( 1 , 1) ;

    4 Z 2 = c o mp l ex ( 1 , - 1) ;5 Z 3 = c o mp l ex ( 1 , 2) ;

    6

    7 // by mesh a n a l y s i s we g e t t he f o l l o w i n g e q ua t i o n s :8 // I1 Z11 I 2 Z 12 = V 19 //I 1 Z 2 1 + I 2 Z 2 2 = V2 ; where I 1 and I 2 a r e t he

    c u r r r e n t s f l o w i n g i n t he f i r s t and s ec on d m es hesr e s p e c t i v e l y

    10 Z11 = Z1 + Z1 ;

    11 Z12 = Z1 + Z2 ;

    12 Z 21 = Z12 ;

    13 Z22 = Z2 + Z2 ;14

    15 / / t he mesh e q ua t i o n s can be r e p r e s e nt e d i n t hem at ri x form a s I Z = V

    16 Z = [ Z11 , - Z12 ; - Z21 , Z22 ]; / / i m p ed a nc e m a t r i x17 V = [ V 1 ; - V 2 ] ; / / v o l t a g e m a tr i x18 I = inv ( Z ) * V ; / / c u r r e n t m a t r i x = [ I 1 ; I 2 ]19

    20 I 1 = I (1 , :) ; // I 1 = f i r s t row o f I m at ri x21 I 2 = I (2 , :) ; // I 1 = se co nd row o f I m at ri x22

    23 Ibr = I1 - I2 ; / / c u r r e n t f l o w i n g t h ro u gh Z324

    25 disp ( I b r , c u r r e nt f l o w i n g t hr ou gh Z3 = )

    Scilab code Exa 7.10 Find the current in the Z3 branchby using the Nodalmethod

    1 V 1 = c o mp l ex ( 1 0) ;2 V 2 = c o mp l ex ( 1 0* cos (-%pi /3) ,10* sin ( - % p i / 3 ) ) ;

    3 Z 1 = c o mp l ex ( 1 , 1) ;

    4 Z 2 = c o mp l ex ( 1 , - 1) ;

    5 Z 3 = c o mp l ex ( 1 , 2) ;

    32

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    34/62

    6 //By a p p l in g t he n od al a n a l y s i s we g et t he f o l l o w i n g

    e q u a t i o n :7 / / Va ( ( 1 / Z1 ) + (1 / Z2 ) + (1 / Z3 ) ) = ( V1 / Z1 ) + ( V2 / Z2 )8

    9 Y = ( 1/ Z 1 ) + (1 / Z 2) + ( 1/ Z 3 ) ;

    10 V a = ( 1/ Y ) *( ( V1 / Z1 ) + ( V2 / Z2 ) ); / / v o l t a g e o f node a11

    12 I b r = Va / Z3 ; / / c u r r e nt f l o w i n g t hr ou gh Z313

    14 disp ( I b r , c u r r e nt f l o w i n g t hr ou gh Z3 = )

    Scilab code Exa 7.11 Find the current flowing through Z3 by using Thevininstheoram

    1 V 1 = c o mp l ex ( 1 0) ;

    2 V 2 = c o mp l ex ( 1 0* cos (-%pi /3) ,10* sin ( - % p i / 3 ) ) ;

    3 Z 1 = c o mp l ex ( 1 , 1) ;

    4 Z 2 = c o mp l ex ( 1 , - 1) ;

    5 Z 3 = c o mp l ex ( 1 , 2) ;

    6

    7 Z th = Z3 + ( Z1 * Z2 / ( Z1 + Z2 ) ); // t h e v i ni n r e s i s t a n c e8

    9 I = ( V 1 - V 2 ) / ( Z 1 + Z 2 ) ; // c u r r e n t f l o wi n g t hr ou ght he c i r c u i t when R3 i s n ot c on ne ct ed

    10 Vth = V1 - I *Z1 ; // t h e v i n i n v o l t a g e11

    12 I br = V th / Zt h ; / / c u r r e n t f l o w i n g t h ro u gh Z313

    14 disp ( I b r , c u r r e nt f l o w i n g t hr ou gh Z3 = )

    33

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    35/62

    Chapter 9

    Semiconductor electronic

    devices

    Scilab code Exa 9.2 Find the values of self bais source resistance and drainload resistance at Q point

    1 / / Q u ie s ce n t p o i n t2 I d q = 0 .0 0 34 ; // d r ai n c u r r e n t3 V dq = 15; // d r ai n v o l t a g e4 V gq = 1; // g at e v o l t a g e5

    6 V dd = 24; // d r a in s u pp ly v o l t a g e7

    8 R s = V gq / Id q ;

    9 disp ( R s , The v al ue o f s e l f b a i s s o ur c e r e s i s t a n c e i s( i n ohm ) : )

    10

    11 Rd = ( Vdd - Vdq )/ Idq ;

    12 disp ( R d , The v al ue o f d r a i n l oa d r e s i s t a n c e i s ( i n

    ohm) : )

    34

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    36/62

    Scilab code Exa 9.3 Find A midband frequency current gain of the first

    stage B bandwidth of the first stage amplifier

    1 // a2 // t r a n s i s t o r p a ra m et er s3 R2 = 0 . 62 5;

    4 h ie = 1 . 67 ;

    5 Rb = 4 .1 6;

    6 Rl = 2 .4 ;

    7 R oe = 1 50 ;

    8

    9 Cc = 25 * 10^ -6;

    10 r BB = 0 . 29 ;11 r BE = 1 . 37 5;

    12 Cd = 6 90 0 * 10 ^ -1 2;

    13 Ct = 4 0 * 10^ -12;

    14 gm = 0 . 03 2;

    15

    16 R eq = ( R l* R oe ) /( R l + Ro e) ;

    17 hfe = 4 4;

    18 a = 1 + ( R2 / Req );

    19 b = 1 + ( hie /Rb );

    20 A im = - h fe / ( a *b ) ; // mid band f r e q u e n c y g a i n21 disp ( a )

    22 disp ( A i m , The mid band f r e q u e n c y g a i n o f t h e f i r s ts t a g e o f t h e c i r c u i t i s : )

    23

    24 // b25 T l = 2 * %p i *( R eq + R 2 )* C c * (1 0 ^3 ) ;

    26 Fl = 1/ Tl ;

    27

    28 R p = ( R eq * R2 ) /( R eq + R 2 );

    29 C = C d + C t *(1 + gm * Rp * 10 ^3 ) ;

    30 d = Rb + hie ;31 e = rBE * ( Rb + rBB )* 1 0^3 * C ;

    32 F h = d / (2 * % pi * e ) ;

    33

    34 BW = Fh - Fl ;

    35

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    37/62

    35 disp ( b )

    36 disp ( B W , The b an dw id th o f t h e f i r s t s t a g ea m p l i f i e r i n Hz i s : )

    36

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    38/62

    Chapter 11

    Binary logic Theory and

    Implimentation

    Scilab code Exa 11.1 Determine th decimal equivalents of the binary num-bers A 101 B 11011

    1 // a2 N2 = 101 ; / / b i n a r y o r d e r ed s e q ue n c e3 N = b i n2 de c ( N 2 ); / / d ec i ma l e q u i v a l e n t o f N24 disp ( a )5 disp (N , d ec im al e q u i v al e n t o f 101 = )6

    7 // b8 N2 = 1101 1 ; / / b i n a r y o r d e r ed s e q ue n c e9 N = b i n2 de c ( N 2 ); / / d ec i ma l e q u i v a l e n t o f N2

    10 disp ( b )11 disp (N , d ec im al e q u i v al e n t o f 1 10 11 = )

    Scilab code Exa 11.2 Determine the decimal equivalent of A octal number432 B hexadecimal number C4F

    37

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    39/62

    1 // a

    2 N8 = 432 ; / / o c t a l n um be r3 N = o c t2 de c ( N 8 ); // d ec i ma l r e p r e s e n t a t i o n o f N84 disp ( a )5 disp (N , d e ci ma l e q u i v a l e n t o f 432 = )6

    7 // b8 N 16 = C4F ; / / h e x a d e c i m a l n um be r9 N = hex2dec ( N 1 6 ) ; / / d e ci m al r e p r e s e n t a t i o n o f N16

    10 disp ( b )11 disp (N , d e c im a l e q u i v a l e n t o f C4F = )

    Scilab code Exa 11.3 Find the binary and octal equivalents of 247

    1 N = 247;

    2 N 2 = d e c2 b in ( N ) ; / / b i n ar y e q u i v a l e n t o f N3 N 8 = d e c2 o ct ( N ) ; // o c t a l e q u i v a l e n t o f N4 disp ( N 2 , b in ar y e q u i v a l e n t o f 247 = )5 disp ( N 8 , o c t a l e q ui v a l e n t o f 247 = )

    38

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    40/62

    Chapter 12

    Simplifying logical functions

    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-

    loaded from the website wwww.scilab.in

    39

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    41/62

    Chapter 15

    Magnetic circuit computations

    Scilab code Exa 15.1 Find A magneto motive force B current C relativepermiability and reluctance of each material

    1 // a2 p h i = 6 *1 0^ - 4 ; / / g i v e n m a g n et i c f l u x ( i n Wb)3 A = 0 .0 01 ; // c r o s s s e c t i o n a l a r e a ( i n me te r s qu ar e )4 B = phi /A ; //5 H a = 10; // m a gn et ic f i e l d i n t e n s i t y o f m a t e r i a l a

    n ee de d t o e s t a b l i s h t h e g i v en m ag n e t i c f l u x6 H b = 77; // m ag ne ti 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 b7 H c = 27 0; // m ag ne t ic f i e l d i n t e n s i t y o f m a t e r i a l c8 L a = 0. 3; // a r c l e ng t h o f m a t e r i a l a ( i n m et er s )9 L b = 0. 2; / / a r c l e n g th o f m a t e r i a l b ( i n m et er s )

    10 L c = 0. 1; // a r c l e ng t h o f m a t e r i a l c ( i n m et er s )11

    12 F = Ha *La + Hb *Lb + Hc *Lc ; // m a g ne to mo t iv e f o r c e13 disp ( a )14 disp (F , m ag ne to mo ti ve f o r c e n ee de 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 ) = )1516 // b17 N = 100; / / no . o f t u r ns18 I = F / N ; / / c u r r e n t i n amps

    40

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    42/62

    19 disp ( b )

    20 disp (I , c u r r e n t t h a t must b e made t o f l o w t hr o ug ht he c o i l ( i n amps ) = )21

    22 // c23 M U0 = 4 * %p i * 10 ^ - 7;

    24 MUa = B / Ha ; // p e r me a b i l i t y o f m a t e r i a l a25 MUb = B / Hb ; // p e r me a b i l i t y o f m a t e r i a l b26 MUc = B / Hc ; // p e r me a b i l i t y o f m a t e r i a l c27

    28 M U ra = M Ua / M U0 ; / / r e l a t i v e p e r m e ab i l i t y o f m a te r ia la

    29 M U rb = M Ub / M U0 ; / / r e l a t i v e p e r m e ab i l i t y o f m a te r ia lb

    30 M U rc = M Uc / M U0 ; / / r e l a t i v e p e r m e ab i l i t y o f m a te r ia lc

    31

    32 R a = Ha * La / ph i ; // r e l u c t a n c e o f m a t e r i a l a33 R b = Hb * Lb / ph i ; // r e l u c t a n c e o f m a t e r i a l b34 R c = Hc * Lc / ph i ; // r e l u c t a n c e o f m a t e r i a l c35

    36 disp ( c )37 disp ( M U r a ,

    r e l a t i v e p e r m e ab i l i t y o f m a te r i a l a = )

    38 disp ( M U r b , r e l a t i v e p e r m e ab i l i t y o f m a te r i a l b = )39 disp ( M U r c , r e l a t i v e p e r m e ab i l i t y o f m a te r i a l c = )40 disp ( R a , r e l u c t a n c e o f m a t e r ia l a = )41 disp ( R b , r e l u c t a n c e o f m a t e r ia l b = )42 disp ( R c , r e l u c t a n c e o f m a t e r ia l c = )

    Scilab code Exa 15.3 Find the mmf produced by the coil

    1 m u0 = 4 * %p i * 10 ^ - 7;

    2 A = 0 .0 02 5; // c r o s s s e c t i o n a l a re a o f t h e c o i l3 // d i me n si o ns o f t he c o i l ( i n m et er s )4 L g = 0 .0 02 ; // a i r ga p l e n g t h ( i n m e te r s )

    41

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    43/62

    5 L bd = 0 .0 25 ;

    6 L de = 0 .1 ;7 L ef = 0 .0 25 ;

    8 L fk = 0 .2 ;

    9 L bc = 0 .1 75 ;

    10 L ca b = 0 .5 ;

    11

    12 Lbghc = 2*( Lbd + Lde + Lef + ( Lfk /2) ) - Lg ; / / l e n g t ho f t he f e r r o m a gn e t ic m a t e r i a l i n v o l v e d h er e

    13

    14 p h ig = 4 *1 0^ - 4 ; / / a i r g ap f l u x ( i n Wb)15 B g = phig /A ; / / a i r gap f l u x d e n s i t y ( i n t e s l a )

    16 H g = Bg /mu0 ; // f e i l d i n t e n s i t y o f t he a i r gap17 mm fg = Hg * Lg ; //mmf p ro d uc ed i n t h e a i r g ap ( i n At )18

    19 B bc = 1.38 ; // f l u x d e n si t y c o rr e sp o nd i n g t o c a s ts t e e l

    20

    21 H bg hc = 1 25 ; // f i e l d i n t e n s i t y c o r r es p o n d i ng t o f l u xd e n s i t y o f 0 . 1 6T i n t h e s t e e l

    22 m m f bg h c = H bg hc * L b gh c ; // mmf c o r r e s p o n d i n g t o b gh c23

    24 m mf bc = mm fg + m mf bg hc ; //mmf a c r o s s p at h b c25 H b c = m mf bc / L bc ;

    26 p hi bc = B bc * A ; / / f l u x p ro du ce d i n bc27

    28 p hi ca b = p hi g + p hi bc ; // t o t a l f i ux e x i s t i n g i n l e gcab

    29 B c a b = p h ic a b / 0 . 0 0 37 5 ; // f l u x d e n s i t y30 H ca b = 6 90 ;

    31 m mf c ab = H ca b * L ca b ; //mmf i n l e g c ab32

    33 m mf = m mf bc + m mf ca b ; / /mmf p ro du ce d by t h e c o i l

    3435 disp ( m m f , mmf p ro du ce d by t h e c o i l ( i n At ) = )

    42

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    44/62

    Scilab code Exa 15.5 B Find the magnetic force exerted on the plunger

    1 // b2 m u0 = 4* % pi * 10 ^ -7 ;

    3 / / p l u n g e r m ag net d i m e n s i o n s ( i n m e t er s )4 x = 0 .0 25 ;

    5 h = 0. 05 ;

    6 a = 0 .0 25 ;

    7 g = 0 .0 01 25 ;

    8

    9 m m f = 1 41 4; / / ( i n At )10

    11 F = % pi * a * mu 0 *( m m f ^2 ) *( h ^ 2) * ( 1 /( x + h ) ^ 2) / g ; //m ag ni tu de o f t he f o r c e

    12 disp (F , m ag ni tu de o f t he f o r c e ( i n Newtons ) = )

    43

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    45/62

    Chapter 16

    Transformers

    Scilab code Exa 16.1 Find A equivalent resistance and reactance referredto both the sides B voltage drops across these in Volts and in per cent ofthe rated winding voltage C Repeat B for the low voltage side D equivalentleakage impedances referred to both the sides

    1 // a2 V 1 = 1 10 0; / / h i g h e r v o l t a g e3 V 2 = 22 0; / / l o w er v o l t a g e

    4 a = V1 / V2 ; // t u r ns r a t i o5 r 1 = 0. 1; / / h i gh v o l t a g e w in d in g r e s i s t a n c e ( i n ohms )6 x 1 = 0. 3; / / h i gh 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 r 2 = 0 .0 04 ; // l ow v o l t a g e w in di ng r e s i s t a n c e ( i n ohms

    )8 x 2 = 0 .0 12 ; / / l ow 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 w in d in gr e s i s t a n c e r e f e r r e d t o t h e p r i m a r y s i d e

    11 Xe1 = x1 + ( a^2) *x2 ; / / e q u i v a l e n t l e a k a ge r e a c t a n ce

    r e f e r r e d t o t h e p r i m a r y s i d e12 Re2 = ( r1 /a ^2) + r2 ; // e q u i v a l e n t w in d in gr e s i s t a n c e r e f e r r e d t o t h e s e c o n d a r y s i d e

    13 Xe2 = ( x1 /a ^2) + x2 ; / / e q u i v a l e n t l e a k a ge r e a c t a n cer e f e r r e d t o t h e s e c o n d a r y s i d e

    44

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    46/62

    14

    15 disp ( a )16 disp ( R e 1 , e q ui v a l e n t w i n di ng r e s i s t a n c e r e f e r r e d t ot h e p ri ma ry s i d e )

    17 disp ( X e 1 , e q u i v a l e n t l e ak a ge r e ac t a nc e r e f e r r e d t ot h e p ri ma ry s i d e )

    18 disp ( R e 2 , e q ui v a l e n t w i n di ng r e s i s t a n c e r e f e r r e d t ot he s e co n da r y s i d e )

    19 disp ( X e 2 , e q u i v a l e n t l e ak a ge r e ac t a nc e r e f e r r e d t ot he s e co n da r y s i d e )

    20

    21 // b

    22 P = 100; //pow e r ( i n kVA )23 I 2 1 = P * 1 00 0 / V1 ; // p r im ar y w in di ng c u r r e nt r a t i n g24 V r e1 = I 21 * R e1 ; // e q u i v a l e n t r e s i s t a n c e drop ( i n

    v o l t s )25 V p e rR 1 = V re 1 * 1 00 / V 1 ; // % e q u i v a l e n t r e s i s t a n c e

    dr op26

    27 V x e1 = I 21 * X e1 ; // e q u i v a l e n t r e a c t a nc e d ro p ( i nv o l t s )

    28 V pe r X1 = V xe 1 * 1 00 / V 1 ; // % e q u i v a l e nt r e a ct a n ce drop29

    30 disp ( b )31 disp ( V r e 1 , e q u i v a l e n t r e s i s t a n c e drop e x pr e ss e d i n

    t er ms o f p ri ma ry q u a n t i t i e s ( i n v o l t s ) = )32 disp ( V p e r R 1 , % e q u i v a l e n t r e s i s t a n c e dr op e x pr e ss e d

    i n t e r m s o f p r i m a r y q u a n t i t i e s = )33 disp ( V x e 1 , e q u i v a l e n t r e ac t a nc e dr op e x pr e ss e d i n

    t er ms o f p ri ma ry q u a n t i t i e s ( i n v o l t s ) = )34 disp ( V p e r X 1 , % e q u i v a l e n t r e a c t a n ce d ro p e x p r es s e d

    i n t e r m s o f p r i m a r y q u a n t i t i e s = )35

    36 // c37 I 2 = a * I21 ; // s e co n da r y w in di ng c u r r e n t r a t i n g38 V re 2 = I 2* Re 2 ; // e q u i v al e n t r e s i s t a n c e dr op ( i n

    v o l t s )

    45

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    47/62

    39 V p e rR 2 = V re 2 * 1 00 / V 2 ; // % e q u i v a l e n t r e s i s t a n c e

    dr op4041 V xe 2 = I 2* Xe 2 ; / / e q u i v a l e n t r e a c t a n ce d ro p ( i n v o l t s

    )42 V pe r X2 = V xe 2 * 1 00 / V 2 ; // % e q u i v a l e nt r e a ct a n ce drop43

    44 disp ( c )45 disp ( V r e 2 , e q u i v a l e n t r e s i s t a n c e drop e x pr e ss e d i n

    t er ms o f s ec on da ry q u a n t i t i e s ( i n v o l t s ) = )46 disp ( V p e r R 2 , % e q u i v a l e n t r e s i s t a n c e dr op e x pr e ss e d

    i n t e r m s o f s ec o nd ar y q u a n t i t i e s = )

    47 disp ( V x e 2 , e q u i v a l e n t r e ac t a nc e dr op e x pr e ss e d i nt er ms o f s e co n da r y q u a n t i t i e s ( i n v o l t s ) = )

    48 disp ( V p e r X 2 , % e q u i v a l e n t r e a c t a n ce d ro p e x p r es s e di n t e r m s o f s ec o nd ar y q u a n t i t i e s = )

    49

    50 // d51 Z e1 = c om p le x ( Re 1 , X e1 ) ; // e q u i v a l e n t l e a k a g e

    i mpeda nce r e f e r r e d t o t he p ri ma ry52 Ze2 = Ze1 /a ; / / e q u i v a l e n t l e a k a g e i mp ed an ce

    r e f e r r e d t o t he s ec o nd ar y53

    54 disp ( d )55 disp ( Z e 1 , e q u i v a l e n t l e a k a ge i mp ed an ce r e f e r r e d t o

    t h e p ri m a ry = )56 disp ( Z e 2 , e q u i v a l e n t l e a k a ge i mp ed an ce r e f e r r e d t o

    t h e s ec on da ry = )

    Scilab code Exa 16.2 Compute the 6 parameters of the equivalent circuit

    referred to the high and low sides

    1 P l = 39 6; // w at tm et er r e ad i ng on open c i r c u i t t e s t2 V l = 12 0; // v o lt m et e r r e ad i ng on open c i r c u i t t e s t3 I l = 9 .6 5; // ammeter r e a d i n g o open c i r c u i t t e s t

    46

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    48/62

    4 a = 2 40 0/ 12 0; // t u r ns r a t i o

    56 t h e at a = acos ( P l / ( V l * I l ) ) ; // p ha se d i f f e r e n c e

    b et we en v o l t a g e and c u r r e n t7 I rl = Il * cos ( t h e a t a ) ; // r e s i s t i v e pa r t of Im8 I xl = Il * sin ( t h e a t a ) ; // r e a c t i v e p ar t o f Im9

    10 r l = V l/ I rl ; // l ow v o l t a g e w in di ng r e s i s t a n c e11 r h = ( a ^2 ) *rl ; / / r l on t h e h ig h s i d e12 x l = V l/ I xl ; / / m ag ne ti zi ng r e ac t a nc e r e f e r r e d t o t he

    l ow er s i d e13 x h = ( a ^2 ) *xl ; // c o r r es p o n d i ng h ig h s i d e v a lu e

    1415 P h = 81 0; // w at tm et er r e ad i ng on s h o rt c i r c u i t t e s t16 V h = 92; // v ol t m e t er r ea d i n g on s h o r t c i r c u i t t e s t17 I h = 2 0. 8; // ammeter r e a d i n g on s h o rt c i r c u i t t e s t18

    19 Z e h = Vh / Ih ; // e q u i v a l e n t i mp ea da nc e r e f e r r e d t o t heh i g h e r s i d e

    20 Z e l = Z eh / ( a ^2 ) ; // e q u i v a l e n t i mp ed an ce r e f e r r e d t ot h e l ow er s i d e

    21 R e h = P h /( I h ^ 2) ; // e q u i v a l e nt r e s i s t a n c e r e f e r r e d t o

    t h e h i g h er s i d e22 R e l = R eh / ( a ^2 ) ; // e q u i v a l e nt r e s i s t a n c e r e f e r r e d t ot h e l ow er s i d e

    23 X eh = sqrt ( ( Ze h ^ 2) - ( R eh ^ 2 ) ) ; / / e q u i v a l e n tr ea ct an ce r e f e r r e d to th e h ig he r s i d e

    24 X e l = X eh / ( a ^2 ) ; // e q u i v a l e n t r e ac t a nc e r e f e r r e d t ot h e l ow er s i d e

    25

    26 disp ( Z e h , e q u i v a l e n t i mp ea da nce r e f e r r e d t o t heh i g he r s i d e = )

    27 disp ( Z e l , e q u i v a l e n t i mp ed an ce r e f e r r e d t o t he l o we r

    s i d e = )28 disp ( R e h , e q ui v a l e n t r e s i s t a n c e r e f e r r e d t o t h e

    h i g h er s i d e = )29 disp ( R e l , e q ui v a l e n t r e s i s t a n c e r e f e r r e d t o t h e

    l ow er s i d e = )

    47

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    49/62

    30 disp ( X e h , e q ui v a l e n t r e a c ta n ce r e f e r r e d t o t h e

    h i g h er s i d e = )31 disp ( X e l , e q u i v a l e n t r e a ct a n ce r e f e r r e d t o t he l ow ers i d e = )

    Scilab code Exa 16.3 For the transformer compute A efficiency B voltageregulation

    1 // a

    2 P = 50; / / p o we r r a t i n g ( i n kVA )3 P h = 81 0; // w at tm et er r e ad i ng on s h o rt c i r c u i t t e s t4 P l = 39 6; // w at tm et er r e ad i ng on open c i r c u i t t e s t5 I h = 2 0. 8; // ammeter r e a d i n g on s h o rt c i r c u i t t e s t6 p f = 0. 8; // power f a c t o r = 0 . 8 l a g g i n g7

    8 l os se s = ( Ph + P l) / 10 00 ; // l o s s e s i n kW9 o ut pu tP = P * pf ; / / o u t p u t p ow er

    10 i np ut P = o ut pu tP + l os se s ; / / i n p u t p o we r11

    12 e f fi c ie n cy = o ut p ut P / i n pu tP ;

    13 disp ( a )14 disp (efficiency , e f f i c i e n c y = )15

    16 // b17 X eh = 4; // e q u i v a l e n t r e ac t a nc e r e f e r r e d t o t he

    h i g h er s i d e18 R e h = 1 .8 7; // e q u i v a l e nt r e s i s t a n c e r e f e r r e d t o t h e

    h i g h er s i d e19 Z e h = c om p le x ( Re h , X eh ) ; / / e q u i v a l e n t i mp ed an ce

    r e f e r r e d t o t h e h i g he r s i d e

    20 i h = c o mp l ex ( I h * pf , - Ih * sqrt (1 - ( pf ^ 2) ) );21 V 1 = 2400 + Zeh * ih ; // p r i ma ry v o l t a g e22

    23 v o lt a ge R eg u la t io n = ( real ( V 1 ) - 2 4 0 0 ) * 1 0 0 / 2 4 0 0 ; //p e rc e n t v o l t a g e r e g u l a t i o n

    48

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    50/62

    24 disp ( b )

    25 disp (voltageRegulation , p e rc e nt v o l t a g e r e g ul a t on = )

    49

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    51/62

    Chapter 18

    The three phase Induction

    motor

    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 // a2 V 1 = 44 0/ sqrt ( 3 ) ;

    3 s = 0 .0 25 ; / / s l i p4 r 1 = 0. 1;

    5 r 2 = 0 .1 2;

    6 x 1 = 0 .3 5;

    7 x 2 = 0. 4;

    8

    9 z = c om pl ex ( r1 + r2 /s , x1 + x2 );

    10 i 2 = V1 /z ; / / i np ut l i n e c u r r e nt11 I2 = sqrt ( real ( i2 ) ^2 + imag ( i 2 ) ^ 2 ) ; / / m a gn it ud e o f

    i np ut l i n e c u r r e n t12 disp ( a )

    13 disp ( i 2 , i np ut l i n e c ur r e nt = )1415 i 1 = c o mp l ex ( 1 8* cos ( - 1 . 4 84 ) , 1 8* sin ( - 1 . 4 8 4 ) ) ; //

    m a g n et i z i ng c u r r e n t

    50

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    52/62

    16 I1 = sqrt ( real ( i1 ) ^2 + imag ( i 1 ) ^ 2 ) ; / / m a gn it ud e o f

    m a g n et i z i ng c u r r e n t17 i = i1 + i2 ; // t o t a l c u r r e n t drawn fro m t he v o l t a g es o u r c e

    18 I = sqrt ( real ( i )^2 + imag ( i ) ^ 2 ) ; / / m a gn i tu d e o f t o t a l c u r r e n t

    19 t h et a = atan ( imag ( i ) / real ( i ) ) ; // p ha se d i f f e r e n c eb et we en c u r r e n t and v o l t a g e

    20 pf = cos ( t h e t a ) ; // p ower f a c t o r21 disp ( p f , power f a c t o r = )22 if t he ta >= 0 then

    23 disp ( l e a d i n g )

    24 e l s e d i sp ( l a g g i n g )25 end

    26

    27 // b28 f = 60; / / h e r t z29 n s = 1 80 0;

    30 w s = 2 * %p i * ns / f ; // s t a t o r a n gu l ar v e l o c i t y31 P g = 3 * I2 ^ 2* r 2 / s; //pow e r32 T = Pg / ws ; // d e v el o p e d e l e c t r o m a g n e t i c t o r q ue33 disp ( b )34 disp (T ,

    d e v e l o pe d e l e c t r o m a g n e i c t o r q ue ( i n Newton

    m e t e r ) = )35

    36 // c37 P ro t = 9 50 ; // r o t a t i o n a l l o s s e s ( i n w at ts )38 P o = Pg *(1 - s ) - Prot ; / / o u t p u t p ow er39 H Po = Po / 74 6; / / o u tp ut h o r s e p ower40 disp ( c )41 disp ( H P o , o u tp u t h o r s e p ower = )42

    43 // d

    44 P c = 1 20 0; // c o r e l o s s e s ( i n W)45 S CL = 3* I ^2 * r1 ; / / s t a t o r c op pe r l o s s46 R C L = 3 * I2 ^ 2 * r2 ; // r o t a r c op pe r l o s s47 loss = Pc + SCL + RCL + Prot ; / / t o t a l l o s s e s48 Pi = real ( 3 * V 1 * i ) ; / / i n p u t p o we r

    51

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    53/62

    49 e ff ic ie nc y = 1 - ( l os s / Pi ) ;

    50 disp (efficiency , e f f i c i e n c y = )

    52

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    54/62

    Chapter 19

    Computations of Synchronous

    Motor Performance

    Scilab code Exa 19.1 Find A induced excitation voltage per phase B linecurrent C power factor

    1 // a2 e f fi c ie n cy = 0 .9 ;

    3 P i = 2 00 * 74 6 / e f fi c ie n cy ; / / i n p u t p o we r4 x = 11; / / r e a c t a n c e o f t h e m oto r5 V 1 = 2 30 0/ sqrt ( 3 ) ; // v o l t a g e r a t i n g6 d el ta = 1 5* % p i / 18 0; / / po we r a n g l e7 E f = P i *x / ( 3* V 1 * sin ( d e l t a ) ) ; / / 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 ge p er p h a s e8 disp ( a )9 disp ( E f , t he i nd uc ed e x c i t a t i o n v o l t a g e p er p ha se =

    )10

    11 // b

    12 z = c om p le x ( 0 , x) ; // i m p ed an ce o f t h e m ot or13 e f = c o mp l ex ( E f * cos ( - d e l t a ) , E f * sin ( - d e l t a ) ) ;14

    15 Ia = ( V1 - ef )/ z ; / / a rm at ur e c u r r e n t16 disp ( b )

    53

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    55/62

    17 disp ( I a , a rm at ur c u r r e nt = )

    1819 // c20 t h e at a = atan ( imag ( I a ) / real ( I a ) ) ; // p ha se d i f f e r e n c e

    b et we en I a and V121 pf = cos ( t h e a t a ) ; // p ower f a c t o r22

    23 disp ( c )24 disp ( p f , power f a c t o r = )25

    26 i f s in ( t h ea t a ) > 0 then

    27 disp ( l e a d i n g )

    28 else29 disp ( l a g g i n g )30 end

    54

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    56/62

    Chapter 20

    DC machines

    Scilab code Exa 20.2 Caculate A electromagnetic torque B flux per poleC rotational losses D efficiency E shaft laod

    1 // a2 V t = 23 0; // ( i n v o l t s )3 I a = 73; / / a r m at u re c u r r e n t ( i n amps )4 I f = 1. 6; / / f e i l d c u r r e n t ( i n amps )5 R a = 0 .1 88 ; / / a rm at ur e c i r c u i t r e s i s t a n c e ( i n ohms )

    6 n = 11 50 ; / / r a t e d s p ee d o f t h e r o t o r ( i n rpm )7 P o = 2 0* 74 6; / / o u t p ut p ow er ( i n w a t ts )8

    9 Ea = Vt - ( Ia *Ra ); // a r m at ur e v o l t a g e10 w m = 2 * %p i * n /6 0; / / r a te d s pe ed o f t he r o t o r ( i n r ad /

    se c )11 T = Ea *Ia /wm ; / / e l e c t r o m a g n e t i c t o r q ue12

    13 disp ( a )14 disp (T , e l e c t r o m a g n e t i c t o rq u e = )

    1516 // b17 a = 4 ; // no . o f p a r a l l e l a rm at ur e p at hs18 p = 4 ; / / no . o f p o l e s19 z = 882; / / no . o f a rm at ur e c o n d u c to r s

    55

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    57/62

    20 f lu x = E a * 60 * a /( p * z *n ) ; // f l u x p e r p o l e ( i n Wb)

    2122 disp ( b )23 disp ( f l u x , f l u x p er p o l e = )24

    25 // c26 Pr ot = ( Ea * Ia ) - Po ; // r o t a t i o n a l l o s s ( i n wat t )27 disp ( c )28 disp ( P r o t , r o t a t i o n a l l o s s e s = )29

    30 // d31 los ses = Prot + ( Ia ^2 * Ra ) + ( Vt * If ) ;

    32 P i = ( E a * I a ) + ( I a ^ 2 * R a ) + ( V t * I f ) ; // i n putpower

    33 e ff ic ie nc y = 1 - ( l os se s / Pi ) ;

    34

    35 disp ( d )36 disp (efficiency , e f f i c i e n c y = )

    Scilab code Exa 20.3 Determine the new operating speed

    1 / / f i n a l f l u x = 0 . 8 i n i t i a l f l u x2 I a1 = 73; / / i n i t i a l a r m a tu r e c u r r e n t ( i n amps )3 V t = 23 0; // ( i n v o l t s )4 R a = 0 .1 88 ; // a rm a t u r e c i r c u i t r e s i s t a n c e5 n 1 = 1 15 0; / / i n i t i a l r o t o r s p e e d ( i n rpm )6 E a1 = 2 16 .3 ; / / i n i t i a l a r m a t u r e v o l t a g e7

    8 I a2 = ( 1/ 0. 8) * I a1 ; / / f i n a l a rm at ur e c u r r e nt9 Ea2 = Vt - ( Ia2 * Ra ) ; / / f i n a l a rm at ur e v o l t a g e

    1011 n 2 = ( E a2 / E a1 ) * ( 1/ 0 .8 ) * n1 ; // f i n a l r o t o r s pe ed12

    13 disp ( n 2 , f i n a l r o t o r s pe ed ( i n rpm ) = )

    56

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    58/62

    Scilab code Exa 20.4 find A motor speed B required pulse frequency Crepeat part A and B for the given ON time to cycle time ratio

    1 // a2 r op = 0 .4 ; / / r a t i o o f ON t im e T0 t o c y c l e t im e Tp3 V b = 55 0; / / r a te d t e r m i na l v o l t a g e o f t he dc motor4 I a = 30; / / c u r r e n t drawn by t h e m ot or ( i n amps )5 R a = 1; // a rm at ur e c i r c u i t r e s i s t a n c e ( i n ohms )6 t s = 5 .9 4; / / t o r q ue and s p ee d p a ra m et er o f t h e m oto r

    ( i n Nm/A)7

    8 V m = r op * Vb ; // a v e r ag e v a l u e o f t h e a rm at ur et e r m i na l v o l t a g e

    9 Ea = Vm - ( Ia *Ra ); / / i n d u ce d a r ma t ur e v o l t a g e10

    11 w m = Ea / ts ; / / m ot or s p e e d ( i n r a d / s )12 disp ( a )13 disp ( w m , m ot or s p ee d ( i n r ad / s ) = )14

    15 // b16 d e lt aI = 5; // c ha ng e o f a rm at ur e c u r r e n t d u ri n g t he

    ON p e r i o d17 L a = 0. 1; / / a r ma tu re w in d in g i n d u c t a n ce ( i n H)18 T o = L a* d el ta I /( Vb - Ea ) ; //ON tim e19 T p = T o/ r op ; / / c y c l e t im e20

    21 f = 1/ Tp ; // r e q u i r e d p u l s e s p er s ec on d22 disp ( b )23 disp (f , r e q ui r e d p u l s e s p er s ec on d = )24

    25 // c26 r op = 0 .7 ; // new r a t i o o f ON ti me T0 t o c y c l e t im e

    Tp

    57

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    59/62

    27 V m = r op * Vb ; // a v e r ag e v a l u e o f t h e a rm at ur e

    t e r m i na l v o l t a g e28 Ea = Vm - ( Ia *Ra ); / / i n d u ce d a r ma t ur e v o l t a g e29

    30 w m = Ea / ts ; / / m ot or s p e e d ( i n r a d / s )31 disp ( c )32 disp ( w m , m ot or s p ee d w it h To/Tp e q u a l t o 0 . 7 ( i n r ad

    / s ) = )33

    34 T o = La * d el ta I /( V b - Ea ) ; //ON tim e35 T p = To / ro p; / / c y c l e t im e36

    37 f = 1/ Tp ; // r e q u i r e d p u l s e s p er s ec on d38 disp (f , r e q u i r e d p u l s e s p e r s e co n d w it h To/Tp e q u a l

    t o 0 .7 = )

    58

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    60/62

    Chapter 23

    Principles of Automatic

    Control

    Scilab code Exa 23.1 Determine the new transfer gain and feedback factor

    1 d el ta Gi = 42 0 - 3 80 ; / / v a r i a t i o n i n t he w it ho utf e ed b ac k g a in

    2 G i = 40 0; / / w i th o ut f e e db a c k g a i n3 T = 400; // t r a n s f e r f u nc t i o n o f t he c l o se d l oo p

    s y s t e m4 / / ( v a r i a t i o n i n T) /T = ( c ha ng e i n G) /G (1 / 1+HG)

    = 0 . 0 25 / / 1 + HG = R6 R = ( d e lt a Gi / G i ) / 0. 02 ;

    7

    8 G = T * R ; // new d i r e c t t r a n sm i s s i on g ai n w it hf e e d b a c k

    9 H = ( G / T - 1) /G ; / / f e e d ba c k f a c t o r10

    11 disp (G , new d i r e c t t r a n sm i s s i on g ai n w it h f e e db ac k = )12 disp (H , f e e db ac k f a c t o r s = )

    59

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    61/62

    Chapter 24

    Dynamic behaviour of Control

    systems

    Scilab code Exa 24.2 find A dynamic response of the system B positionlag error C change in amplifier gain D damping ratio and maximum percentovershoot E output gain factor for maximum overshoot equal to 25percent

    1 // a2 / / p a r am e te r v a l u e s3 K p = 0. 5; //V/rad4 K a = 10 0; //V/V5 K m = 2 *1 0^ - 4 ; / / l b f t /V6 F = 1 .5 *1 0^ - 4 ; / / l b f t / r a d / s7 J = 10^ -5 // sl ug f t 28

    9 K = Kp *Ka *Km ; / / l o op p r o p o t i o n a l g a in10 d r = F /(2 * sqrt ( K * J ) ) ; // d amp in g r a t i o11 wn = sqrt ( K / J ) ;

    12 t s = 5 /( d r* wn ) ;

    13 w d = wn *sqrt (1 - dr ^2) ; / / f r e q u e n c y a t w hi c h dampedo s c i l l a t i o n s o c c u r14 disp ( a )15 disp ( w d , 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 =

    )

    60

  • 7/23/2019 Electrical Engineering Fundamentals_V. Del Toro

    62/62

    16 disp ( d r , damping r a t i o = )

    1718 // b19 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 r21 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 // c25 K aN ew = ( e / 0 .0 2 5) * K a ; // new l o o p g a i n26 disp ( c )27 disp ( K a N e w , new l oo p g ai n f o r whi ch t h e p o s i t i o n l a g

    e r r o r i s e qu al t o 0 .0 25 r a d = )28

    29 // d30 d rN ew = F / (2 * sqrt ( K p * K a N e w * K m * J ) ) ; //new damping

    r a t i o31 disp ( d )32 disp ( d r N e w , new da mp in g r a t i o = )33

    34 // e35 / / f o r a maximum o v e r s h o o t o f 2 5% , ( F + Qo ) / 2s q r t (K

    J ) = 0 . 436 Q o = ( 0. 4* 2* sqrt ( Kp * K aN ew * Km * J) ) - F ;37 K o = Qo / ( Ka Ne w *K ) ; // o ut pu t g ai n f a c t o r38 disp ( e )39 disp ( K o , o ut p u t g ai n f a c t o r = )