Sie sind auf Seite 1von 231

Scilab Textbook Companion for

Basic Electrical Engineering


by C. L. Wadhwa1
Created by
Manoj A
B.Tech Third Year
Electrical Engineering
National Institute of Technology, Karnataka.
College Teacher
Debasisha Jena
Cross-Checked by
Ganesh R
July 4, 2014

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
Title: Basic Electrical Engineering
Author: C. L. Wadhwa
Publisher: New Age International Ltd.
Edition: 4
Year: 2007
ISBN: 978-81-224-2947-3

Scilab numbering policy used in this document and the relation to the
above 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 particular
Example of 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
List of Scilab Codes

1 AC Circuits

13

2 Network Theory

60

3 Three Phase Supply

90

4 Basic Instruments

103

5 Transformer

110

6 DC Machines

136

7 Three Phase Synchronous Machines

155

8 Three Phase Induction Motors

162

10 Power System

181

11 Domestic Wiring

186

12 DC Circuits

192

13 Electromagnetic Induction

216

List of Scilab Codes


Exa 1.1
Exa 1.2
Exa 1.3
Exa 1.4
Exa 1.5
Exa 1.6
Exa 1.7
Exa 1.8
Exa 1.9
Exa 1.10
Exa 1.11
Exa 1.12
Exa 1.13
Exa 1.14
Exa 1.15
Exa 1.16
Exa 1.17

To calculate frequency and instantaneous voltage and


time of a voltage wave . . . . . . . . . . . . . . . . . .
To find the current and power . . . . . . . . . . . . . .
To find the current and power of a capacitive circuit .
To find the frequency in the RLC Circuit at a phase
angle of 45 degrees . . . . . . . . . . . . . . . . . . . .
To find the inductance of a choke to operate a 120V
500W lamp at 230V . . . . . . . . . . . . . . . . . . .
Determine the value of the circuit components . . . .
To determine circuit impedance and current in a parallel
connection of a resistor and capacitor . . . . . . . . .
To find the current and impedance and admittance of
the circuit . . . . . . . . . . . . . . . . . . . . . . . . .
Maximum current and frequncy at which it occurs and
respective voltages . . . . . . . . . . . . . . . . . . . .
RLC circuit problems on resonace . . . . . . . . . . .
RLC circuit problems with quality factor . . . . . . .
RLC circuit problem to find the resonance frequncy and
impedance magnitude . . . . . . . . . . . . . . . . . .
Series Resonace of a RLC circuit with 2 coils . . . . .
Series Resonance in RLC circuit to find inductance and
power . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine the current in parallel branches and supply
current . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine the original and loaded circuit bandwidth .
Expression for the sum of energy stored by inductor and
capacitor connected in series at resonance . . . . . . .

13
14
15
16
17
19
20
21
21
22
24
25
26
27
28
30
31

Exa 1.18
Exa 1.19
Exa 1.20
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29

Exa 1.30
Exa 1.31
Exa 1.32
Exa 1.33
Exa 1.34
Exa 1.35
Exa 1.36
Exa 1.37
Exa 1.38
Exa 1.39
Exa
Exa
Exa
Exa
Exa

1.40
1.41
1.42
1.43
2.1

Expression for the sum of energy stored by inductor and


capacitor connected in parallel at resonance . . . . . .
To determine bandwidth and half power frequencies .
Determine the frequency of resonance and Max value of
Rc at resonance . . . . . . . . . . . . . . . . . . . . .
To determine Rl for which resonance can take place . .
To find the resistor for a given Q factor . . . . . . . .
Find the flux density . . . . . . . . . . . . . . . . . . .
Find the number of ampere turns . . . . . . . . . . . .
To find current in the 600 turn exciting coil . . . . . .
Find the current required to develop a flux of given mWb
Determine the inductance of individual winding . . . .
Determine the inductance of a three coil system . . . .
To determine the parameters of an alternating current
of 50Hz frequency . . . . . . . . . . . . . . . . . . . .
Determine the resultant current for two alternating currents . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the sum and difference of two alternating
voltage sources . . . . . . . . . . . . . . . . . . . . . .
Determine the parameters of the circuit and power and
pf . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine circuit paramters of an iron coil . . . . . .
Determine the phase angle between 220V main and the
current . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the coil parameters with resistance of 5
ohms . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine the resonant frequency and the source current
Determine Circuit parameters for a circuit with a current source . . . . . . . . . . . . . . . . . . . . . . . .
Determine the instantaneous energy stored in the capacitor and inductor . . . . . . . . . . . . . . . . . . .
To determine the current through all the branches of
the given network . . . . . . . . . . . . . . . . . . . .
To determine parameters to operate the relay . . . . .
To determine the parameters of a toroid . . . . . . . .
Determine the magnetic flux for a toriod . . . . . . . .
To determine the magnetic parameters of a steel ring .
To determine the current using loop analysis . . . . .
5

32
32
33
34
35
36
37
38
39
40
41
41
42
43
44
45
46
47
47
49
50
52
54
55
57
58
60

Exa 2.2
Exa 2.3
Exa 2.4
Exa 2.5
Exa 2.6
Exa 2.7
Exa 2.8
Exa 2.9
Exa 2.10
Exa
Exa
Exa
Exa
Exa

2.11
2.12
2.13
2.14
2.15

Exa 2.16
Exa
Exa
Exa
Exa

2.17
2.18
2.19
2.20

Exa 2.21
Exa 2.22
Exa 2.23
Exa 2.24
Exa 3.1

To calculate current in each branch using loop analysis


To calculate current in each branch using loop analysis
and point voltages in a given network . . . . . . . . .
To calculate current from a battery and pd across points
A and B . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine Current through branch AB of the given network . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determine the current in the branches of the network
using nodal analysis . . . . . . . . . . . . . . . . . . .
To Calculate current in all branches of the network shown
using nodal analysis . . . . . . . . . . . . . . . . . . .
Conversion to current source and nodal analysis . . . .
Superposition Principle to determine current in branch
Using thevenin theorem determine current through 2
ohm resistor . . . . . . . . . . . . . . . . . . . . . . .
To find the current through the branch AB . . . . . .
Determine current through various values of RL . . . .
Current through AB using Nortons theorem . . . . . .
To determine current in RL using nortons theorem . .
To find current across 2ohm resistor using nortons theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the current in the 2 ohm resistor using
superposition theorem . . . . . . . . . . . . . . . . . .
To determine the value of RL for Max power transfer .
Star to delta conversion of a cicuit . . . . . . . . . . .
Star Equivalent of the delta circuit . . . . . . . . . . .
To determine equivalent resistance using star delta transformation . . . . . . . . . . . . . . . . . . . . . . . . .
Determine current through branch AB using loop and
nodal analysis . . . . . . . . . . . . . . . . . . . . . .
Current through 2 ohm resistor given a current source
To find voltage v and current through 3 ohm resistor
using nodal analysis . . . . . . . . . . . . . . . . . . .
Determine the current through 10 ohm resistor using
thevenins circuit . . . . . . . . . . . . . . . . . . . . .
To determine the parameters of a balanced 3 phase star
connected to a resistive load . . . . . . . . . . . . . . .

61
63
65
67
67
69
70
71
72
74
75
76
77
78
79
80
81
82
83
84
86
87
88
90

Exa 3.2
Exa 3.3
Exa 3.4
Exa 3.5
Exa 3.6
Exa 3.7
Exa 3.8
Exa 3.9
Exa
Exa
Exa
Exa
Exa

3.10
4.1
4.2
4.3
4.4

Exa 4.5
Exa
Exa
Exa
Exa

4.6
4.7
4.8
5.1

Exa 5.2
Exa 5.3
Exa
Exa
Exa
Exa

5.4
5.5
5.6
5.7

Exa 5.8
Exa 5.9

To determine the parameters of a balanced 3 phase star


connected to an impedance . . . . . . . . . . . . . . .
To determine the potential of the star point and line
currents . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the line currents if one inductor is short
circuited . . . . . . . . . . . . . . . . . . . . . . . . .
To find line current and pf and powers of a balanced
delta load . . . . . . . . . . . . . . . . . . . . . . . . .
To find Line currents and star connected resistors for
the same power . . . . . . . . . . . . . . . . . . . . . .
Reduction in load when one resistor is removed . . . .
To measure power by two wattmeter method . . . . .
To find power using two wattmeter method of a circuit
with non reactive resistances . . . . . . . . . . . . . .
Two wattmeter power dertermination for a delta system
Torque on the coil at a current of 1mA . . . . . . . . .
To find the deflection produced by 200V . . . . . . . .
Reading on ammeters when their shunts are interchanged
To create an instrument that measures voltages and currents upto a rated value . . . . . . . . . . . . . . . . .
To determine the range and current and deflection at
various conditions . . . . . . . . . . . . . . . . . . . .
Error calculation . . . . . . . . . . . . . . . . . . . . .
Dynamometer wattmeter power calculation of the load
Percentage error calculation in a wattmeter . . . . . .
To find flux density in the core and induced emf in the
secondary winding . . . . . . . . . . . . . . . . . . . .
To calculate the number of turns per limb on the high
and low voltage sides . . . . . . . . . . . . . . . . . . .
To calculate resistance of primary interms of secondary
and vice versa . . . . . . . . . . . . . . . . . . . . . .
Total resitance and total copper loss at full load . . .
Voltage regulation at a pf lagging . . . . . . . . . . . .
Regulation at lagging leading and unity power factors
Calculate the circuit parameters of a transformer using
OC and SC tests . . . . . . . . . . . . . . . . . . . . .
To calculate terminal voltage and current and efficiency
Regulation at full load pf lag . . . . . . . . . . . . . .
7

91
92
93
94
95
97
98
99
101
103
104
104
105
106
107
108
109
110
111
112
113
114
116
117
118
120

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

5.10
5.11
5.12
5.13
5.14
5.15
5.16
5.17
5.18
5.19

Exa 5.20
Exa 5.21
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11
6.12
6.13
6.14

Exa 6.15
Exa
Exa
Exa
Exa
Exa
Exa

6.16
6.17
6.18
6.19
6.20
6.21

Calculate efficiency on unity pf at different cases . . .


Calcualte efficiencies at various loads . . . . . . . . . .
To determine all day efficiency . . . . . . . . . . . . .
Calculating Efficiency using Sumpner test . . . . . . .
To determine the ratio of weights of copper . . . . . .
To find voltage ratio and output . . . . . . . . . . . .
Determine primary and secondary voltages and current
Equivalent resistance and leakage reactance wrt primary
To determine Input current and voltage during SC test
To determine the load for max efficiency at two power
factors . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the max regulation and the pf at which it
occurs . . . . . . . . . . . . . . . . . . . . . . . . . . .
To calculate secondary terminal voltage and full load
efficiency at unity pf . . . . . . . . . . . . . . . . . . .
To Determine the useful flux per pole . . . . . . . . .
Determine the EMF generated . . . . . . . . . . . . .
Determine the EMF generated in a wave winding . . .
Ratio of speeds of a generator and motor . . . . . . .
Calculate Load Current in a shunt generator . . . . .
Useful Flux per pole on no load shunt motor . . . . .
To find efficiency and useful torque . . . . . . . . . . .
Speed calculation of series motor . . . . . . . . . . . .
Parameters calculated due to armature reaction . . . .
Number of conductors of compensating winding . . . .
Swinburne test on a dc shunt motor . . . . . . . . . .
Speed of a belt driven shunt generator . . . . . . . . .
Voltage between feeder and bus bar in a series generator
Induced EMF and Armature current in a long shunt
compound generator . . . . . . . . . . . . . . . . . . .
Speed at 50A considering armature reaction of a shunt
motor . . . . . . . . . . . . . . . . . . . . . . . . . . .
Speed of shunt motor taking 50kW input . . . . . . .
Useful torque and efficiency of a shunt motor . . . . .
Total torque developed in a 4 pole shunt motor . . . .
EMF and copper losses of a Shunt Motor . . . . . . .
Current taken by a motor at 90 percent efficiency . . .
Rated torque calculation by resistance addition . . . .
8

121
122
123
124
125
125
126
127
128
129
131
132
136
136
137
137
138
139
139
140
141
142
143
145
145
146
147
148
149
150
150
151
152

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

6.22
7.1
7.2
7.3
7.4
7.5
7.6
8.1
8.2
8.3

Exa 8.4
Exa 8.5
Exa 8.6
Exa 8.7
Exa 8.8
Exa 8.9
Exa 8.10
Exa 8.11
Exa 8.12
Exa 8.13
Exa 8.14
Exa 8.15
Exa 8.16
Exa 8.17
Exa 8.18
Exa 10.1

Efficiency at full load . . . . . . . . . . . . . . . . . .


Power delivered to 3 phase synchronous motor . . . .
New plant pf and percent decrease in line current . . .
kVAr rating of a synchronous condenser . . . . . . . .
Calculate E per phase and Current and pf . . . . . . .
Voltage Regulation of a 3 Phase alternator . . . . . . .
Internal Voltage drop in an alternator . . . . . . . . .
Find the percentage slip and poles of the motor . . . .
To calculate motor speed and its slip . . . . . . . . . .
To Calculate Parameters of a 3 phase 4 pole induction
machine . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculation of slip from losses . . . . . . . . . . . . . .
apping of an auto transformer to limit current in squirrel
cage motor . . . . . . . . . . . . . . . . . . . . . . . .
To find the total mechannical power and rotor copper
loss . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the starting torque and current using different starters . . . . . . . . . . . . . . . . . . . . . .
To actual rotor speed and the rotor frequency at 3 percent slip . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the various parameters of a 3 phase 400V
6 poles Induction Motor . . . . . . . . . . . . . . . . .
To determine parameters of an 3 phase delta connected
4 pole induction motor . . . . . . . . . . . . . . . . . .
Determine the shaft power of 6 pole Induction Motor .
Motor parameters at a load power factor . . . . . . . .
To determine the auto tranformer ratio and starting
torque . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine the starting torque in terms of full load
torque . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stator input of 3 phase 4 pole induction motor . . . .
Motor parameters of a 6 pole motor with 40 hp mechanical power . . . . . . . . . . . . . . . . . . . . . . . . .
To determine parameters of 4 pole induction motor considering circuit parameters . . . . . . . . . . . . . . .
Stator Current and pf and efficiency of a motor operating at rated slip . . . . . . . . . . . . . . . . . . . . .
Determine the additional load which can be supplied .
9

153
155
156
157
158
159
160
162
163
163
165
166
167
168
169
170
171
172
173
174
175
175
176
177
179
181

Exa
Exa
Exa
Exa
Exa

10.2
10.3
10.4
10.5
11.1

Exa 11.2
Exa 11.3
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

12.1
12.2
12.3
12.4
12.5
12.6
12.7
12.8

Exa 12.9
Exa 12.10
Exa 12.11
Exa 12.12
Exa 12.13
Exa 12.14
Exa 12.15
Exa 12.16
Exa
Exa
Exa
Exa

12.17
12.18
12.19
12.20

Pf at which the slow machine will work . . . . . . . .


Detemine the load and pf of the other machine . . . .
Determine the value of a shunt capacitor . . . . . . . .
Calculate the inductance of a choke to enable the lamp
Determine the size of the conductor for power and lighting circuit . . . . . . . . . . . . . . . . . . . . . . . . .
Determine the size of the conductor at 25 m distance .
Size of conductor to be used for wiring a 10 kW 400V 3
Phase induction motor . . . . . . . . . . . . . . . . . .
To Compute the number of electrons . . . . . . . . . .
Computing the Average lighting current . . . . . . . .
To Calculate the average voltage . . . . . . . . . . . .
Calculating resistance . . . . . . . . . . . . . . . . . .
Current Calculation using ohms law . . . . . . . . . .
Determination of conductance in a short circuit . . . .
Power Rating Calculation . . . . . . . . . . . . . . . .
To calculate current ratings and maximum voltage of a
rated resistor . . . . . . . . . . . . . . . . . . . . . . .
Determine the output power of the motor . . . . . . .
Calculation of Current and power dissipated in resistors
connected in series . . . . . . . . . . . . . . . . . . . .
To find the value of the unknown resitance in the series
of resistances in a circuit . . . . . . . . . . . . . . . .
To Compute the resistance when operating voltage is
altered . . . . . . . . . . . . . . . . . . . . . . . . . .
To Determine the voltage and branch currents in a cicuit
with resistors connected in parallel . . . . . . . . . . .
To determine resistances in parallel . . . . . . . . . . .
To determine the currents in parallel branches of a network . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To determine current through each resistor in series and
parallel combinational circuit . . . . . . . . . . . . . .
To calculate current in each branch of the given network
To determine the current using loop analysis . . . . .
To calculate current in each branch using loop analysis
To calculate current in each branch using loop analysis
and point voltages in a given network . . . . . . . . .

10

182
182
183
184
186
189
190
192
192
193
193
194
194
195
195
196
197
198
200
200
201
202
203
204
205
207
208

Exa 12.21 To calculate current from a battery and pd across points


A and B . . . . . . . . . . . . . . . . . . . . . . . . . .
Exa 12.22 Determine Current through branch AB of the given network . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exa 12.23 Determine the current in the branches of the network
using nodal analysis . . . . . . . . . . . . . . . . . . .
Exa 12.24 To Calculate current in all branches of the network shown
using nodal analysis . . . . . . . . . . . . . . . . . . .
Exa 13.1 Computing Induced EMF . . . . . . . . . . . . . . . .
Exa 13.2 Computing Instantaneous Induced EMF . . . . . . . .
Exa 13.3 EMF Induced between wing tips . . . . . . . . . . . .
Exa 13.4 EMF generated due to a bar magnet . . . . . . . . . .
Exa 13.5 EMF induced between two coils in a circular iron core
Exa 13.6 Force on the conductor due to a uniform magentic field
Exa 13.7 To determine force between single phase bus bars . . .
Exa 13.8 To Compute the Maximum Induced EMF . . . . . . .
Exa 13.9 Compute Inductance and EMF induced . . . . . . . .
Exa 13.10 Change in Inductance . . . . . . . . . . . . . . . . . .
Exa 13.11 Computation of Current . . . . . . . . . . . . . . . . .
Exa 13.12 To determine Mutual and Self Inductances . . . . . . .
Exa 13.13 Computation of Mutual and self inductance in coils . .
Exa 13.14 EMF induced in coils parallel to each other . . . . . .
Exa 13.15 To Compute the maximum flux set by an coil . . . . .
Exa 13.16 Compute Loss of energy . . . . . . . . . . . . . . . . .
Exa 13.17 Determining Hysteresis loss . . . . . . . . . . . . . . .
Exa 13.18 Compute the Loss per Kg at a particular frequency . .
Exa 13.19 Theory Based Proof relation between self mutual inductances . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

211
212
213
214
216
217
218
218
219
220
220
221
222
222
223
223
224
225
226
227
228
229
229

List of Figures
5.1

To calculate secondary terminal voltage and full load efficiency


at unity pf . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11.1 Determine the size of the conductor for power and lighting
circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 Determine the size of the conductor at 25 m distance . . . .
11.3 Size of conductor to be used for wiring a 10 kW 400V 3 Phase
induction motor . . . . . . . . . . . . . . . . . . . . . . . . .

12

132
187
188
190

Chapter 1
AC Circuits

Scilab code Exa 1.1 To calculate frequency and instantaneous voltage and
time of a voltage wave
1

// To c a l c u l a t e f r e q u e n c y , i n s t a n t a n e o u s v o l t a g e and
t i m e o f a v o l t a g e wave

2
3 clc ;
4 clear ;
5
6 // The v o l a t a g e e q a u t i o n

i s v= 0 . 0 2 s i n ( 4 0 0 0 t + 3 0 (

degress ) ) .
7
8
9 Vm =0.02;
10
11 deff ( a=v o l ( b ) , a=Vm s i n d ( ( ( 4 0 0 0 b ) ( 1 8 0 / %pi ) ) +30)

) ; // F u n c t i o n f o r v o l t a g e e q u a t i o n
12
13 t =320*(10^ -6) ;
14
15 w =4000; // a n g u l a r f r e q u e n c y
16
17 // G e n e r a l e x p r e s s i o n f o r v o l t a g e

13

i s g i v e n by V=Vm

s i n ( ) ( 2 p i f t )+t h e t a )
18 // Comparing b o t h t h e e q a u t i o n s we g e t 2 p i f =4000
19
20 f = w /(2* %pi ) ;
21
22 v = vol ( t ) ;
23
24 // 360 d e g r e s s i s e q u a l t o 1/ f s .
25
26 // R e f e r t h e d i a g r a m w i t h t h i s c o d e t o u n d e r s t a n d

better .
27 // 30 d e g r e s s i s
28
29 t30 =30/( f *360) ;
30
31 disp ( Hz ,f , The f r e q u e n c y o f t h e v o l t a g e wave = )
32 disp ( V ,v , The i n s t a n t a n e o u s v o l t a g e a t t= 320

micro seconds = )
33
34

disp ( s ,t30 , The t i m e r e p r e s e n t e d by 30 d e g r e e s


phase d i f f e r e n c e = )

Scilab code Exa 1.2 To find the current and power


1
2
3
4
5
6
7
8
9
10
11

// To f i n d t h e c u r r e n t and power
clc ;
clear ;
Z =10+20* %i ;
V =120;
I=V/Z;

14

12 theta = atand ( imag ( I ) / real ( I ) ) ;


13
14 P = V * abs ( I ) * cosd ( theta ) ;
15
16 disp ( A ,I , The c u r r e n t f l o w i n g t h r o u g h t h e g i v e n

impedance = )
17 disp ( w a t t ,P , The r e a l power d e l i v e r e d t o t h e
impedance = )

Scilab code Exa 1.3 To find the current and power of a capacitive circuit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// To f i n d t h e c u r r e n t and power o f a c a p a c i t i v e
circuit
clc ;
clear ;
Z =10 -25* %i ;
V =15;
I=V/Z;
theta = atand ( imag ( I ) / real ( I ) ) ;
Pr = V * abs ( I ) * cosd ( theta ) ;
Pq = V * abs ( I ) * sind ( theta ) ;

disp ( A ,I , The c u r r e n t f l o w i n g t h r o u g h t h e g i v e n
impedance = )
18 disp ( w a t t ,Pr , The r e a l power l o s s o f t h e
c a p a c i t i v e impedance = )
19 disp ( Var ,-Pq , The r e a c t i v e power o f t h e c a p a c i t i v e
c i r c u i t = ) // N e g a t i v e s i g n i n d i c a t e s power
genrated .
15

Scilab code Exa 1.4 To find the frequency in the RLC Circuit at a phase
angle of 45 degrees
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

// To f i n d t h e f r e q u e n c y i n t h e RLC C i r c u i t a t a
p h a s e a n g l e o f 45 d e g r e e s
clc ;
clear ;
R =100;
L =2;
C =20*(10^ -6) ;
f1 = poly ([0 1] , f 1 , c ) ;
f2 = poly ([0 1] , f 2 , c ) ;
w1 =2* %pi * f1 ;
w2 =2* %pi * f2 ;
//To a c h i e v e a p h a s e a n g l e o f 45 d e g r e e s , t h e
d i f f e r e n c e b e t w e e n Xl and Xc s h o u l d be e q u a l t o R
// We have two d i f f e r e n t s i t u a t i o n s
Xl1 = L * w1 ;
Xc1 =1/( w1 * C ) ;
Xl2 = L * w2 ;
Xc2 =1/( w2 * C ) ;
cs1 = Xl1 - Xc1 - R ;
cs2 = Xc2 - Xl2 - R ;
f1 = roots ( cs1 (2) ) ;
f2 = roots ( cs2 (2) ) ;
16

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

//To f i n d t h e s u i t a b l e r o o t s and t o d i f f e r e n c i a t e
b e t w e e n p o s i t i v e and n e g a t i v e r o o t s .
a = sqrt ( f1 (1) ) ;
b = sqrt ( f1 (2) ) ;
c = sqrt ( f2 (1) ) ;
d = sqrt ( f2 (2) ) ;
if ( imag ( a ) )
f1 = f1 (2) ;
end
if ( imag ( b ) )
f1 = f1 (1) ;
end
if ( imag ( c ) )
f2 = f2 (2) ;
end
if ( imag ( d ) )
f2 = f2 (1) ;
end
disp ( The f r e q u e n c i e s a t which t h e p h a s e a n g l e i s 45
degress are )
disp ( Hz ,f2 , f 2 = , Hz ,f1 , f 1 = )

Scilab code Exa 1.5 To find the inductance of a choke to operate a 120V
500W lamp at 230V
1

// To f i n d t h e i n d u c t a n c e o f a c h o k e t o o p e r a t e a
120V 500W lamp a t 230V
17

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

clc ;
clear ;
V =120;
W =500;
Rl =( V ^2) / W ;
I = W / V ; // C i r c u i t C u r r e n t
// Q o f a c h o k e means t h e r a t i o o f i t s i n d u c t i v e
reactance to i t s r e s i s t a n c e
Q =2;
f =60;
w =2* %pi * f ;
Vs =230; // S u p p l y V o l t a g e
Xcir =230/ I ;
L = poly ([0 1] , L , c ) ;
Xl = w * L ;
Rc = Xl /2; // Q u t i l i s e d
// t o t a l r e s i s t a n c e
Rt = Rl + Rc ;

ind =( Rt ^2) +( Xl ^2) -( Xcir ^2) ; // C h a r a c t e r i s t i c


equation to f i n d L

33
34 L = roots ( ind ) ;
35
36 disp ( ind , The C h a r a c t e r i s t i c
37

18

equation to f i n d L i s )

38 if ( imag ( sqrt ( L (1) ) ) )


39
L = L (2) ;
40 else
41
L = L (1) ;
42 end
43
44
45 disp ( H ,L , The i n d u c t a n c e o f t h e c h o k e

coil = )

Scilab code Exa 1.6 Determine the value of the circuit components
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// D e t e r m i n e t h e v a l u e o f t h e c i r c u i t c o m p o n e n t s
clc ;
clear ;
Z =10 -(30* %i ) ;
f =1*(10^6) ;
Y =1/ Z ;
G = real ( Y ) ;
B = imag ( Y ) ;
// G= 1/R
// B= wC

w =2* %pi * f ;
R =1/ G ;
C = B /( w ) ;

19

25 cap = abs ((10^9) * C ) /(10^9) ;


26
27 disp ( ohms ,R , The r e s i s t a n c e o f t h e c i r c u i t = )
28 disp ( nF ,cap , The c a p a c i t a n c e o f t h e c i r c u i t = )

Scilab code Exa 1.7 To determine circuit impedance and current in a parallel connection of a resistor and capacitor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// To d e t e r m i n e c i r c u i t i m p e d a n c e and c u r r e n t i n a
p a r a l l e l c o n n e c t i o n o f a r e s i s t o r and c a p a c i t o r .
clc ;
clear ;
R =4700;
V =240;
f =60;
w =2* %pi * f ;
C =2*(10^ -6) ;
Xc = -(1/( C * w ) ) * %i ; // R e a c t a n c e i n p o l a r form
Ir = V / R ;
Ic = V / Xc ;
I = Ir + Ic ; // T o t a l c u r r e n t
Z=V/I;
theta = atand ( imag ( Z ) / real ( Z ) ) ;
mprintf ( Impedance o f t h e c i r c u i t =
abs ( Z ) , theta )

20

%f /

%f ohms ,

Scilab code Exa 1.8 To find the current and impedance and admittance
of the circuit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

//To f i n d t h e c u r r e n t and i m p e d a n c e and a d m i t t a n c e


of the c i r c u i t
clc ;
clear ;
R =25;
Xl =50* %i ;
Z1 = R + Xl ;
Z2 = -40* %i ;
V =100;
Zeq =( Z1 * Z2 ) /( Z1 + Z2 ) ;
Y =1/ Zeq ;
I=V*Y;

mprintf ( The C u r r e n t o f t h e c i r c u i t = %f / %f A \n
, abs ( I ) , atand ( imag ( I ) / real ( I ) ) )
21 mprintf ( The Impedance o f t h e c i r c u i t = %f / %f
ohms \n , abs ( Zeq ) , atand ( imag ( Zeq ) / real ( Zeq ) ) )
22 mprintf ( The A d m i t t a n c e o f t h e c i r c u i t = %f / %f
s i e m e n s \n , abs ( Y ) , atand ( imag ( Y ) / real ( Y ) ) )

Scilab code Exa 1.9 Maximum current and frequncy at which it occurs
and respective voltages
1

// Maximum c u r r e n t and f r e q u n c y a t which i t o c c u r s


and r e s p e c t i v e v o l t a g e s
21

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

clc ;
clear ;
R =5;
L =4*(10^ -3) ;
C =0.1*(10^ -6) ;
V =10;
w0 =1/( sqrt ( L * C ) ) ;
Ir = V / R ;
Vl = w0 * L * Ir ;
Vc = Ir /( w0 * C ) ;

mprintf ( The Maximum C u r r e n t a t r e s o n a n c e


, Ir )
20 mprintf ( The f r e q u e n c y f o r r e s o n a n c e = %f
, w0 )
21 mprintf ( The v o l t a g e m a g n i t u d e a c r o s s t h e
%f V \n , Vl )
22 mprintf ( The v o l t a g e m a g n i t u d e a c r o s s t h e
= %f V \n , Vc )

Scilab code Exa 1.10 RLC circuit problems on resonace


1 // RLC c i r c u i t
2
3 clc ;
4 clear ;
5
6 R =6.28;
7 L =20*(10^ -3) ;

p r o b l e m s on r e s o n a c e

22

= %f A \n
r a d / s e c \n
inductor =
capacitor

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

f =5*(10^3) ;
w =2* %pi * f ;
C =1/( L *( w ^2) ) ;
Xc =1/( w * C ) ;
Xl = L * w ;
Vc =5;
Z = Xc + R + Xl ;
I = Vc / Xc // T o t a l c u r r e n t
V=I*R;

// f r e q u e n c y i s i n v e r s e l y p r o p o r t i o n a l t o s q u a r e
root of capacitance
26 // So i f C i s h a l v e d ; f w i l l i n c r e a s e s q u a r e r o o t o f
2 t i m e s more .
27
28 fn = sqrt (2) * f ;
29
30 Xln =2* %pi * fn * L ;
31
32 Q = Xln / R ;
33
34 // Note u n d e r r e s o n a n c e

c o n d i t i o n s Vl and Vc a r e much
g r e a t e r than the supply v o l t a g e .

35
36

mprintf ( i ) The v a l u e o f c a p a c i t o r = %f m i c r o F \n
,(10^6) * C )
37 mprintf ( i i ) The s u p p l y v o l t a g e = %f V \n ,V )
38 mprintf ( i i i ) The f r e q u e n c y o f r e s o n a n c e when C i s
h a l v e d = %f Hz \n , fn )
39 mprintf (
The Q o f t h e new c i r c u i t = %f \n ,Q )

23

Scilab code Exa 1.11 RLC circuit problems with quality factor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// RLC c i r c u i t p r o b l e m s w i t h q u a l i t y f a c t o r
clc ;
clear ;
C =320*(10^ -12) ;
Q =50;
f0 =175*(10^3) ;
w0 =2* %pi * f0 ;
L =1/( C *( w0 ^2) ) ;
R = w0 * L / Q ;
Xc =1/( C * w0 ) ;
Xl = L * w0 ;
V =0.85;
I=V/R;
Vc = I * Xc ;
bw = f0 / Q ;

mprintf ( The i n d u c t a n c e f o r r e s o n a n c e =%f m H \n


,(10^3) * L ) ;
27 mprintf ( The c u r r e n t f l o w i n g i n t h e c i r c u i t a t
r e s o n a n c e =%f m A \n ,(10^3) * I ) ;
28 mprintf ( The v o l t a g e a c r o s s t h e c a p a c i t o r a t
r e s o n a n c e =%f V \n , Vc ) ;
29 mprintf ( The bandwidth o f t h e c i r c u i t =%f Hz \n , bw )
24

Scilab code Exa 1.12 RLC circuit problem to find the resonance frequncy
and impedance magnitude
1
2
3
4
5
6
7
8
9
10
11

// RLC c i r c u i t p r o b l e m t o f i n d t h e r e s o n a n c e
f r e q u n c y and i m p e d a n c e m a g n i t u d e
clc ;
clear ;
R =10;
L =100*(10^ -3) ;
C =0.01*(10^ -6) ;

f0 =1/((2* %pi ) *( sqrt ( L * C ) ) ) ;


// New f r e q u e n c i e s a c c o r d i n g t o t h e p r o b l e m
statement
12 f1 = f0 -1000;
13 f2 = f0 +1000;
14
15
16
17
18
19
20
21
22
23
24
25
26
27

w1 =2* %pi * f1 ;
w2 =2* %pi * f2 ;
Xl1 = w1 * L ;
Xc1 =1/( w1 * C ) ;
Xl2 = w2 * L ;
Xc2 =1/( C * w2 ) ;
Z1 = sqrt (( R ^2) +(( Xl1 - Xc1 ) ^2) ) ;
Z2 = sqrt (( R ^2) +(( Xl2 - Xc2 ) ^2) ) ;
mprintf ( The Impedance m a g n i t u d e a t 1KHz b e l o w
r e s o n a n c e ( C a p a c i t i v e ) =%f ohms \n , Z1 )
25

28

mprintf ( The Impedance m a g n i t u d e a t 1KHz a b o v e


r e s o n a n c e ( I n d u c t i v e ) =%f ohms \n , Z2 )

Scilab code Exa 1.13 Series Resonace of a RLC circuit with 2 coils
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

// S e r i e s R e s o n a c e o f a RLC c i r c u i t w i t h 2 c o i l s .
clc ;
clear ;
R1 =0.5;
R2 =1.5;
R3 =0.5;
C1 =6*(10^ -6) ;
C2 =12*(10^ -6) ;
L1 =25*(10^ -3) ;
L2 =15*(10^ -3) ;
// Both t h e c o i l s a r e c o n n e c t e d i n s e r i e s
Req = R1 + R2 + R3 ;
Leq = L1 + L2 ;
Ceq =( C1 * C2 ) /( C1 + C2 ) ;
f =1/((2* %pi ) * sqrt ( Leq * Ceq ) ) ;
Q =2* %pi * f * Leq / Req ;
Q1 =2* %pi * f * L1 /( R1 + R3 ) ;
Q2 =2* %pi * f * L2 / R2 ;
mprintf ( i ) The f r e q u e n c y o f r e s o n a n c e = %f Hz o r Wo
= %f r a d / s e c \n ,f ,2* %pi * f )
26

mprintf ( i i ) Q o f t h e c i r c u i t = %f \n ,Q ) // The
t o t a l r e s i s t a n c e s h o u l d be c o n s i d e r e d , E r r o r i n
the textbook
31 mprintf ( i i i ) Q o f c o i l 1 i s %f and Q o f c o i l 2 i s
%f \n ,Q1 , Q2 )
30

Scilab code Exa 1.14 Series Resonance in RLC circuit to find inductance
and power
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// S e r i e s R e s o n a n c e i n RLC c i r c u i t t o f i n d i n d u c t a n c e
and power
clc ;
clear ;
R =5;
C =50*(10^ -6) ;
f0 =100;
w =2* %pi * f0 ;
L =1/( C *( w ^2) ) ;
V =200;
Xc =1/( C * w ) ;
Xl = L * w ;
I=V/R;
P =( I ^2) * R ;
Vc = I * Xc ;
Zc = R +( Xl * %i ) ;
Vz = I *( Zc ) ;
27

26
27 Q0 = Xl / R ;
28
29 bw = f0 / Q0 ;
30
31 printf ( a ) The i n d u c t a n c e o f t h e

c o i l = %f mH \n

,(10^3) * L )
printf ( b ) The power d e l i v e r e d t o t h e c o i l =
n ,(10^ -3) * P )
33 printf ( c ) The v o l t a g e m a g n i t u d e a c r o s s t h e
c a p a c i t o r = %f V \n The v o l t a g e m a g n i t u d e
c o i l = %f V \n ,Vc , abs ( Vz ) ) // M a g n i t u d e s
most a c c u r a c y
34 printf ( d ) The bandwidth o f t h e c i r c u i t = %f
32

%f kW \

of the
with at
\n , bw )

Scilab code Exa 1.15 Determine the current in parallel branches and supply current
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// D e t e r m i n e t h e c u r r e n t i n p a r a l l e l b r a n c h e s and
supply current
clc ;
clear ;
Xl = %i *100; // I n d u c t a n c e
R =10; // R e s i s t a n c e
V =10;
Xco = - %i *100;
Q = abs ( Xl ) / R ;
Z0 = Q * abs ( Xco ) ;
I0 = V / Z0 ;
Ic = V / Xco ;
28

17
18
19
20
21
22
23
24
25

Il = V / Xl ;
Pi = V * I0 ; // Power I n p u t
Pc =( I0 ^2) *10; // Copper L o s s
// F r e q u e n c y r e d u c e d t o f o /2

Xl1 = Xl /2; // New I n d u c t i v e r e a c t a n c e a t h a l f t h e


i n i t i a l frequency
26 Xco1 = Xco *2; // New C a p a c i t a t i v e r e a c t a n c e a t h a l f
the i n i t i a l frequency
27
28 Z1 = R + Xl1 ; // Net i m p e d a n c e o f t h e b r a n c h c o n t a i n i n g

R e s i s t a n c e and i n d u c t o r
29
30

Znet = Z1 * Xco1 /( Xco1 + Z1 ) ; // Net Impedance o f t h e


circuit

31
32 I1 = V / Znet ; // Net C u r r e n t f o r r e d u c e d f r e q u e n c y
33
34 ti1 = atand ( imag ( I1 ) / real ( I1 ) ) ; // Phase A n g l e
35
36 // F r e q u n c y i n c r e a s e d t o 2 f o
37
38 Xl2 =2* Xl ; // New I n d u c t i v e r e a c t a n c e a t d o u b l e t h e

i n i t i a l frequency
Xco2 = Xco /2; // New C a p a c i t a t i v e r e a c t a n c e a t d o u b l e
the i n i t i a l frequency
40 Z2 = R + Xl2 ; // Net i m p e d a n c e o f t h e b r a n c h c o n t a i n i n g
r e s i s t a n c e and i n d u c t o r
39

41
42 Zt = Z2 * Xco2 /( Z2 + Xco2 ) ; // Net Impedance o f t h e
43
44 I2 = V / Zt ; // Net C u r r e n t
45
46 ti2 = atand ( imag ( I2 ) / real ( I2 ) ) ;
47

29

circuit

printf ( a ) The C u r r e n t f l o w i n g i n t h e i n d u c t o r = )
disp ( mA , Il *1000)
printf (
The c u r r e n t f l o w i n g i n t h e c a p a c i t o r = )
disp ( mA , Ic *1000)
printf (
The s u p p l y c u r r e n t = %g mA\n \n , I0
*1000)
53 printf ( b )
The c u r r e n t f o r h a l f t h e i n t i a l
f r e q u e n c y = %g/ %g mA\n , abs ( I1 ) *1000 , ti1 )
54 printf (
The c u r r e n t f o r d o u b l e t h e i n t i a l
f r e q u e n c y = %g/ %g mA\n , abs ( I2 ) *1000 , ti2 )

48
49
50
51
52

Scilab code Exa 1.16 Determine the original and loaded circuit bandwidth
1
2
3
4
5
6
7
8
9
10
11
12

// D e t e r m i n e t h e o r i g i n a l and l o a d e d c i r c u i t
bandwidth
clc ;
clear ;
f0 =1000*(10^3) ;
V =5;
Q =50;
Xl =2*(10^3) ;
Xc0 =2*(10^3) ;
R1 =40*(10^3) ; // Branch n e a r t h e s o u r c e
R2 = Q * Xl ; // Branch w i t h b o t h t h e i n d u c t o r and
resitance

13
14 Z0 = Q * Xc0 ;
15
16 bw = f0 / Q ; // O r i g i n a l Bandwidth
17
18 // C o n s i d e r i n g l o a d i n g r e s i s t a n c e
19
20 Reff = R1 * R2 /( R1 + R2 ) ;

30

21 Qd = Reff / Xc0 ;
22
23 bw1 = f0 / Qd ; // Bandwidth w i t h l o a d i n g r e s i s t a n c e
24
25 printf ( The o r i g i n a l bandwidth = %g kHz \n , bw /1000)
26 printf ( The l o a d e d c i r c u i t bandwidth = %g kHz\n , bw1

/1000)

Scilab code Exa 1.17 Expression for the sum of energy stored by inductor
and capacitor connected in series at resonance
1

// E x p r e s s i o n f o r t h e sum o f e n e r g y s t o r e d by
i n d u c t o r and c a p a c i t o r c o n n e c t e d i n s e r i e s a t
resonance

2
3 clc ;
4 clear ;
5
6 printf ( i = Im c o s ( w0 ) t \n )
7 printf ( The e n e r g y s t o r e d i s L ( i 2 ) /2 = L ( Im 2 ) (

c o s ( w0 t ) 2 ) \n\n )
8
9

10
11
12
13
14
15

printf ( The e n e r g y s t o r e d i n t h e c a p a c i t o r ( q 2 ) /2C


= 1/2C ( Im 2 ) [ i n t e g r a t i o n o f i wrt d t from 0
t o t ] 2 \n )
printf (
= 1/2C ( Im 2 ) [ i n t e g r a t i o n
o f c o s ( w0 t ) wrt d t from 0 t o t ] 2 \ n )
printf (
= 1/2C ( Im 2 ) [ ( s i n ( w0 t ) /w0
) l i m i t s 0 to t ]2\ n )
printf (
= ( Im 2 ) /2 L ( s i n ( w0 t ) 2 ) \
n\n )
printf ( T h e r e f o r e t o t a l e n e r g y = L ( Im 2 ) /2 [ ( c o s (
w0 t ) 2 ) +( s i n ( w0 t ) 2 ) ] \ n )
printf (
= ( Im 2 ) L/2\ n )
printf (
= L ( I 2 ) \n )
31

Scilab code Exa 1.18 Expression for the sum of energy stored by inductor
and capacitor connected in parallel at resonance
1

// E x p r e s s i o n f o r t h e sum o f e n e r g y s t o r e d by
i n d u c t o r and c a p a c i t o r c o n n e c t e d i n p a r a l l e l a t
resonance

2
3 clc ;
4 clear ;
5
6 printf ( v = Vm c o s ( w0 t ) \n )
7 printf ( The e n e r g y s t o r e d by t h e c a p a c i t o r = C (Vm
8
9
10
11
12
13
14

2 ) ( c o s ( w0 t ) 2 ) \n )
printf ( The e n e r g y s t o r e d by t h e i n d u c t o r = L ( i 2 )
/2\ n\n )
printf ( v
= L ( d i / d t ) \n d i = v d t /L\n ( i 2 ) = [
i n t e g r a t i o n o f ( v /L ) wrt d t from 0 t o t ] 2 \n )
printf (
= (Vm 2 ) / ( L 2 ) ( s i n ( w0 t ) 2 ) / ( w0 2 ) =
(Vm/L ) 2 ( s i n ( w0 t ) 2 ) LC\n )
printf (
= (Vm 2 ) C ( s i n ( w0 t ) 2 ) /L \n\n )
printf ( Energy = L ( i 2 ) /2 = (Vm 2 ) C ( s i n ( w0 t ) 2 )
L / ( L 2 ) \n )
printf (
= C/2 (Vm 2 ) ( s i n ( w0 t ) 2 ) \n\n )
printf ( T h e r e f o r e t o t a l e n e r g y = C (Vm 2 ) /2 = C (V
2 ) \n )

Scilab code Exa 1.19 To determine bandwidth and half power frequencies
1 // To d e t e r m i n e bandwidth and h a l f power f r e q u e n c i e s
2
3 clc ;

32

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

clear ;
R =50;
f =750; // F r e q u e n c y
w0 =(2* %pi * f ) ;
L =10*(10^ -3) ;
I =1; // Maximum C u r r e n t
Q = w0 * L / R ;
bw = f / Q ;
a =( f ^2) ; // l e t a = f 1 f 2
b = bw ; // l e t b = f 2 f 1
c = sqrt (( b ^2) +(4* a ) ) ; // l e t c = f 2+f 1
f2 =( b + c ) /2;
f1 =( c - b ) /2;
printf ( The bandwidth = %g Hz\n , bw )
printf ( The h a l f f r e q u e n c i e s a r e f 1 = %g Hz and f 2 =
%g Hz\n ) ,f1 , f2 )

Scilab code Exa 1.20 Determine the frequency of resonance and Max value
of Rc at resonance
1
2
3
4
5
6
7
8

// D e t e r m i n e t h e f r e q u e n c y o f r e s o n a n c e and Max
v a l u e o f Rc a t r e s o n a n c e
clc ;
clear ;
Rl =6;
L =1*(10^ -3) ;
Rc =4;
33

9 C =20*(10^ -6) ;
10
11 w0 =(1/( sqrt ( L * C ) ) ) *( sqrt ((( Rl ^2) -( L / C ) ) /(( Rc ^2) -( L / C

))));
12
13
14
15

Rcmax = sqrt ( L / C ) ;

printf ( The f r e q u e n c y o f r e s o n a n c e = %g r a d / s e c \n ,
w0 )
16 printf ( The Maximum v a l u e o f Rc = %g ohms \n , Rcmax
)

Scilab code Exa 1.21 To determine Rl for which resonance can take place
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// To d e t e r m i n e Rl f o r which r e s o n a n c e can t a k e
place
clc ;
clear ;
Rl = poly (0 , Rl ) ;
Rc =5;
Xc =6;
Xl =15;
x =((( Rl ^2) +( Xl ^2) ) * Xc ) -((( Rc ^2) +( Xc ^2) ) * Xl ) ;
Rl = roots ( x ) ;
disp ( x )
printf ( The a b o v e e q a u t i o n must be e q a u t e d t o z e r o
t o g e t Rl \n )
disp ( Rl )
34

20
21

printf ( The a b o v e e q a u t i o n l e a d s t o i m a g i n a r y r o o t s
which i s n o t p o s s i b l e , h e n c e no v a l u e o f Rl can
bring resonance in the c i r c u i t at the given
c o n d i t i o n \n )

Scilab code Exa 1.22 To find the resistor for a given Q factor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

//To f i n d t h e r e s i s t o r f o r a g i v e n Q f a c t o r
clc ;
clear ;
f0 =600*(10^3) ;
bw =50*(10^3) ; // Bandwidth
L =1.3*(10^ -3) ; // I n d u c t a n c e
Q =30;
Xl =2* %pi * f0 * L ; // I n d u c t i v e R e a c t a n c e
Xco = Xl ; // At r e s o n a n c e Xl= Xco
Zto = Q * Xco ;
Qd = f0 / bw ; // R e q u i r e d Q f o r t h e c i r c u i t
Zdto = Qd * Xco ; // The e q u i v a l e n t i n p u t r e s i s t a n c e
required

22
23 Rd = poly (0 , Rd ) ;
24
25 x =( Zdto *( Zto + Rd ) ) -( Zto * Rd ) ; // C h a r a c t e r i s t i c

equation to the shunt r e s i s t a n c e


35

26
27 Rd = roots ( x ) ; // Shunt r e s i s t a n c e
28
29 printf ( The r e s i s t a n c e t h a t i s t o be c o n n e c t e d

a c r o s s t h e c o i l = %g k ohms \n , Rd /1000)

Scilab code Exa 1.23 Find the flux density


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// Find t h e f l u x d e n s i t y
clc ;
clear ;
l =50*(10^ -2) ; // Mean l e n g t h
m0 =4* %pi *(10^ -7) ; // C o n s t a n t ( P e r m e a b l i t y o f a i r )
ag =1*(10^ -3) ; // A i r Gap
mr =300; // R e l a t i v e p e r m e a b i l i t y
N =200; // No o f t u r n s
I =1; // C u r r e n t
A = poly (0 , A ) ; // Area
Rel = l /( m0 * mr * A ) ; // R e l u c t a n c e o f t h e s u b s t a n c e
Relag = ag /( m0 * A ) ; // A i r gap r e l u c t a n c e
MMF = N * I ;
Relt = Rel + Relag ; // T o t a l r e l u c t a n c e
phi = MMF / Relt ; // Flux
B = phi / A ;
// To g e t t h e n u m e r i c a l v a l u e o f t h e f l u x d e n s i t y a s
t h e p o l y n o m i a l d e n o m i n a t o r doesn t d i v i d e
36

27
28
29
30
31
32
33
34
35
36

x = B (2) -A ;
x = roots ( x ) ;
y = B (3) -A ;
y = roots ( y ) ;
B=x/y;
printf ( The f l u x d e n s i t y = %g mWb/ (m 2 ) \n ,B *1000)

Scilab code Exa 1.24 Find the number of ampere turns


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// Find t h e number o f ampere t u r n s


clc ;
clear ;
l =30*(10^ -2) ; // Length o f an i r o n p a t h
lag =2*(10^ -3) ; // Length o f a i r gap
B =0.8; // Flux d e n s i t y
H =700;
m0 =(4* %pi ) *(10^ -7) ;
mr = B /( m0 * H ) ;
A = poly (0 , A ) ; // Area o f t h e i r o n p a t h
R1 = l /( m0 * mr * A ) ;
R2 = lag /( m0 * A ) ;
R = R1 + R2 ;
phi = B * A ; // Flux
NI = phi * R ;

37

23 //To f i n d n u m e r i c a l v a l u e
24 y = NI - A ;
25
26 NI = roots ( y (2) ) ;
27
28 // The a n s w e r i n t h e t e x t b o o k c o n t a i n s Round o f f
29

error
printf ( The number o f t u r n s n e c e s s a r y t o p r o d u c e a
f l u x d e n s i t y o f 0 . 8 T i n t h e a i r gap = %g AT\n , NI
)

Scilab code Exa 1.25 To find current in the 600 turn exciting coil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

//To f i n d c u r r e n t i n t h e 600 t u r n e x c i t i n g c o i l
clc ;
clear ;
N =600;
mr =800;
m0 =4* %pi *(10^ -7) ;
phi =100*(10^ -6) ; // Flux i n a i r gap
l1 =10*(10^ -2) ;
l2 =18*(10^ -2) ;
lg =2*(10^ -3) ; // A i r gap l e n g t h
Ac =(6.25) *(10^ -4) ; // C e n t r a l l i m b a r e a
As =3*(10^ -4) ; // S i d e l i m b a r e a
Ra = lg /( m0 * Ac ) ;
Ri = l1 /( mr * m0 * Ac ) ;
R = l2 /( m0 * mr * As ) ;

38

23 Rt = Ra + Ri ; // T o t a l r e l u c t a c n e o f t h e c e n t r a l l i m b
24
25 AT1 = Rt * phi ; // MMF o r Ampere t u r n s f o r t h e c e n t r a l

limb
26 AT2 = R * phi /2; // MMF, Two i d e n t i c a l

limbs hence f l u x
becomes h a l f and o n l y one l i m b i s c o n s i d e r e d

27
28 AT = AT1 + AT2 ; // T o t a l MMF
29
30 I = AT / N ; // C u r r e n t i n t h e 600 t u r n s
31
32 printf ( The c u r r e n t f l o w i n g i n t h e 600 t u r n s

e x c i t i n g c o i l = %g A\n ,I )

Scilab code Exa 1.26 Find the current required to develop a flux of given
mWb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Find t h e c u r r e n t r e q u i r e d t o d e v e l o p a f l u x o f
1 . 6 mWb
clc ;
clear ;
B =1;
H =900;
m0 =4* %pi *(10^ -7) ;
mr = B /( m0 * H ) ;
// l e n g t h s
lg =1*(10^ -3) ; // A i r gap
lc =24*(10^ -2) ; // C e n t r a l Limb
la =60*(10^ -2) ; // S i d e l i m b s
// a r e a
A =4*4*(10^ -4) ;
39

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

phi =1.6*(10^ -3) ; // Flux


// R e l u c t a n c e s
Ra = lg /( m0 * A ) ; // A i r gap
Rc = lc /( m0 * mr * A ) ; // C e n t r a l l i m b
Rs = la /( m0 * mr * A ) ; // One s i d e l i m b s
//mmf
AT1 =( Ra + Rc ) * phi ; // C e n t r a l l i m b
AT2 = Rs * phi /2; // One o f t h e s i d e l i m b
AT = AT1 + AT2 ; // T o t a l
N =680; // Turns
I = AT / N ;
printf ( The c u r r e n t t h e c u r r e n t r e q u i r e d t o p r o d u c e
a t o t a l f l u x o f 1 . 6 mWb = %g A\n ,I )

Scilab code Exa 1.27 Determine the inductance of individual winding


1
2
3
4
5
6
7
8

// D e t e r m i n e t h e i n d u c t a n c e o f i n d i v i d u a l w i n d i n g
clc ;
clear ;
La =15; // S e l f i n d u c t a n c e o f f i r s t c o i l
Lb =16; // S e l f i n d u c t a n c e o f s e c o n d c o i l
M = -8; // S i n c e t h e f l u x from b o t h c o i l s o p p o s e e a c h
other

9
10 L1 = La + M ;
11 L2 = Lb + M ;
12

40

13 L = L1 * L2 /( L1 + L2 ) ;
14
15 printf ( The i n d u c t a n c e o f t h e

i n d i v i d u a l windings
a r e %g H and %g H r e s p e c t i v e l y . \ n ,L1 , L2 )
16 printf ( The e q u i v a l e n t i n d u c t a n c e b e t w e e n t h e
t e r m i n a l s i s %g H\n ,L )

Scilab code Exa 1.28 Determine the inductance of a three coil system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// D e t e r m i n e t h e i n d u c t a n c e o f a t h r e e c o i l s y s t e m
clc ;
clear ;
// S e l f i n d u c t a n c e s o f A B C
L1 =25;
L2 =30;
L3 =35;
// Mutual i n d u c t a n c e s o f AB BC CA
M12 =10; // Flux a s s i s t e a c h o t h e r
M23 = -15; // Flux o p p o s e e a c h o t h e r
M31 = -10; // Flux o p p o s e e a c h o t h e r
La = L1 + M12 + M31 ;
Lb = L2 + M12 + M23 ;
Lc = L3 + M31 + M23 ;
Leq =1/((( La * Lb ) +( Lb * Lc ) +( Lc * La ) ) /( La * Lb * Lc ) ) ;
printf ( The e q u i v a l e n t i n d u c t a n c e f o r a t h r e e c o i l
s y s t e m = %g H\n , Leq )

41

Scilab code Exa 1.29 To determine the parameters of an alternating current of 50Hz frequency
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// To d e t e r m i n e t h e p a r a m e t e r s o f an a l t e r n a t i n g
c u r r e n t o f 50 Hz f r e q u e n c y
clc ;
clear ;
f =50;
Im =20;
w =2* %pi * f ;
t =1/100;
It =10;
Irms = Im /( sqrt (2) ) ;
Iav =0; // F u l l C y c l e
t10 = asin ( It / Im ) / w ; // t i m e t a k e n t o r a c h 10A
Ih = Im * sin ( w * t ) ; // C u r r e n t a t 1 / 1 0 0 s e c

printf ( i ) The g e n e r a l e c p r e s s i o n i s i ( t ) = %g s i n
%gt \n ,Im , w )
18 printf ( i i ) The i n s t a n t a n e o u s v a l u e a t t= 1 / 1 0 0 s e c
i s %g A\n , floor ( Ih *10) /10)
19 printf ( i i i ) The t i m e t a k e n t o r e a c h 10A f o r t h e
f i r s t t i m e = %g s \n , t10 )
20 printf ( i v ) The a v e r a g e and t h e rms v a l u e o f c u r r e n t
i s %g A and %g A r e s p e c t i v e l y \n ,Iav , Irms )

Scilab code Exa 1.30 Determine the resultant current for two alternating
currents
1

// D e t e r m i n e t h e r e s u l t a n t c u r r e n t f o r two
alternating currents

42

3
4
5
6
7
8
9
10
11
12
13
14
15
16

clc ;
clear ;
ti1 =30;
ti2 =45;
i1 =20*( expm ( %i * %pi /6) ) ;
i2 =40*( expm ( %i * %pi /4) ) ;
i = i1 + i2 ;
ti = atand ( imag ( i ) / real ( i ) ) ;

printf ( The r e s u l t a n t c u r r e n t = %g s i n ( 3 1 4 t + %g(


d e g r e e s ) ) A\n , abs ( i ) , ti )
17 printf (
Or %g/ %g A\n , abs ( i ) , ti )

Scilab code Exa 1.31 To determine the sum and difference of two alternating voltage sources
1
2
3
4
5
6
7
8
9
10
11
12
13
14

//To d e t e r m i n e t h e sum and d i f f e r e n c e o f two


alternating voltage sources
clc ;
clear ;
// Phase a n g l e s
tv1 =0;
tv2 = - %pi /6;
// Taking v1 a s r e f e r e n c e v o l t a g e
v1 =110*( expm ( %i * tv1 ) ) ;
v2 =80*( expm ( %i * tv2 ) ) ;
Vs = v1 + v2 ; //Sum
43

15 Vd = v1 - v2 ; // D i f f e r e n c e
16
17 ts = atand ( imag ( Vs ) / real ( Vs ) ) ;
18 td = atand ( imag ( Vd ) / real ( Vd ) ) ;
19
20 printf ( i ) The sum = %g s i n ( wt + (%g( d e g r e e s ) ) ) V\n
21

, abs ( Vs ) , ts )
printf ( i ) The d i f f e r e n c e = %g s i n ( wt + (%g( d e g r e e s )
) ) V\n , abs ( Vd ) , td )

Scilab code Exa 1.32 Determine the parameters of the circuit and power
and pf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// D e t e r m i n e t h e p a r a m e t e r s o f t h e c i r c u i t and power
and p f
clc ;
clear ;
tv =30; // Phase a n g l e f o r v o l t a g e
ti = -30; // Phase a n g l e f o r c u r r e n t
t = tv - ti ; // Phase d i f f e r e n c e b e t w e e n v and i
// K e e p i n g i a s r e f e r e n c e , V o l t a g e l e a d s c u r r e n t by t
angle
i =10*( expm ( %i *0) ) ;
v =230*( expm ( %i *( %pi * t /180) ) ) ;
z=v/i;
R = real ( z ) ;
X = imag ( z ) ;
P = abs ( v ) * abs ( i ) * cosd ( t ) /2; // rms v a l u e s o f v o l t a g e
44

and c u r r e n t
21
22
23

printf ( The c i r c u i t p a r a m e t e r s a r e \n )
printf ( R e s i s t a n c e = %g ohms \ n R e a c t a n c e = %g ohms \n\
n ,R , X )
24 printf ( The Power consumed = %g W\n ,P )
25 printf ( p . f o f t h e c i r c u i t = %g\n , cosd ( t ) )

Scilab code Exa 1.33 Determine circuit paramters of an iron coil


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// D e t e r m i n e c i r c u i t p a r a m t e r s o f an i r o n c o i l
clc ;
clear ;
f =50; // F r e q u e n c y
Vdc =40; //DC V o l t a g e s o u r c e
Idc =5; // C u r r e n t drawn from DC V o l t a g e s o u r c e
Vac =200; // AC V o l t a g e S o u r c e
Iac =5; // C u r r e n t drawn form AC V o l t a g e s o u r c e
P =500; // Power Consumed by a c s u p p l y
R = Vdc / Idc ; // R e s i s t a n c e o f t h e c o i l
Z = Vac / Iac ; // Impedance o f t h e c o i l
Pc =( Iac ^2) * R ; // Power l o s s i n ohmic r e s i s t a n c e
Pil =P - Pc ; // I r o n l o s s
Reff = P /( Iac ^2) ; // E f f e c t i v e r e s i s t a n c e o f t h e c o i l
Xl = sqrt (( Z ^2) -( Reff ^2) ) ; // R e a c t a n c e o f t h e c o i l
L = Xl /(2* %pi * f ) ; // I n d u c t a n c e o f t h e c o i l

45

26 pf = P /( Vac * Iac ) ;
27
28 printf ( i ) The i m p e d a n c e = %g ohms \n ,Z )
29 printf ( i i ) The i r o n l o s s = %g W\n , Pil )
30 printf ( i i i ) The i n d u c t a n c e o f t h e c o i l = %g H\n ,L )
31 printf ( i v ) p . f o f t h e c o i l = %g\n , pf )

Scilab code Exa 1.34 Determine the phase angle between 220V main and
the current
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// D e t e r m i n e t h e p h a s e a n g l e b e t w e e n 220V main and


the current
clc ;
clear ;
f =50; // F r e q u e n c y o f AC Mains
Vni =100; // V o l t a g e f o r non i n d u c t i v e l o a d
Ini =10; // C u r r e n t drawn by a non i n d u c t i v e l o a d
Rni = Vni / Ini ; // R e s i s t a n c e o f an non i n d u c t i v e l o a d
Vac =220; // S u p p l y from AC Mains
Z = Vac / Ini ;
X = sqrt (( Z ^2) -( Rni ^2) ) ;
phi = atand ( X / Rni ) ; // Phase A n g l e
L = X /(2* %pi * f ) ; // I n d u c t a n c e

printf ( The i n d u c t a n c e o f a r e a c t o r t o be c o n n e c t e d
i n s e r i e s = %g H\n ,L )
21 printf ( The p h a s e a n g l e b e t w e e n t h e 220V mains and
t h e c u r r e n t = %g d e g r e e s \n , phi )

46

Scilab code Exa 1.35 To determine the coil parameters with resistance of
5 ohms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

//To d e t e r m i n e t h e c o i l p a r a m e t e r s w i t h r e s i s t a n c e
o f 5 ohms
clc ;
clear ;
// P a r a m e t e r s o f t h e c o i l
R =5; // R e s i s t a n c e
I =10; // C u r r e n t f l o w i n g
V =200; // V o l t a g e a c r o s s
f =50; // F r e q u e n c y o f o p e r a t i o n
P =750; // T o t a l Power D i s s i p a t e d
Pc =( I ^2) * R ; // Copper L o s s
Pil =P - Pc ; // I r o n L o s s
Z = V / I ; // Impedance
X = sqrt (( Z ^2) -( R ^2) ) ; // R e a c t a n c e
L = X /(2* %pi * f ) ; // I n d u c t a n c e
pf = P /( V * I ) ; // Power F a c t o r

printf ( i The i r o n l o s s = %g W\n , Pil )


printf ( i i ) The i n d u c t a n c e a t t h e g i v e n v a l u e o f
c u r r e n t = %g H\n ,L )
25 printf ( i i i ) p . f = %g\n , pf )

47

Scilab code Exa 1.36 Determine the resonant frequency and the source
current
1
2
3
4
5
6
7
8
9
10
11
12
13
14

// D e t e r m i n e t h e r e s o n a n t f r e q u e n c y and t h e s o u r c e
current
clc ;
clear ;
L =0.24; // I n d u c t a n c e
Rl =150;
Rc =100;
C =3*(10^ -6) ; // C a p a c i t a n c e
f =50;
w =2* %pi * f ;
V =200; // S o u r c e v o l t a g e
fs =1/(2* %pi * sqrt ( L * C ) ) ; // F r e q u e n c y a t t h e t i m e o f
s e r i e s connection

15
16 f0 = fs * sqrt ((( Rl ^2) -( L / C ) ) /(( Rc ^2) -( L / C ) ) ) // R e s o n a n t

frequency
17
18 // Taking v o l t a g e a s t h e r e f e r e n c e
19
20 Xl = L * w ; // I n d u c t i v e r e a c t a n c e
21 Xc =1/( C * w ) ; // C a p a c i t i v e r e a c t a n c e
22
23 Ra = Rl +( %i * Xl ) ; // E f f e c t i v e r e s i s t a n c e

of inductive

branch
24 Rb = Rc -( %i * Xc ) ; // E f f e c t i v e

resistance of capacitive

branch
25
26 Reff = Ra * Rb /( Ra + Rb ) ; // E f f e c t i v e R e s i s t a n c e
27 Tr = atand ( imag ( Reff ) / real ( Reff ) ) ; // Phase A n g l e
28
29 I = V / Reff ; // S o u r c e c u r r e n t
30 Ti = atand ( imag ( I ) / real ( I ) ) // Phase a n g l e

48

31
32
33
34

printf ( The r e s o n a n t f r e q u e n c y = %g Hz\n , f0 )


printf ( The s o u r c e c u r r e n t = %g/ %g A\n , abs ( I ) , Ti )
printf ( The i n p u t i m p e a d a n c e = %g/ %g ohms \n , abs (
Reff ) , Tr )

Scilab code Exa 1.37 Determine Circuit parameters for a circuit with a
current source
1
2
3
4
5
6
7
8
9
10

// D e t e r m i n e C i r c u i t p a r a m e t e r s f o r a c i r c u i t w i t h a
current source
clc ;
clear ;

I =2.5*(10^ -3) ; // C u r r e n t S o u r c e
R =100; // R e s i s t a n c e o f t h e c o i l
L =1*(10^ -3) ; // I n d u c t a n c e o f t h e c o i l
fr =600*(10^3) ; // R e s o n a n c e f r e q u e n c y
R2 =60*(10^3) ; // R e s i s t a n c e i n p a r a l l e l w i t h t h e
coil
11 wr =2* %pi * fr ; // A n g u l a r R e s o n a n c e f r e q u e n c y
12
13 Q = wr * L / R ; // For t h e c o i l
14
15 C =1/(( wr ^2) * L ) ; // C a p c i t a n c e i n t h e c i r c u i t
16 Xc0 =1/( wr * C ) ;
17
18 Recc = Q * Xc0 ; // E q u i v a l e n t r e s i s t a n c e o f c o i l and

capacitor
19
20 Req = R * Recc /( R + Recc ) ; // E q u i v a l e n t

circuit
21
22

Qcir = wr * Req * C ; // For t h e c i r c u i t


49

r e s i s t a n c e of the

23
24 bw = fr / Qcir ; // Bandwidth o f t h e c i r c u i t
25
26 v = I * Req ;
27
28 MaxE = C *( v ^2) ; // Maximum e n e r g y s t o r e d by t h e

capacitor
29
30 Pdr =( I ^2) * Req ; // Power d i s s i p a t e d i n t h e r e s i s t o r
31
32
33 // Textbook c a l c u l a t i o n f o r E q u i v a l e n t r e s i s t a n c e o f

C and C o i l i s wrong
34
35
36
37
38

printf ( a ) Q o f t h e c o i l = %g\n ,Q )
printf ( b ) C a p a c i t a n c e C = %g pF\n ,C *(10^12) )
printf ( c ) Q o f t h e c i r c u i t = %g\n , Qcir )
printf ( d ) Bandwidth o f t h e c i r c u i t = %g kHz \n , bw
/1000)
39 printf ( e ) Maximum Energy s t o r e d i n t h e c a p a c i t o r =
%g pJ \n , MaxE *(10^12) )
40 printf ( f ) Power D i s s i p a t e d i n t h e r e s i s t o r = %g mW\
n , Pdr *1000)

Scilab code Exa 1.38 Determine the instantaneous energy stored in the
capacitor and inductor
1

// D e t e r m i n e t h e i n s t a n t a n e o u s e n e r g y s t o r e d i n t h e
c a p a c i t o r and i n d u c t o r

2
3 clc ;
4 clear ;
5
6 Vc =20* sqrt (2) ;
7 C =2; // C a p a c i t o r

50

8 L =1; // I n d u c t o r
9 w = poly (0 , w ) ;
10
11 // I m p e d a n c e s i n o r d e r from l e t

to r i g h t ( as a

f u n c t i o n o f w)
12 R1 = %i * w ;
13 R2 =1/(2* %i * w ) ; // Top
14 R3 =1; // Bottom
15
16 Rp = R2 * R3 /( R2 + R3 ) ; // E f f e c t i v e

r e s i s t a n c e of the

p a r a l l e l path
17
18 Reff = R1 + Rp ; // E f f e c t i v e r e s i s t a n c e
19
20 Reff (2) = Reff (2) * conj ( Reff (3) ) ;
21 Reff (3) = Reff (3) * conj ( Reff (3) ) ;
22
23 R = imag ( Reff (2) ) / Reff (3) ; // I m a g i n a r y p a r t o f t h e

above e q u a t i o n
24
25

// From t h e a b o v e e q u a t i o n we g e t f i v e r o o t s , t h r e e
a r e z e r o and we t a k e t h e p o s i t i v e v a l u e
26 w = roots ( R (2) ) ;
27 w = abs ( w (2) ) ; // N u m e r i c a l V a l u e

28
29

// I m p e d a n c e s i n o r d e r from l e t t o r i g h t ( N u m e r i c a l
Value )
30 R1 = %i * w ;
31 R2 =1/(2* %i * w ) ; // Top
32 R3 =1; // Bottom
33
34 Vcrms = Vc / sqrt (2) ;
35
36 // Taking Vc a s r e f e r e n c e
37
38 Ic = Vcrms / R2 ; // C u r r e n t t h r o u g h C a p a c i t o r
39 Ir = Vcrms / R3 ; // C u r r e n t t h r o u g h R e s i s t o r
40

51

41 Il = Ic + Ir ; // Rms v a l u e o f C u r r e n t t h r o u g h I n d u c t o r
42 tl = atand ( imag ( Il ) / real ( Il ) ) ; // Phase a n g l e o f

Inductor Current
43
44
45
46

Ilmax = abs ( Il ) * sqrt (2) ; // Maximum C u r r e n t


Eins = C *( Vc ^2) /2; // Magnitude o f I n s t a n e o u s e n e r g y
stored

47
48 Ein = L *( abs ( Ilmax ) ^2) /2; // Energy t h r o u g h t h e

inductor
49 Er =( Ir ^2) * R3 ; // L o s s i n t h e r e s i s t o r
50
51 Q0 = w * Ein *(1+(1/ sqrt (2) ) ) / Er ; // Q o f t h e c i r c u i t
52
53 printf ( a )
I n s t a n e o u s Energy S t o r e d i n C a p a c i t o r =

%g ( s i n ( %gt ) 2 ) \n , Eins , w )
printf (
I n s t a n e o u s Energy S t o r e d i n I n d u c t o r =
%g ( s i n ( %gt + %g) 2 ) \n ,Ein ,w , tl )
55 printf ( b ) Q o f t h e c i r c u i t = %g \n , Q0 )
54

Scilab code Exa 1.39 To determine the current through all the branches
of the given network
1
2
3
4
5
6
7
8
9
10

//To d e t e r m i n e t h e c u r r e n t t h r o u g h a l l t h e b r a n c h e s
o f the given network
clc ;
clear ;
L =1;
R =1*(10^3) ;
C =400*(10^ -6) ;
i =2; // 2 c o s 50 t

52

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

w0 =1/( sqrt ( L * C ) ) ;
v = i * R ; // V o l t a g e a c r o s s t h e s o u r c e
Xl = %i * w0 * L ; // I n d u c t i v e r e a c t a n c e
Xc = - %i /( C * w0 ) ; // C a p a c i t i v e r e a c t a n c e
Il = v / Xl ; // I n d u c t o r c u r r e n t
Ic = v / Xc ; // C a p a c i t o r C u r r e n t
// C o n d i t i o n t o c h e c k i f a n g l e i s 90
if ( real ( Il ) ==0)
if ( imag ( Il ) >0)
tl = atand ( %inf ) ;
else
tl = -1* atand ( %inf ) ;
end
else
tl = atand ( imag ( Il ) / real ( Il ) ) ;
end
// C o n d i t i o n t o c h e c k i f a n g l e i s 90
if ( real ( Ic ) ==0)
if ( imag ( Ic ) >0)
tc = atand ( %inf ) ;
else
tc = -1* atand ( %inf ) ;
end
else
tc = atand ( imag ( Ic ) / real ( Ic ) ) ;
end

printf ( The C u r r e n t t h r o u g h t h e r e s i s t o r i s %g c o s (
%g) t A\n ,i , w0 )
46 printf ( The C u r r e n t t h r o u g h t h e i n d u c t o r i s %g c o s (
%gt + (%g) ) A\n , abs ( Il ) ,w0 , tl )
53

47

printf ( The C u r r e n t t h r o u g h t h e c a p a c i t o r i s %g c o s (
%gt + (%g) ) A\n , abs ( Ic ) ,w0 , tc )

Scilab code Exa 1.40 To determine parameters to operate the relay


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

//To d e t e r m i n e p a r a m e t e r s t o o p e r a t e t h e r e l a y
clc ;
clear ;
N =500; // No o f t u r n s
l =400*(10^ -3) ; // Mean Core l e n g t h
lg =1*(10^ -3) ; // A i r Gap l e n g t h
B =0.8; // Flux d e n s i t y r e q u i r e d t o o p e r a t e t h e r e l a y
m0 =4* %pi *(10^ -7) ; // p e r m e a b i l i t y o f f r e e s p a c e
H =500; // M a g e n t i c F i e l d I n t e n s i t y
mmfc = H * l ; // mmf f o r t h e c o r e
mmfg =2* lg * B /( m0 ) ; // mmf o f t h e a i r gap
tmmf = mmfc + mmfg ; // T o t a l mmf
Iop = tmmf / N ; // O p e r a t i n g c u r r e n t f o r t h e r e l a y
m = B / H ; // P e r m e a b i l i t y
mr = m / m0 ; // R e l a t i v e p e r m e a b i l i t y
// When gap i s z e r o
mmf = mmfc ; // T o t a l mmf r e q u i r e d
I = mmf / N ; // C u r r e n t when t h e gap i s z e r o
printf ( i ) The c u r r e n t r e q u i r e d t o o p e r a t e t h e r e l a y
54

= %g A\n , Iop )
31 printf ( i i ) Wrt t h e Core , The p e r m e a b i l i t y = %g and
R e l a t i v e p e r m e a b l i t y = %g \n ,m , mr )
32 printf ( i i i ) The c u r r e n t r e q u i r e d when gap i s z e r o =
%g A \n ,I )

Scilab code Exa 1.41 To determine the parameters of a toroid


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// To d e t e r m i n e t h e p a r a m e t e r s o f a t o r o i d
clc ;
clear ;
// Arc l e n g t h o f d i f f e r e n t m a t e r i a l s
lni =0.3; // n i c k e l i r o n a l l o y
lss =0.2; // S i l i c o n S t e e l
lcs =0.1; // C a s t s t e e l
A =1*(10^ -3) ; // Area o f c r o s s s e c t i o n o f T o r o i d
N =100; // Hundred Turns
phi =6*(10^ -4) ; // Flux
B =0.6; // Flux d e n s i t i e s
m0 =4* %pi *(10^ -7) ;
// F i e l d i n t e n s i t i e s
Hni =10; // Ni a l l o y
Hss =77; // S i S t e e l
Hcs =270; // CAst s t e e l
mmf =( Hni * lni ) +( Hss * lss ) +( Hcs * lcs ) ; // T o t a l mmf
B = phi / A ;

55

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

I = mmf / N ;
//P = P e r m e a b i l i t y , RP = R e l a t i v e p e r m e a b l i t y
// For N i c k e l A l l o y
mni = B / Hni ; // P
mrni = mni / m0 ; // RP
// For S i S t e e l
mss = B / Hss ; //P
mrss = mss / m0 ; // RP
// For C a s t S t e e l
mcs = B / Hcs ; //P
mrcs = mcs / m0 ; // RP
deff ( x= r e l ( y , z ) , x=(y z ) / p h i ) ; // F u c n t i o n t o
f i n d out Reluctance

45
46 // R e l u c t a n c e s
47 Rni = rel ( Hni , lni ) ;
48 Rss = rel ( Hss , lss ) ;
49 Rcs = rel ( Hcs , lcs ) ;
50
51 printf ( i ) The mmf r e q u i r e d t o
52
53
54
55
56

e s t a b l i s h a magnetic
f l u x o f 6 (10 4) Wb = %g AT\n , mmf )
printf ( i i ) The C u r r e n t t h r o u g h t h e c o i l = %g A\n ,I
)
printf ( i i i ) R e l a t i v e p e r m e a b i l i t y and r e l u c t a n c e o f
e a c h f e r r o m a g n e t i c m a t e r i a l \n )
printf (
N i c k e l I r o n a l l o y i s %g and %g ohms \n ,
mrni , Rni )
printf (
S i l i c o n S t e e l i s %g and %g ohms \n , mrss
, Rss )
printf (
C a s t S t e e l i s %g and %g ohms \n , mrcs ,
Rcs )

56

Scilab code Exa 1.42 Determine the magnetic flux for a toriod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// D e t e r m i n e t h e m a g n e t i c f l u x f o r a t o r i o d
clc ;
clear ;
// Arc l e n g t h o f d i f f e r e n t m a t e r i a l s
lni =0.3; // n i c k e l i r o n a l l o y
lss =0.2; // S i l i c o n S t e e l
lcs =0.1; // C a s t s t e e l
// F i e l d i n t e n s i t i e s
Hni =10; // Ni a l l o y
Hss =77; // S i S t e e l
Hcs =270; // C a s t s t e e l
con =6*(10^ -4) ; // G i v e s C o n s t a n t r e l u c t a n c e s
deff ( x= r e l ( y , z ) , x=(y z ) / con ) ; // F u c n t i o n t o
f i n d out Reluctance

19
20 // R e l u c t a n c e s
21 Rni = rel ( Hni , lni ) ; // Note t h a t t h e t e x t b o o k h a s a

wrong v a l u e c a l c u l a t e d f o r t h e n i c k e l a l l o y
reluctance
22 Rss = rel ( Hss , lss ) ;
23 Rcs = rel ( Hcs , lcs ) ;
24
25 mmf =35; // A p p l i e d mmf
26
27 phi = mmf /( Rni + Rss + Rcs ) ; // M a g n e t i c f l u x p r o d u c e d
28
29 printf ( The a p p r o x i m a t e m a g n e t i c f l u x p r o d u c e d = %g

57

Wb\n , phi )

Scilab code Exa 1.43 To determine the magnetic parameters of a steel


ring
1
2
3
4
5
6
7
8
9

//To d e t e r m i n e t h e m a g n e t i c p a r a m e t e r s o f a s t e e l
ring
clc ;
clear ;

d =30*(10^ -2) ; // Mean d i a m e t e r


m0 =4* %pi *(10^ -7) ;
lg =1*(10^ -3) ; // A i r Gap l e n g t h
r =(2*(10^ -2) ) /2; // r a d i u s o f t h e c i r c u l a r p a r t o f
t h e a i r gap
10 Ag = %pi * r * r ; // Area o f t h e a i r gap
11 N =600; // No o f t u r n s
12 I =2.5; // C u r r e n t
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Ip =40/100; // I r o n p a t h u s a g e
Agp =1 - Ip ; // A i r gap u s a g e
mmf = N * I ;
mmfs = Ip * mmf ; // mmf r e q u i r e d f o r t h e s t e e l
mmfg = Agp * mmf ; // mmf r e q u i r e d f o r t h e a i r gap
Rg = lg /( m0 * Ag ) ; // R e l u c t a n c e o f t h e a i r gap
phi = mmfg / Rg ; // Flux t h r o u g h t h e gap
Rs = mmfs / phi ; // R e l u c t a n c e o f s t e e l
Rt = Rs + Rg ; // T o t a l r e l u c t a n c e
B = phi / Ag ; // Flux d e n s i t y o f a i r

58

printf ( i ) mmf o f a i r gap and s t e e l r i n g = %gAT and


%gAT\n , mmfg , mmfs )
30 printf ( i i ) M a g n e t i c f l u x = %g mWb\n , phi *1000)
31 printf ( i i i ) R e l u c t a n c e = %g M ohms \n , Rt /(10^6) )
32 printf ( i v ) Flux d e n s i t y = %g T\n ,B )
29

59

Chapter 2
Network Theory

Scilab code Exa 2.1 To determine the current using loop analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// To d e t e r m i n e t h e c u r r e n t u s i n g l o o p a n a l y s i s
clc ;
clear ;
// MESH E q u a t i o n s
// 6 i 1 2 i 2 =30
// 2 i 1 +6 i 2 =40
R =[6 -2; -2 6];
E =[30; -40];
// The Loop C u r r e n t s
I = inv ( R ) * E ; // M a t r i x Method t o s o l v e f o r two
unknowns i n two e a q u a t i o n s .

16
17 i1 = I (1) ;
18 i2 = I (2) ;
19 i3 = i1 - i2 ;
20

60

21
22
23

24
25
26
27
28
29
30
31
32
33

disp ( A ,i2 , i 2 = , A ,i1 , i 1 = , The C a l c u l a t e d


Loop C u r r e n t s a r e )
disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed
d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d .
)
if ( i1 <0) ;
i1 = abs ( i1 ) ;
end
if ( i2 <0) ;
i2 = abs ( i2 ) ;
end

disp ( A ,i1 , The C u r r e n t t h r o u g h 4 ohm r e s i s t o r on


t h e 30V s i d e = )
34 disp ( A ,i2 , The C u r r e n t t h r o u g h 4 ohm r e s i s t o r on
t h e 40V s i d e = )
35 disp ( A ,i3 , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r = )

Scilab code Exa 2.2 To calculate current in each branch using loop analysis
1

// To c a l c u l a t e c u r r e n t i n e a c h b r a n c h u s i n g l o o p
analysis .

2
3 clc ;
4 clear ;
5
6 // MESH E q u a t i o n s f o r t h e g i v e n n e t w o r k .
7 // 3 i 1 i 2 +0 i 3 =11
8 // i 1 +10 i 2 2 i 3 =0
9 // 0 i 1 +2 i 2 +5 i 3 =13
10

61

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43

// V o l t a g e s u p p l i e s a r e 11V and 13V


R =[3 -1 0; -1 10 -2; 0 -2 5];
E =[11;0;13];
// Loop C u r r e n t s
I = inv ( R ) * E ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
ia = i1 - i2 ; // Assumed d i r e c t i o n from Mesh 1
ib = i2 - i3 ; // Assumed d i r e c t i o n from Mesh 2
disp ( A ,ib , i b ( t h r o u g h 2 r e s i s t o r b e t w e e n 7 ohm
and 3 ohm r e s i s t o r ) = , A ,ia , i a ( t h r o u g h 1 ohm
r e s i s t o r ) = , A ,i3 , i 3 = , A ,i2 , i 2 = , A ,i1 ,
i 1 = , The C a l c u l a t e d Loop C u r r e n t s a r e )
disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed
d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d
)
// To o b t a i n t h e m a g n i t u d e o f d i r e c t i o n .
if ( i1 <0)
i1 = abs ( i1 ) ;
end
if ( i2 <0)
i2 = abs ( i2 ) ;
end
if ( i3 <0)
i3 = abs ( i3 ) ;
end
if ( ia <0)
ia = abs ( ia ) ;
62

44 end
45 if ( ib <0)
46
ib = abs ( ib ) ;
47 end
48
49 disp ( A ,i1 , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r on

t h e 11V s i d e = )
disp ( A ,i2 , The C u r r e n t t h r o u g h 7 ohm r e s i s t o r = )
disp ( A ,i3 , The C u r r e n t t h r o u g h 3 ohm r e s i s t o r on
t h e 13V s i d e = )
52 disp ( A ,ia , The C u r r e n t t h r o u g h 1 ohm r e s i s t o r = )
53 disp ( A ,ib , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r
b e t w e e n t h e 7 and 3 ohm r e s i s t o r s = )
50
51

Scilab code Exa 2.3 To calculate current in each branch using loop analysis and point voltages in a given network
1

// To c a l c u l a t e c u r r e n t i n e a c h b r a n c h u s i n g l o o p
a n a l y s i s and p o i n t v o l t a g e s i n a g i v e n n e t w o r k .

2
3 clc ;
4 clear ;
5
6 // MESH E q u a t i o n s f o r t h e g i v e n n e t w o r k .
7 // 3 . 9 5 i 1 3.75 i 2 +0 i 3 =120
8 // 3.75 i 1 +9.5 i 2 5.45 i 3 =0
9 // 0 i 1 5.45 i 2 +5 .55 i 3 =110
10
11 // P o s i t i v e o f 120V DC s u p p l y c o n n e c t e d t o 0 . 2 ohm

resistor
12 // P o s i t i v e o f 110 DC s u p p l y c o n n e c t e d t o 0 . 1 ohm
resistor
13
14
15

// V o l t a g e s u p p l i e s a r e 120V and 110V

63

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

38
39

40
41
42
43
44
45
46
47
48

R =[3.95 -3.75 0; -3.75 9.5 -5.45; 0 -5.45 5.55];


E =[120;0; -110];
R1 = abs ( R (2) ) ; // R e s i s t o r c a r r y i n g i a
R2 = abs ( R (8) ) ; // R e s i s t o r c a r r y i n g i b
// Loop C u r r e n t s
I = inv ( R ) * E ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
ia = i1 - i2 ; // Assumed d i r e c t i o n from Mesh 1
ib = i2 - i3 ; // Assumed d i r e c t i o n from Mesh 2
// U s i n g Nodal A n a l y s i s t o f i n d V1 and V2 .
V1 = R1 * ia ;
V2 = R2 * ib ;
disp ( A ,ib , i b ( t h r o u g h 2 r e s i s t o r b e t w e e n 7 ohm
and 3 ohm r e s i s t o r ) = , A ,ia , i a ( t h r o u g h 1 ohm
r e s i s t o r ) = , A ,i3 , i 3 = , A ,i2 , i 2 = , A ,i1 ,
i 1 = , The C a l c u l a t e d Loop C u r r e n t s a r e )
disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed
d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d
)
// To o b t a i n t h e m a g n i t u d e o f d i r e c t i o n .
if ( i1 <0)
i1 = abs ( i1 ) ;
end
if ( i2 <0)
i2 = abs ( i2 ) ;
end
64

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

if ( i3 <0)
i3 = abs ( i3 ) ;
end
if ( ia <0)
ia = abs ( ia ) ;
end
if ( ib <0)
ib = abs ( ib ) ;
end
disp ( A ,i1 , The
t h e 120V s i d e
disp ( A ,i2 , The
)
disp ( A ,i3 , The
t h e 110V s i d e
disp ( A ,ia , The
)
disp ( A ,ib , The
)

C u r r e n t t h r o u g h 0 . 2 ohm r e s i s t o r on
=)
C u r r e n t t h r o u g h 0 . 3 ohm r e s i s t o r =
C u r r e n t t h r o u g h 0 . 1 ohm r e s i s t o r on
=)
C u r r e n t t h r o u g h 3 . 7 5 ohm r e s i s t o r =
C u r r e n t t h r o u g h 5 . 4 5 ohm r e s i s t o r =

disp ( V ,V1 , The v o l t a g e V1 = )


disp ( V ,V2 , The v o l t a g e V2 = )

Scilab code Exa 2.4 To calculate current from a battery and pd across
points A and B
1

// To c a l c u l a t e c u r r e n t from a b a t t e r y and pd a c r o s s
p o i n t s A and B

2
3 clc ;
4 clear ;
5
6 // R e s i s t a n c e s
7 R1 =4;

in the given network

65

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

R2 =2;
R3 =3;
R4 =6;
R5 =8;
// MESH E q u a t i o n s
// 9 i 1 5 i 2 =10
// 5 i 1 +19 i 2 =0
// S u p p l y v o l t a g e 10V
R =[( R1 + R2 + R3 ) -( R2 + R3 ) ; -( R2 + R3 ) ( R2 + R3 + R4 + R5 ) ];
V =[10;0];
// Loop C u r r e n t s
I = inv ( R ) * V ;
i1 = I (1) ;
i2 = I (2) ;
i3 = i1 - i2 ; // From Mesh 1
// P o i n t V o l t a g e s
Va = i3 * R3 ;
Vb = i2 * R5 ;

disp ( a m p e r e s , abs ( i1 ) , The


r e s i s t o r and t h e b a t t e r y
35 disp ( a m p e r e s , abs ( i2 ) , The
and 8 ohm r e s i s t o r s = )
36 disp ( a m p e r e s , abs ( i3 ) , The
and 3 ohm r e s i s t o r s = )
37
38
39
40

c u r r e n t t h r o u g h 4 ohm
=)
c u r r e n t t h r o u g h 6 ohm
c u r r e n t t h r o u g h 2 ohm

disp ( v o l t s , abs ( Va ) , The v o l t a g e a t p o i n t A = )


disp ( v o l t s , abs ( Vb ) , The v o l t a g e a t p o i n t B = )
disp ( v o l t s ,( Va - Vb ) , The v o l t a g e a c r o s s P o i n t s A
and B = )

66

Scilab code Exa 2.5 Determine Current through branch AB of the given
network
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// D e t e r m i n e C u r r e n t t h r o u g h b r a n c h AB o f t h e g i v e n
network
clc ;
clear ;
// MESH E q u a t i o n s
// 4 i 1 2 i 2 +0 i 3 =10
// 2 i 1 +6 i 2 2 i 3 =0
// 0 i 1 2 i 2 +6 i 3 =0
// S u p p l y V o l t a g e i s 10V ( Note p r i n t i n g m i s t a k e )
R =[4 -2 0; -2 6 -2; 0 -2 6];
V =[10;0;0];
// Loop C u r r e n t s
I = inv ( R ) * V ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
disp ( a m p e r e s , abs ( i2 ) , The c u r r e n t t h r o u g h b r a n c h
AB o f t h e n e t w o r k = )

Scilab code Exa 2.6 Determine the current in the branches of the network
using nodal analysis
67

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

// D e t e r m i n e t h e c u r r e n t i n t h e b r a n c h e s o f t h e
network u s i n g nodal a n a l y s i s
clc ;
clear ;
// S u p p l y v o l t a g e s
V1 =30;
V2 =40;
// R e s i s t a n c e s i n t h e n e t w o r k
R1 =4;
R2 =2;
R3 =4;
Vb = poly ([0 1] , Vb , c ) ;
AD =( V1 - Vb ) / R1 ;
BD =( V2 - Vb ) / R3 ;
CD = Vb / R2 ;
X = AD + BD - CD ;
disp ( The C h a r a c t e r i c t i c E q u a t i o n t o f i n d Vb i s )
disp ( CD , = ,AD ,

+ , BD )

Vb = roots ( X ) ; // S t o r e s t h e n u m e r i c a l v a l u e o f Vb
i1 =( V1 - Vb ) / R1 ;
i2 =( V2 - Vb ) / R3 ;
i3 = Vb / R2 ;

disp ( a m p e r e s ,i1 , C u r r e n t t h r o u g h 4 ohm r e s i s t o r on


t h e 30V s u p p l y s i d e = )
34 disp ( a m p e r e s ,i2 , C u r r e n t t h r o u g h 4 ohm r e s i s t o r on
t h e 40V s u p p l y s i d e = )
35 disp ( a m p e r e s ,i3 , C u r r e n t t h r o u g h 2 ohm r e s i s t o r =
68

Scilab code Exa 2.7 To Calculate current in all branches of the network
shown using nodal analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

// To C a l c u l a t e c u r r e n t i n a l l b r a n c h e s o f t h e
n e t w o r k shown u s i n g n o d a l a n a l y s i s
clc ;
clear ;
// Nodal E q u a t i o n s
// 13Va4Vb=300
//Va+4Vb=120
X =[13 -4; -1 4];
V =[300;120];
E = inv ( X ) * V ;
Va = E (1) ;
Vb = E (2) ;
i1 =(100 - Va ) /20;
i2 =( Va - Vb ) /15;
i3 =( Va /10) ;
i4 =( Vb /10) ;
i5 =(80 - Vb ) /10;
disp ( V ,Vb , V o l t a g e Vb = , V ,Va , V o l t a g e Va = )
disp ( The Branch C u r r e n t s a s c a l c u l a t e d a r e )
disp ( i5 , i 5 ,i4 , i 4 ,i3 , i 3 ,i2 , i 2 ,i1 , i 1 )
disp ( a m p e r e s r e s p e c t i v e l y )

69

30
31
32
33
34
35
36

disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed


d i r e c t i o n o f f l o w o f c u r r e n t must be r e v e r e s e d )
disp ( a m p e r e s , abs ( i1 ) , The C u r r e n t
r e s i s t o r on t h e 100V s i d e = )
disp ( a m p e r e s , abs ( i2 ) , The C u r r e n t
resistor =)
disp ( a m p e r e s , abs ( i3 ) , The C u r r e n t
r e s i s t o r (AE) = )
disp ( a m p e r e s , abs ( i4 ) , The C u r r e n t
r e s i s t o r (BE) = )
disp ( a m p e r e s , abs ( i5 ) , The C u r r e n t
r e s i s t o r on t h e 80V s i d e = )

t h r o u g h 20 ohm
t h r o u g h 15 ohm
t h r o u g h 10 ohm
t h r o u g h 10 ohm
t h r o u g h 10 ohm

Scilab code Exa 2.8 Conversion to current source and nodal analysis
1 // C o n v e r s i o n t o c u r r e n t s o u r c e and n o d a l a n a l y s i s
2
3 clc ;
4 clear ;
5
6 // Nodal E q u a t i o n s
7 // 1 . 5 Va0.5Vb+0Vc=5
8 // 0 . 5 Va1.5Vb+0.5 Vc=0
9 // 0Va0.5Vb+1Vc=0
10
11 Y =[1.5 -0.5 0;0.5 -1.5 0.5; 0 -0.5 1]; // A d m i t t a n c e

matrix
12 I =[5;0;0];
13 V = inv ( Y ) * I ;
14
15 Va = V (1) ;
16 Vb = V (2) ;
17 Vc = V (3) ;
18

70

19 Vab = Va - Vb ;
20
21 disp ( V ,Va , V o l t a g e a t node A = )
22 disp ( V ,Vb , V o l t a g e a t node B = )
23 disp ( V ,Vc , V o l t a g e a t node C = )
24
25 disp ( V ,Vab , The v o l t a g e a c r o s s AB i n t h e

circuit =
)
26 disp ( A , Vab /2 , The c u r r e n t i n b r a n c h AB i n t h e
circuit =)

Scilab code Exa 2.9 Superposition Principle to determine current in branch


1

// S u p e r p o s i t i o n P r i n c i p l e t o d e t e r m i n e c u r r e n t i n
branch

2
3 clc ;
4 clear ;
5
6 // Order o f
7
8
9
10
11
12
13
14
15
16

r e s i s t a n c e s from l e f t t o r i g h t i n t h e

circuit
r1 =2;
r2 =12;
r3 =1;
r4 =2;
r5 =3;
V1 =2;
V2 =4;

// We now s h o r t c i r c u i t by r e m o v i n g one s o u r c e and


c o n s i d e r the r e s t of the c i c u i t
17 // Hence we w i l l have two c a s e s
18
19

// Case 1 4V s u p p l y removed and s h o r t e d


71

20
21 // R e s i s t a n c e s b e t w e e n r e s p e c t i v e n o d e s .
22 rab1 =( r4 * r5 ) /( r4 + r5 ) ;
23 rac1 = rab1 + r3 ;
24 rcd1 =( rac1 * r2 ) /( rac1 + r2 ) ;
25
26 Reff1 = rcd1 + r1 ; // E f f e c t i v e r e s i s t a n c e i n c a s e 1
27
28 I1 = V1 / Reff1 ; // C u r r e n t from t h e 2V s o u r c e
29
30 Iac1 = I1 *( r2 /( r2 + rac1 ) ) ;
31 Iab1 = Iac1 *( r5 /( r5 + r4 ) ) ; // C u r r e n t i n AB from 2V

source
32
33 // Case 2 2V s u p p l y removed and s h o r t e d
34
35 // R e s i s t a n c e s b e t w e e n r e s p e c t i v e n o d e s .
36 rcd2 =( r1 * r2 ) /( r1 + r2 ) ;
37 rac2 = rcd2 + r3 ;
38 rab2 =( rac2 * r4 ) /( rac2 + r4 ) ;
39
40 Reff2 = rab2 + r5 ; // E f f e c t i v e r e s i s t a n c e i n c a s e 2
41
42 I2 = V2 / Reff2 ; // C u r r e n t from t h e 4V s o u r c e
43
44 Iab2 = I2 *( rac2 /( rac2 + r4 ) ) ; // C u r r e n t i n AB from 4V

source
45
46 Iab = Iab1 + Iab2 ; // Combined C u r r e n t i n AB from b o t h

the sources
47
48

disp ( a m p e r e s ,Iab , The C u r r e n t t h r o u g h AB ( 2 ohm


resistor ) =)

72

Scilab code Exa 2.10 Using thevenin theorem determine current through
2 ohm resistor
1

// U s i n g t h e v e n i n t h e o r e m d e t e r m i n e c u r r e n t t h r o u g h 2
ohm r e s i s t o r

2
3 clc ;
4 clear ;
5
6 // C h a r a c t e r i s t i c e q u a t i o n t o f i n d Vth
7 // 14 i 1 +12 i 2 = 2
8 // 12 i 1 +16 i 2 = 4
9
10 // R e s i s t o r s i n t h e c i r c u i t i n o r d e r from t h e 2V
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

side
R1 =2;
R2 =12;
R3 =1;
R4 =3;
// V o l t a g e S o u r c e s
V1 =2;
V2 =4;
Z =[14 12; 12 16]; // R e s i s t a n c e M a t r i x
V =[ V1 ; V2 ]; // V o l t a g e M a t r i x
I = inv ( Z ) * V ; // C u r r e n t M a t r i x
i1 = I (1) ;
i2 = I (2) ;
Vth = V2 -( i2 * R4 ) ;
Reff = R3 +(( R1 * R2 ) /( R1 + R2 ) ) ;
Zth = Reff * R4 /( Reff + R4 ) ;

73

34 Zl =2; // R e s i s t o r C o n n e c t e d b e t w e e n AB
35
36 Current = Vth /( Zth + Zl ) ; // C u r r e n t Through 2 ohm

resistor
37
38

printf ( The C u r r e n t t h r o u g h 2 ohm r e s i s t o r c o n n e c t e d


a c r o s s AB = %g A\n , Current )

Scilab code Exa 2.11 To find the current through the branch AB
1
2
3
4
5
6
7
8
9
10
11
12

//To f i n d t h e c u r r e n t t h r o u g h t h e b r a n c h AB
clc ;
clear ;
Zl =2; // R e s i s t o r A c r o s s AB
// V o l t a g e S o u r c e s
V1 =20;
V2 =10;
// R e s i s t a n c e s i n o r d e r a s s e e n from 20 V s i d e
e x c u l d i n g t h e r e s i s t a n c e b e t w e e n A and B
R1 =2;
R2 =2;
R3 =2;
R4 =4;
R5 =4;

13
14
15
16
17
18
19 // C h a r a c t e r i s t i c E q u a t i o n
20 // 10 i 1 4 i 2 =10
21 //4 i 1 +8 i 2 =10
22
23 Z =[10 -4; -4 8]; // R e s i s t a n c e M a t r i x
24 V =[10;10]; // E f f e c t i v e V o l t a g e s M a t r i x

74

25
26
27
28
29
30
31

I = inv ( Z ) * V ; // C u r r e n t M a t r i x
i1 = I (1) ;
i2 = I (2) ;
Vth = V1 -( i1 *( R1 + R2 ) ) ;

Reff = R4 * R5 /( R4 + R5 ) ; // E f f e c t i v e r e s i s t a n c e o f R4
and R5 ( P a r a l l e l )
32 Rt1 = Reff + R3 ; // E f f e c t i v e R e s i s t a n c e on r i g h t s i d e
o f AB
33 Rt2 = R1 + R2 ; // E f f e c t i v e R e s i s t a n c e on l e f t s i d e o f
AB
34 Zth = Rt1 * Rt2 /( Rt1 + Rt2 ) ;
35
36
37
38

Current = Vth /( Zl + Zth ) ; // C u r r e n t Through b r a n c h AB


printf ( The C u r r e n t t h r o u g h b r a n c h AB = %g A\n ,
Current )

Scilab code Exa 2.12 Determine current through various values of RL


1 // D e t e r m i n e c u r r e n t t h r o u g h v a r i o u s v a l u e s o f RL
2
3 clc ;
4 clear ;
5
6 Rl =[0 2 5]; // R e s i s t a n c e V e c t o r
7
8 // R e s i s t a n c e s o f t h e c i r c u i t i n o r d e r from t h e 40V

side .
9 R1 =4;
10 R2 =6;
11 R3 =5;
12
13

// V o l t a g e S o u r c e
75

14
15
16
17
18
19
20
21
22
23
24

V =40;
i = V /( R1 + R2 ) ;
Vth = i * R2 ;
Rth = R3 +( R1 * R2 /( R1 + R2 ) ) ;
Cur =( Rth + Rl ) / Vth ; // R e c i p r o c a l o f c u r r e n t
printf ( The C u r r e n t t h r o u g h t h e R e s i s t a n c e RL = %g ,
%g , %g ohm i s %g A, %g A, %g A r e s p e c t i v e l y \n ,
Rl (1) , Rl (2) , Rl (3) ,1/ Cur (1) ,1/ Cur (2) ,1/ Cur (3) )

Scilab code Exa 2.13 Current through AB using Nortons theorem


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// C u r r e n t t h r o u g h AB u s i n g N o r t o n s t h e o r e m
clc ;
clear ;
// R e s i t a n c e s i n o r d e r from t h e 2V s i d e
R1 =2;
R2 =12;
R3 =1;
R4 =3;
// V o l t a g e S o u r c e s
V1 =2;
V2 =4;
// U s i n g S u p e r p o s i t i o n p r i n c i p l e
Iab1 = V2 / R4 ;
I1 = V1 /( R1 +( R2 * R3 /( R2 + R3 ) ) ) ; // C u r r e n t drawn from 2V
supply
76

19 Iab2 = I1 * R2 /( R1 + R2 ) ;
20
21 Iab = Iab1 + Iab2 ; // C u r r e n t s o u r c e
22
23 Reff = R3 +(( R1 * R2 ) /( R1 + R2 ) ) ;
24
25 Zth = Reff * R4 /( Reff + R4 ) ;
26
27 Zl =2; // R e s i s t o r C o n n e c t e d b e t w e e n AB
28
29 Current = Iab *( Zth /( Zth +2) ) ; // C u r r e n t t h r o u g h b r a n c h

AB
30
31

// E r r o r l e s s C a l c u l a t i o n , I n t h e t e x t b o o k
a p p r o x i m a t i o n s a r e done
32 printf ( The C u r r e n t t h r o u g h 2 ohm r e s i s t o r i n b r a n c h
AB = %g A\n , Current )

Scilab code Exa 2.14 To determine current in RL using nortons theorem


1 //To d e t e r m i n e c u r r e n t i n RL u s i n g n o r t o n s t h e o r e m
2
3 clc ;
4 clear ;
5
6 // R e s i s t a n c e s o f t h e c i r c u i t i n o r d e r from t h e 40V

side .
7 R1 =4;
8 R2 =6;
9 R3 =5;
10
11 // V o l t a g e S o u r c e
12 V =40;
13
14 I = V /( R1 +( R2 * R3 /( R2 + R3 ) ) ) ;

77

15
16
17
18
19
20
21
22

Ieq = I *( R2 /( R2 + R3 ) ) ;
Rth = R3 +( R1 * R2 /( R1 + R2 ) ) ;
Rl =[0 2 5];
Req = Rth + Rl ; // Sum o f r e s i s t a n c e s o f Rth and e a c h o f
Rl

23
24 // C u r r e n t s f o r d i f f e r e n t v a l u e s o f Rl
25 I0 = Ieq * Rth / Req (1) ;
26 I2 = Ieq * Rth / Req (2) ;
27 I5 = Ieq * Rth / Req (3) ;
28
29 printf ( The C u r r e n t t h r o u g h t h e r e s i s t a n c e RL = %g

ohms i s %g A\n , Rl (1) , I0 )


printf ( The C u r r e n t t h r o u g h t h e r e s i s t a n c e RL = %g
ohms i s %g A\n , Rl (2) , I2 )
31 printf ( The C u r r e n t t h r o u g h t h e r e s i s t a n c e RL = %g
ohms i s %g A\n , Rl (3) , I5 )
30

Scilab code Exa 2.15 To find current across 2ohm resistor using nortons
theorem
1

// To f i n d c u r r e n t a c r o s s 2ohm r e s i s t o r u s i n g
n o r t o n s theorem

2
3 clc ;
4 clear ;
5
6 Zl =2; // R e s i s t o r A c r o s s AB
7
8 // V o l t a g e S o u r c e s
9 V1 =20;

78

10 V2 =10;
11
12 // R e s i s t a n c e s
13
14
15
16
17
18
19

i n o r d e r a s s e e n from 20 V s i d e
e x c u l d i n g t h e r e s i s t a n c e b e t w e e n A and B
R1 =2;
R2 =2;
R3 =2;
R4 =4;
R5 =4;

Reff = R4 * R5 /( R4 + R5 ) ; // E f f e c t i v e r e s i s t a n c e o f R4
and R5 ( P a r a l l e l )
20 Rt1 = Reff + R3 ; // E f f e c t i v e R e s i s t a n c e on r i g h t s i d e
o f AB
21 Rt2 = R1 + R2 ; // E f f e c t i v e R e s i s t a n c e on l e f t s i d e o f
AB
22 Zth = Rt1 * Rt2 /( Rt1 + Rt2 ) ;
23
24
25

// U s i n g s u p e r p o s t i o n t h e o r e m
Iab1 = V1 /( R1 + R2 ) ; // C u r r e n t s u p p l i e d t o AB from 20V
source
26 I1 = V2 /( R4 +( R3 * R5 /( R3 + R5 ) ) ) ; // C u r r e n t s u p p l i e d from
10V s o u r c e t o t h e n e t w o r k
27 Iab2 = I1 *( R5 /( R3 + R5 ) ) ; // C u r r e n t s u p p l i e d t o AB from
10V S o u r c e
28
29 Iab = Iab1 + Iab2 ; // C u r r e n t S o u r c e
30
31 I = Iab *( Zth /( Zth + Zl ) ) ;
32
33 printf ( The c u r r e n t t h r o u g h b r a n c h AB f l o w i n g

in the

2 ohm r e s i s t o r = %g A\n ,I )

Scilab code Exa 2.16 To determine the current in the 2 ohm resistor using
superposition theorem
79

// To d e t e r m i n e t h e c u r r e n t i n t h e 2 ohm r e s i s t o r
u s i n g s u p e r p o s i t i o n theorem

2
3 clc ;
4 clear ;
5
6 // V o l t a g e S o u r c e s
7 V1 =5;
8 V2 =10;
9
10 // S i n c e b o t h V o l t a g e s o u r c e s
11
12
13
14
15
16
17
18
19

are connected in

p a r a l l e l and a r e u n e q u a l
R1 = %inf ; // As s e e n by 5V S o u r c e
R2 = %inf ; // As s e e n by 10V S o u r c e
I1 = V1 / R1 ; // C u r r e n t Drawn from 5V s u p p l y
I2 = V2 / R2 ; // C u r r e n t Drawn from 10V s u p p l y
I = I1 + I2 ; // C u r r e n t t h r o u g h 2 ohms r e s i s t o r
printf ( The C u r r e n t f l o w i n g i n t h e 2 ohm r e s i s t o r =
%g A\n ,I )

Scilab code Exa 2.17 To determine the value of RL for Max power transfer
1

//To d e t e r m i n e t h e v a l u e o f RL f o r Max power


transfer

2
3 clc ;
4 clear ;
5
6 Vs =10/ sqrt (2) ; // RMS V a l u e o f V o l t a g e
7
8 // R e s i s t a n c e s o f t h e c i r c u i t from t h e S o u r c e s i d e

80

9
10
11
12
13
14
15
16
17
18
19
20

R1 =10;
R2 =15;
R3 =20;
R4 =5;
R5 =10;
Ref1 = R3 +( R1 * R2 /( R1 + R2 ) ) ;
Ref2 = R5 +( Ref1 * R4 /( Ref1 + R4 ) ) ;
Rab = Ref2 ;

// C h a r a c t e r i s t i c Loop E q u a t i o n o f t h e f i r s t two
loops for current flowing in clockwise direction
21 // 25 i 1 15 i 2 = 1 0 / ( 2 0 . 5 )
22 // 15 i 1 +40 i 2 = 0
23
24
25
26
27
28
29
30
31
32
33
34

Z =[10 25; -15 40];


V =[ Vs ;0];
I = inv ( Z ) * V ;
i1 = I (1) ;
i2 = I (2) ;
Vth = i2 * R4 ;
Powtrns =( Vth ^2) /(4* Rab ) ;

printf ( The v a l u e o f r e s i s t a n c e RL f o r maximum power


t r a n s f e r = %g ohms \n , Rab )
35 printf ( The v a l u e o f power t r a n s f e r e d = %g mW\n ,
Powtrns *1000)

Scilab code Exa 2.18 Star to delta conversion of a cicuit


1
2

// S t a r t o d e l t a c o n v e r s i o n o f a c i c u i t

81

3
4
5
6
7
8
9
10
11
12
13
14
15

clc ;
clear ;
Zp =5;
Zq =10;
Zr = %i *10;
Zpq =(( Zp * Zq ) +( Zq * Zr ) +( Zr * Zp ) ) / Zr ;
Zqr =(( Zp * Zq ) +( Zq * Zr ) +( Zr * Zp ) ) / Zp ;
Zrp =(( Zp * Zq ) +( Zq * Zr ) +( Zr * Zp ) ) / Zq ;

printf (
printf (
))
16 printf (
))
17 printf (
))

D e l t a E q u i v a l e n t : \n )
Zpq = %g + j (%g) ohm \n , real ( Zpq ) , imag ( Zpq
Zqr = %g + j (%g) ohm \n , real ( Zqr ) , imag ( Zqr
Zrp = %g + j (%g) ohm \n , real ( Zrp ) , imag ( Zrp

Scilab code Exa 2.19 Star Equivalent of the delta circuit


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// S t a r E q u i v a l e n t o f t h e d e l t a c i r c u i t
clc ;
clear ;
Z12 = %i *5;
Z23 = %i * -5;
Z31 = %i *5;
Z1 =( Z12 * Z31 ) /( Z12 + Z23 + Z31 ) ;
Z2 =( Z12 * Z23 ) /( Z12 + Z23 + Z31 ) ;
Z3 =( Z23 * Z31 ) /( Z12 + Z23 + Z31 ) ;
printf ( S t a r E q u i v a l e n t : \ n )
82

15
16
17

disp ( ohms ,Z1 , Z1 = )


disp ( ohms ,Z2 , Z2 = )
disp ( ohms ,Z3 , Z3 = )

Scilab code Exa 2.20 To determine equivalent resistance using star delta
transformation
1
2
3
4
5
6
7
8
9
10
11
12

//To d e t e r m i n e e q u i v a l e n t r e s i s t a n c e u s i n g s t a r
delta transformation
clc ;
clear ;
Rax =30;
Rcx =30;
Rac =30;
Ray =30;
Rcy =30;

// D e l t a t o s t a r c o n v e r s i o n o f t h e t r i a n g l e CAX i n
the c i r c u i t
13 Rx = Rax * Rcx /( Rax + Rcx + Rac ) ;
14 Ra = Rax * Rac /( Rax + Rcx + Rac ) ;
15 Rc = Rac * Rcx /( Rax + Rcx + Rac ) ;
16
17 R1 = Ra + Ray ; // R e s i s t a n c e from t h e common t o Y o f t h e

upper limb
18 R2 = Rc + Rcy ; // R e s i s t a n c e from t h e common t o Y o f t h e
lower limb
19
20

Reff = R1 * R2 /( R1 + R2 ) ; // E f f e c t i v e r e s i s t a n c e o f b o t h
the limbs

21
22 Rxy = Rx + Reff ; // E f f e c t i v e
23

r e s i s t a n c e a c r o s s X and Y

83

24

printf ( The E q u i v a l e n t r e s i s t a n c e = %g ohms \n , Rxy )

Scilab code Exa 2.21 Determine current through branch AB using loop
and nodal analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// D e t e r m i n e c u r r e n t t h r o u g h b r a n c h AB u s i n g l o o p
and n o d a l a n a l y s i s
clc ;
clear ;
Is =4; // C u r r e n t S o u r c e
// R e s i s t a n c e s
Rab =2;
R1 =4; // A f t e r p o i n t B t o w a r d s t h e r i g h t
R2 =1;
V =10; // V o l t a g e s o u r c e

// U s i n g S i m p l e L o g i c
i1 = Is ; // C u r r e n t s o u r c e c o n n e c t e d i n s e r i e s w i t h
resistor
16 i2 =10/( R1 + R2 ) ;

17
18
19
20
21
22
23

printf ( The C u r r e n t t h r o u g h b r a n c h AB : \n )
printf ( i ) S i m p l e L o g i c = %g A\n , i1 )
// U s i n g Loop A n a l y s i s
// C o n v e r s i o n o f C u r r e n t s o u r c e i n t o v o l t a g e s o u r c e ,
R tends to i n f i n i t y

24
25 R = poly (0 , R ) ;
26
27 Rmat =[ R +2 0; 0

5];
84

28 Vmat =[(4* R ) -V ; V ];
29 Imat = inv ( Rmat ) * Vmat ;
30 printf ( \ n i i ) Loop A n a l y s i s \n )
31 disp ( Imat (1 ,1) , The c u r r e n t t h r o u g h AB i s )
32 printf ( \ nWhere R t e n d s t o i n f i n i t y \n )
33
34 R = %inf ;
35 i1 =(4 -( V / R ) ) /(1+( Rab / R ) ) ;
36 printf ( \n = %g A\n , i1 )
37
38 // U s i n g Nodal A n a l y s i s
39 // C o n v e r s i o n o f v o l t a g e s o u r c e i n t o c u r r e n t s o u r c e ,

R then tends to zero


40
41 R = poly (0 , R ) ;
42
43 // Nodal E q a u t i o n
44 // 0 . 5 V10.5V2+0V3 = 4
45 // 0.5V1 + ( 0 . 7 5 + ( 1 /R) ) V2 0.25V3 = 10/R
46 // 0V1 0.25V2 +1.25 V3=0
47
48 Y =[0.5 -0.5 0; -0.5 (0.75+(1/ R ) ) -0.25;0 -0.25 1.25];

// A d m i t t a n c e M a t r i x
Im =[4; (10/ R ) ; 0] ; // C u r r e n t M a t r i x
Vm = inv ( Y ) * Im ; // V o l t a g e M a t r i x
V1 = Vm (1 ,1) ;
V2 = Vm (2 ,1) ;
V3 = Vm (3 ,1) ;

49
50
51
52
53
54
55 DiffV = V1 - V2 ;
56
57 printf ( \ n i i i ) Nodal A n a l y s i s : \ n )
58 disp ( V2 , V2 : ,V1 , V1 : )
59 Vdiff = roots ( DiffV (2) -R ) ; // To c h a n g e d a t a t y p e
60 disp ( DiffV , V1V2 : )
61 In = Vdiff / Rab ; // C u r r e n t due t o n o d a l a n a l y s i s
62
63 printf ( \n The C u r r e n t Through 2 ohm r e s i s t o r = %g A

85

\n , In )

Scilab code Exa 2.22 Current through 2 ohm resistor given a current source
1
2
3
4
5
6
7
8
9
10
11
12

// C u r r e n t t h r o u g h 2 ohm r e s i s t o r g i v e n a c u r r e n t
source
clc ;
clear ;
Is =2; // C u r r e n t S o u r c e
// R e s i s t o r s c o n n e c t e d d i r e c t l y t o t h e c u r r e n t s o u r c e
Rs1 =0.5;
Rs2 =0.5;

// R e s i s t o r s i n v a r i o u s b r a n c h e s s t a r t i n g from t h e
top
13 R1 =1;
14 R2 =1;
15 R3 =2;
16
17 // C o n v e r s i o n t o v o l t a g e s o u r c e s
18 V1 = Rs1 * Is ; // V o l t a g e a c r o s s f i r s t

h a l f of the
branch
19 V2 = Rs2 * Is ; // V o l t a g e a c r o s s s e c o n d h a l f o f t h e
branch
20
21 // V o l t a g e s o u r c e s i n t h e c i r c u i t
22 V3 =1;
23 V4 =2;
24
25 // C h a r a c t e r i s t i c E q u a t i o n s
26 // 2 . 5 i 1 1 i 2 = 2
27 //1 i 1 +3.5 i 2 = 2

86

28
29
30
31
32
33
34
35

R =[2.5 -1; -1 3.5]; // R e s i s t o r V e c t o r


V =[( V1 + V3 ) ;( V2 + V4 - V3 ) ]; // V o l t a g e V e c t o r
I = inv ( R ) * V ; // C u r r e n t V e c t o r
i1 = I (1) ;
i2 = I (2) ;
printf ( The C u r r e n t t h r o u g h t h e 2 ohm r e s i s t o r = %g
A\n , i2 )

Scilab code Exa 2.23 To find voltage v and current through 3 ohm resistor
using nodal analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

//To f i n d v o l t a g e v and c u r r e n t t h r o u g h 3 ohm


r e s i s t o r using nodal a n a l y s i s
clc ;
clear ;
V = poly (0 , V ) ;
Va =8 - V ;
Vb = -6;
// R e s i s t o r s i n o r d e r from t h e 8V s i d e
R1 =1;
R2 =2;
R3 =3;
R4 =4;
// Nodal A n a l y s i s
X =((8 - Va ) / R1 ) +(( Vb - Va ) / R3 ) -(( Va -(4* V ) ) / R2 ) ; //
C h a r a c t e r i s t i c equation to f i n d V

20

87

21 V = roots ( X ) ;
22
23 Va =8 - V ;
24
25 I =( Vb - Va ) /3;
26
27 printf ( i ) The V o l t a g e V ( a c r o s s 1 ohm r e s i s t o r )

is

%g V\n ,V )
28
29 if ( imag ( sqrt ( I ) ) ) // C o n d i t i o n t o c h e c k f o r
30

negative

sign
printf ( i i ) The C u r r e n t t h r o u g h 3 ohm r e s i s t o r
i s %g A f l o w i n g from A t o B\n , abs ( I ) )

31
32

else
printf ( i i ) The C u r r e n t t h r o u g h 3 ohm r e s i s t o r
A f l o w i n g from B t o A\n , abs ( I ) )
33 end

i s %g

Scilab code Exa 2.24 Determine the current through 10 ohm resistor using thevenins circuit
1
2
3
4
5
6
7
8
9
10
11
12
13

// D e t e r m i n e t h e c u r r e n t t h r o u g h 10 ohm r e s i s t o r
using thevenins c i r c u i t
clc ;
clear ;
// S o u r c e V o l t a g e s
V1 =10;
V2 =2;
// R e s i s t a n c e s o f u p p e r l i m b
R1 =15;
R2 =25;

88

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

// R e s i s t a n c e s o f l o w e r l i m b
R3 =30;
R4 =20;
// For a t h e v e n i n c i r c u i t
i1 =( V1 - V2 ) /( R1 + R2 ) ; // C u r r e n t i n u p p e r l i m b
i2 = V1 /( R3 + R4 ) ; // C u r r e n t i n l o w e r l i m b
Vac =( i1 * R2 ) +2;
Vbc =( i2 * R4 ) ;
Vab = Vac - Vbc ; // T h e v e n i n V o l t a g e
Vth = Vab ;
Zl =10; // Load r e s i s t a n c e
Reff1 =( R1 * R2 /( R2 + R1 ) ) ;
Reff2 =( R3 * R4 /( R3 + R4 ) ) ;
Zth = Reff1 + Reff2 ;
I = Vth /( Zl + Zth ) ; // C u r e n t t h r o u g h AB
printf ( The c u r r e n t t h r o u g h t h e 10 ohm r e s i s t o r = %g
mA\n ,I *1000)

89

Chapter 3
Three Phase Supply

Scilab code Exa 3.1 To determine the parameters of a balanced 3 phase


star connected to a resistive load
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// To d e t e r m i n e t h e p a r a m e t e r s o f a b a l a n c e d 3 p h a s e
s t a r connected to a r e s i s t i v e load
clc ;
clear ;
V =208;
Vph = V / sqrt (3) ;
R =35;
// S t a r C o n n c e c t e d l o a d h a s i t s
current
Ia = Vph / R ;
Ib = Ia *( expm ( %i *( -2* %pi /3) ) ) ;
Ic = Ia *( expm ( %i *(2* %pi /3) ) ) ;
Pperphase = ( abs ( Ia ) ^2) * R ;
Pt =3* Pperphase ;
90

l i n e c u r r e n t = phase

19
20 // R e s i s t i v e Load , p . f i s u n i t y
21
22 pf =1;
23
24 printf ( The power f a c t o r i s %g \n , pf )
25 printf ( The t o t a l power d i s s i p a t e d = %g W \n , Pt )
26 printf ( The c u r r e n t s o f t h e s y s t e m a r e \n I a = %g / 0

A \n I b = %g / 120 A \n I c = %g / 1 2 0 A \n , abs
( Ia ) , abs ( Ib ) , abs ( Ic ) )

Scilab code Exa 3.2 To determine the parameters of a balanced 3 phase


star connected to an impedance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// To d e t e r m i n e t h e p a r a m e t e r s o f a b a l a n c e d 3 p h a s e
s t a r c o n n e c t e d t o an i m p e d a n c e
clc ;
clear ;
V =208;
Vph = V / sqrt (3) ;
Z =15+( %i *20) ;
// S t a r C o n n c e c t e d l o a d h a s i t s
current
Ia = Vph / Z ;
Ib = Ia *( expm ( %i *( -2* %pi /3) ) ) ;
Ic = Ia *( expm ( %i *(2* %pi /3) ) ) ;
Pperphase = ( abs ( Ia ) ^2) * real ( Z ) ;
Pt =3* Pperphase ;

91

l i n e c u r r e n t = phase

20 Atheta = atand ( imag ( Ia ) / real ( Ia ) ) ;


21 Btheta = atand ( imag ( Ib ) / real ( Ib ) ) ;
22 Ctheta = atand ( imag ( Ic ) / real ( Ic ) ) ;
23
24 pf = cosd ( Atheta ) ;
25
26 printf ( The power f a c t o r i s %g l a g g i n g \n , pf )
27 printf ( The t o t a l power d i s s i p a t e d = %g W \n , Pt )
28 printf ( The c u r r e n t s o f t h e s y s t e m a r e \n )
29 printf ( I a= %g / %g A \n , abs ( Ia ) , Atheta )
30 printf ( I b= %g / %g A \n , abs ( Ib ) , Btheta -180)
31 printf ( I c= %g / %g A \n , abs ( Ic ) , Ctheta )

Scilab code Exa 3.3 To determine the potential of the star point and line
currents
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

//To d e t e r m i n e t h e p o t e n t i a l o f t h e s t a r p o i n t and
line currents
clc ;
clear ;
Zr =10*( expm ( %i * %pi /6) ) ;
Zy =12*( expm ( %i * %pi /4) ) ;
Zb =15*( expm ( %i *2* %pi /9) ) ;
V =440;
Vph = V /( sqrt (3) ) ;
// Phase V o l t a g e s
Vr = Vph *( expm ( %i *0) ) ;
Vy = Vph *( expm ( %i * -2* %pi /3) ) ;
Vb = Vph *( expm ( %i *2* %pi /3) ) ;
Vs =(( Vr / Zr ) +( Vy / Zy ) +( Vb / Zb ) ) /((1/ Zr ) +(1/ Zy ) +(1/ Zb ) ) ;
92

19
20 tvs = atand ( imag ( Vs ) / real ( Vs ) ) ; // Phase A n g l e o f t h e

star point voltage


21
22 Ia =( Vr - Vs ) / Zr ;
23 iat = atand ( imag ( Ia ) / real ( Ia ) ) ; // A n g l e o f

current in

phase R
24 Ib =( Vy - Vs ) / Zy ;
25 ibt = atand ( imag ( Ib ) / real ( Ib ) ) ; // A n g l e o f

current in
phase Y
26 Ic =( Vb - Vs ) / Zb ;
27 ict = atand ( imag ( Ic ) / real ( Ic ) ) ; // A n g l e o f c u r r e n t i n
phase B
28
29 I = Ia + Ib + Ic ;
30 I = ceil ( real ( I ) *1000) + %i *( ceil ( imag ( I ) *1000) ) ;
31
32 printf ( The p o t e n t i a l o f t h e s t a r p o i n t = %g / %g V
33
34
35
36

\n , abs ( Vs ) , tvs )
printf ( The l i n e c u r r e n t s
printf ( R p h a s e c u r r e n t =
printf ( Y p h a s e c u r r e n t =
-180)
printf ( B p h a s e c u r r e n t =

a r e : \n )
%g / %g A \n , abs ( Ia ) , iat )
%g / %g A \n , abs ( Ib ) ,ibt
%g / %g A \n , abs ( Ic ) , ict )

Scilab code Exa 3.4 To determine the line currents if one inductor is short
circuited
1

//To d e t e r m i n e t h e l i n e c u r r e n t s
short circuited

2
3 clc ;
4 clear ;
5
6 V =460; // L i n e t o L i n e v o l t a g e

93

i f one i n d u c t o r i s

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

pf =0.8; // Power F a c t o r
P =8*(10^3) ; // Power Consumed by t h e n e t w o r k
Vph = V / sqrt (3) ;
Iph = P /( sqrt (3) * V * pf ) ;
theta = acos ( pf ) ; // Power f a c t o r a n g l e
Z =( Vph / Iph ) *( expm ( %i * theta ) ) ;
Va = V * expm ( %i *0) ; // V o l t a g e o f Phase A
Vc = V * expm ( %i * -2* %pi /3) ; // V o l t a g e o f Phase C
Ia = Va / Z ; // C u r r e n t i n p h a s e A
Ic = Vc / Z ; // C u r r e n t i n p h a s e C
iat = atand ( imag ( Ia ) / real ( Ia ) ) ; // Phase a n g l e o f I a
ict = atand ( imag ( Ic ) / real ( Ic ) ) ; // Phase a n g l e o f I c
tac = iat - ict ; // A n g l e b e t w e e n c u r r e n t I a and I c
Ib = sqrt (( abs ( Ia ) ^2) +( abs ( Ic ) ^2) +(2* abs ( Ia ) * abs ( Ic ) *
cosd ( tac ) ) ) ;
printf ( The l i n e c u r r e n t s a r e : \n )
printf ( Phase a = %g/ %g A \n , abs ( Ia ) , iat )
printf ( Phase b = %g A \n , abs ( Ib ) )
printf ( Phase c = %g/ %g A \n , abs ( Ic ) , ict )

Scilab code Exa 3.5 To find line current and pf and powers of a balanced
delta load
1

//To f i n d l i n e c u r r e n t and p f and p o w e r s o f a


balanced delta load

94

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

clc ;
clear ;
Z =8+6* %i ; // Load
V =230; // V o l t a g e s u p p l y
iR = V / Z ;
theta = atand ( imag ( iR ) / real ( iR ) ) ;
Il = iR * sqrt (3) ; // L i n e c u r r e n t
Pa = sqrt (3) * V * abs ( Il ) * cosd ( theta ) ; // A c t i v e Power
Pr = sqrt (3) * V * abs ( Il ) * sind ( theta ) ; // R e a c t i v e Power
Pt = sqrt (3) * V * abs ( Il ) ; // T o t a l V o l t a m p e r e s

printf ( The
printf ( The
))
21 printf ( The
22 printf ( The
/1000)
23 printf ( The
/1000)

l i n e c u r r e n t = %g A \n , abs ( Il ) )
power f a c t o r = %g l a g g i n g \n , cosd ( theta
A c t i v e Power = %g kW \n , abs ( Pa ) /1000)
R e a c t i v e Power = %g kV Ar \n , abs ( Pr )
t o t a l v o l t a m p e r e s = %g kVA \n , abs ( Pt )

Scilab code Exa 3.6 To find Line currents and star connected resistors for
the same power
1

//To f i n d L i n e c u r r e n t s and s t a r c o n n e c t e d r e s i s t o r s
f o r t h e same power

2
3 clc ;
4 clear ;
5
6 // Phase V o l t a g e s

95

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

Vr =400*( expm ( %i *0) ) ;


Vy =400*( expm ( %i * -2* %pi /3) ) ;
Vb =400*( expm ( %i *2* %pi /3) ) ;
Zry =100; // Impedance b e t w e e n Phase R and Phase Y
Zyb = %i *100; // Impedance b e t w e e n Phase Y and Phase B
Zbr = - %i *100; // Impedance b e t w e e n Phase B and Phase R
Iry = Vr / Zry ;
Iyb = Vy / Zyb ;
Ibr = Vb / Zbr ;
Ir = Iry - Ibr ;
Iy = Iyb - Iry ;
Ib = Ibr - Iyb ;
// Phase a n g l e s o f t h e l i n e c u r r e n t s i n RYB s e q u e n c e
tr = atand ( imag ( Ir ) / real ( Ir ) ) ;
if ( real ( Iy ) ==0)
ty = atand (( imag ( Iy ) / abs ( imag ( Iy ) ) ) * %inf ) ;
else
ty = atand ( imag ( Iy ) / real ( Iy ) ) ;
end
if ( real ( Ib ) ==0)
tb = atand (( imag ( Ib ) / abs ( imag ( Ib ) ) ) * %inf ) ;
else
tb = atand ( imag ( Ib ) / real ( Ib ) ) ;
end
P =( Iry ^2) * Zry ; // Power consumed by t h e c i r c u i t (
Arm RY)

38
39 Vph = Vr / sqrt (3) ; // Phase v o l t a g e

system
40
41 R = poly ([0 1] , R , c ) ;
42

96

in a star connected

43 x =(3*( Vph ^2) ) -( P * R ) ; // C h a r a c t e r i s t i c E q a u t i o n t o

find R
44
45 R = roots ( x ) ;
46
47 printf ( a ) The l i n e
48
49
50
51
52

c u r r e n t s i n RYB s e q u e n c e a r e : \

n )
printf ( R l i n e = %g/ %g A \n , abs ( Ir ) , tr ) ;
printf ( Y l i n e = %g/ %g A \n , abs ( Iy ) , ty ) ;
// E r r o r i n t e x t book a n s w e r
printf ( B l i n e = %g/ %g A \n \n , abs ( Ib ) , tb ) ;
printf ( b ) The v a l u e o f r e s i s t o r s t o draw same power
a s i n p r o b l e m s t a t e m e n t a ) = %g ohms \n ,R (1) )

Scilab code Exa 3.7 Reduction in load when one resistor is removed
1 // R e d u c t i o n i n l o a d when one r e s i s t o r i s removed
2
3 clc ;
4 clear ;
5
6 // Assuming t h e v a r i a b l e s t o be e q a u l t o u n i t

quantities
7
8
9
10
11
12
13
14
15
16

Vph =1;
Vl = sqrt (3) * Vph ;
R =1;
// S t a r c o n n e c t e d
Pis =3*( Vph ^2) / R ; // I n i t i a l Power
Pfs =( Vl ^2) /(2* R ) ; // Power when one r e s i t o r
removed

17

97

is

18

pers =( Pis - Pfs ) *100/ Pis ; // P e r c e n t a g e d e c r e a s e i n


Load

19
20 // Mesh c o n n e c t e d
21
22 Pim =3*( Vl ^2) / R ; // I n i t i a l Power
23
24 Pfm =2*( Vl ^2) / R ; // Power when one r e s i t o r i s removed
25
26 perm =( Pim - Pfm ) *100/ Pim ; // P e r c e n t a g e d e c r e a s e i n

Load
27
28
29
30

printf ( Vl= s q u a r e r o o t ( 3 ) Vph \n \n )


printf ( a ) S t a r C o n n e c t e d Power = 3 ( Vph 2 ) /R \n )
printf (
When one r e s i s t o r i s removed Power = ( Vl
2 ) /2R \n )
31 printf (
The p e r c e n t a g e r e d u c t i o n i n l o a d = %g \n
\n , pers )
32
33
34

printf ( b ) Mesh C o n n e c t e d Power = 3 ( Vl 2 ) /R \n )


printf (
When one r e s i t o r i s removed , Power = 2 (
Vl 2 ) /R \n )
35 printf (
The p e r c e n t a g e r e d u c t i o n i n l o a d = %g \n
, perm )

Scilab code Exa 3.8 To measure power by two wattmeter method


1 //To m e a s u r e power by two w a t t m e t e r method
2
3 clc ;
4 clear ;
5
6 pf =0.85 // Power F a c t o r
7
8 Po =37.3*(10^3) ; // Power Output

98

9
10
11
12
13
14
15
16
17
18
19

eff =90/100; // E f f i c i e n c y
V =500; // Rated V o l t a g e
Pi = Po / eff ; // Power I n p u t
phi = acosd ( pf ) ; // Power F a c t o r a n g l e
printf ( W1 + W2 = %g kW \n , Pi /1000)
printf ( t a n ( p h i ) = s q u a r e r o o t ( 3 ) (W2W1) / (W2+W1) =
%g \n , tand ( phi ) )

20
21 x = Pi ; // L e t x = W1+W2
22
23 y = tand ( phi ) * x /( sqrt (3) ) ; // L e t y = W2W1
24
25 printf ( W1 + W2 = %g kW \n ,x /1000)
26 printf ( W2 W1 = %g kW \n ,y /1000)
27 printf ( W2 = %g kW \n ,( x + y ) /(2*1000) )
28 printf ( W1 = %g kW \n ,(x - y ) /(2*1000) )

Scilab code Exa 3.9 To find power using two wattmeter method of a circuit with non reactive resistances
1

//To f i n d power u s i n g two w a t t m e t e r method o f a


c i r c u i t w i t h non r e a c t i v e r e s i s t a n c e s

2
3 clc ;
4 clear ;
5
6 V =400; // L i n e V o l t a g e
7 Vph = V /( sqrt (3) ) ; // Magnitude o f Phase V o l t a g e
8
9 // Phase V o l t a g e i n RYB s e q u n c e

99

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

Vr = Vph *( expm ( %i *0) ) ;


Vy = Vph *( expm ( %i * -2* %pi /3) ) ;
Vb = Vph *( expm ( %i *2* %pi /3) ) ;
// R e s i t a n c e s o f t h e RYB l i m b s
Rr =10;
Ry =15;
Rb =20;
// Taking Vr a s r e f e r e n c e
// M i l l a i n s Theorem
Vs = (( Vr / Rr ) +( Vy / Ry ) +( Vb / Rb ) ) /((1/ Rr ) +(1/ Ry ) +(1/ Rb ) )
; // S t a r p o i n t v o l t a g e
// L i n e C u r r e n t s i n RYB s e q u e n c e
Ir = ( Vr - Vs ) / Rr ;
Iy = ( Vy - Vs ) / Ry ;
Ib = ( Vb - Vs ) / Rb ;
Vry = Vr - Vy ;
Vby = Vb - Vy ;
W1 = real ( Vry * conj ( Ir ) ) ;
W2 = real ( Vby * conj ( Ib ) ) ;
Wt = W1 + W2 ; // T o t a l Power
// Note I y i n t h e t e x t book t h e r e i s a e r r o r i n t h e
s i g n o f t h e r e a l p a r t o f Vy
printf ( The l i n e c u r r e n t s i n RYB s e q u e n c e a r e : \n )
disp ( Ir , R l i n e : )
printf ( Magnitude = %g A \n , abs ( Ir ) )
disp ( Iy , Y l i n e : )
printf ( Magnitude = %g A\n , abs ( Iy ) )
disp ( Ib , B l i n e : )
printf ( Magnitude = %g A\n \n , abs ( Ib ) )
100

46
47
48

printf ( T o t a l Power = %g kW \n \n , Wt /1000)


printf ( W1 = %g kW\n , W1 /1000)
printf ( W2 = %g kW\n , W2 /1000)

Scilab code Exa 3.10 Two wattmeter power dertermination for a delta
system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// Two w a t t m e t e r power d e r t e r m i n a t i o n f o r a d e l t a
system
clc ;
clear ;
V =250; // Phase V o l t a g e
// Phase V o l t a g e i n RYB s e q u n c e
Vry = V *( expm ( %i *0) ) ;
Vyb = V *( expm ( %i * -2* %pi /3) ) ;
Vbr = V *( expm ( %i *2* %pi /3) ) ;
// R e s i t a n c e s o f t h e RYB l i m b s
Rry =10+ %i *10;
Ryb =20 - %i *15;
Rbr =10+ %i *20;
// Phase C u r r e n t s i n RYB
Iry = Vry / Rry ;
Iyb = Vyb / Ryb ;
Ibr = Vbr / Rbr ;
// Phase C u r r e n t A n g l e s wrt t o Vr
ary = atand ( imag ( Iry ) / real ( Iry ) ) ;
ayb = atand ( imag ( Iyb ) / real ( Iyb ) ) ;
101

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

abr = atand ( imag ( Ibr ) / real ( Ibr ) ) ;


// L i n e C u r r e n t s i n RYB
Ir = Iry - Ibr ;
Iy = Iyb - Iry ;
Ib = Ibr - Iyb ;
W1 = real ( - Vbr * conj ( Ir ) ) ;
W2 = real ( Vyb * conj ( Iy ) ) ;
Wt = W1 + W2 ; // T o t a l Power
printf ( i ) \n )
printf ( The C u r r e n t s i n
printf ( Branch RY = %g/
printf ( Branch YB = %g/
printf ( Branch BR = %g/

each
%g A
%g A
%g A

b r a n c h a r e : \n )
\n , abs ( Iry ) , ary )
\n , abs ( Iyb ) , ayb )
\n , abs ( Ibr ) , abr )

printf ( i i ) \n )
printf ( The l i n e c u r r e n t s i n RYB s e q u e n c e a r e : \n )
disp ( Ir , R l i n e : )
printf ( Magnitude = %g A \n , abs ( Ir ) )
disp ( Iy , Y l i n e : )
printf ( Magnitude = %g A\n , abs ( Iy ) )
disp ( Ib , B l i n e : )
printf ( Magnitude = %g A\n \n , abs ( Ib ) )

// P r e c i s i o n i s more , The Text book i n c l u d e s round


off error
56 printf ( W1 = %g W\n , W1 )
57 printf ( W2 = %g W\n , W2 )

102

Chapter 4
Basic Instruments

Scilab code Exa 4.1 Torque on the coil at a current of 1mA


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Torque on t h e c o i l a t a c u r r e n t o f 1mA
clc ;
clear ;
N =60;
B =50*(10^ -3) ;
I =1*(10^ -3) ;
l =3*(10^ -2) ;
// w= 2 r ; w i s t h e w i d t h
w =2*(10^ -2) ;
Td = N * B * I * l * w ;
printf ( The t o r q u e on t h e c o i l c a r r y i n g 1mA = %g
m i c r o Nm \n , Td *(10^6) )

103

Scilab code Exa 4.2 To find the deflection produced by 200V


1
2
3
4
5
6
7
8
9
10

//To f i n d t h e d e f l e c t i o n p r o d u c e d by 200V
clc ;
clear ;

R =10*(10^3) ;
V =200;
B =80*(10^ -3) ;
N =100;
A =9*(10^ -4) ; // The a r e a o f t h e c o i l
o f t h e l e n g t h and w i d t h ( l . 2 r )
11 I = V / R ;
12
13 Td = N * B * I * A ;
14
15 K =30*(10^ -7) ;
16
17 theta = Td / K ;
18
19 printf ( The d e f l e c t i o n

i s the product

p r o d u c e d by 200V = %g d e g r e e s

\n , theta )

Scilab code Exa 4.3 Reading on ammeters when their shunts are interchanged
1

// R e a d i n g on ammeters when t h e i r s h u n t s a r e
interchanged

2
3 clc ;
4 clear ;
5
6 I =10;
7 Ra =1000;

104

8
9
10
11
12
13
14
15
16
17
18
19
20
21

Rsa =0.02;
Rb =1500;
Rsb =0.01;
deff ( x=c u r ( y , z ) , x=I z / y )
Ia1 = cur ( Ra , Rsa ) ; // I n i t i a l C u r r e n t i n m e t e r A
Ia2 = cur ( Ra , Rsb ) ; // Changed C u r r e n t i n m e t e r A
Ib1 = cur ( Rb , Rsb ) ; // I n i t i a l C u r r e n t i n m e t e r B
Ib2 = cur ( Rb , Rsa ) ; // Changed C u r r e n t i n m e t e r B
// F a c t o r by which t h e c u r r e n t r e a d i n g s c h a n g e i n t h e
two ammeters

22
23 A = Ia2 / Ia1 ; // Ammeter A
24 B = Ib2 / Ib1 ; // Ammeter A
25
26 printf ( The i n i t i a l c u r r e n t i n ammeter A and ammeter

B a r e %g A and %g A r e s p e c t i v e l y . \n \n ,I , I )
27
28

printf ( The c u r r e n t i n ammeter A and ammeter B when


t h e s h u n t r e s i s t a n c e s a r e i n t e r c h a n g e d a r e %g A
and %g A r e s p e c t i v e l y . \n \n ,I *A , I * B )

Scilab code Exa 4.4 To create an instrument that measures voltages and
currents upto a rated value
1

//To c r e a t e an i n s t r u m e n t t h a t m e a s u r e s v o l t a g e s and
c u r r e n t s upto a r a t e d v a l u e

2
3 clc ;
4 clear ;
5

105

6
7
8
9
10
11

Rm =10;
Im =50*(10^ -3) ;
V =750;
I =100;
//To C a l c u l a t e t h e r e q u i r e d v o l t a g e a r e s i s t o r
s h o u l d be added i n s e r i e s w i t h t h e i n t e r n a l
resistance

12
13 R = poly ([0 1] , R , c ) ;
14
15 sr = Im *( R + Rm ) -V ;
16
17 R = roots ( sr ) ; // C h a r a c t e r i s t i c e q u a t i o n t o f i n d R
18
19 // To a t t a i n t h e r e q u i r e d c u r r e n t , a r e s i s t o r s h o u l d

be added i n p a r a l l e l t o t h e i n t e r n a l r e s i s t a n c e
20
21 r = poly ([0 1] , r , c ) ; // C h a r a c t e r i s t i c

equation to

find r
22
23 pr = Im *( r + Rm ) -( I * r ) ;
24
25 r = roots ( pr ) ;
26
27 printf ( To Read 750 V a s e r i e s

r e s i t a n c e o f %g ohms
s h o u l d be c o n n e c t e d t o t h e i n s t r u m e n t \n ,R )
28 printf ( To Read 100 A a p a r a l l e l r e s i t a n c e o f %g
m i l l i ohms s h o u l d be c o n n e c t e d t o t h e i n s t r u m e n t
\n ,r *1000)

Scilab code Exa 4.5 To determine the range and current and deflection at
various conditions
1

//To d e t e r m i n e t h e r a n g e and c u r r e n t and d e f l e c t i o n


106

at various c o n d i t i o n s
2
3
4
5
6
7
8
9
10
11
12
13
14

clc ;
clear ;
I =25;
theta =90;
// V a r i o u s c o n d i t i o n s
ta =360; // A n g l e i n c a s e a
tb =180; // A n g l e i n c a s e b
Ic =20; // C u r r e n t i n c a s e c
// t h e t a d i r e c t l y p r o p o r t i o n a l t o t h e s q u a r e o f t h e
current

15
16 Ia = sqrt ( ta *( I ^2) / theta ) ;
17
18 Ib = sqrt ( tb *( I ^2) / theta ) ;
19
20 tc =(( Ic / I ) ^2) * theta ;
21
22 printf ( a ) F u l l S c s l e d e f l e c t i o n

( 3 6 0 ) c u r r e n t = %g

A \n , Ia )
23 printf ( b ) H a l f S c s l e d e f l e c t i o n ( 1 8 0 ) c u r r e n t = %g
A \n , Ib )
24 printf ( c ) D e f l e c t i o n f o r a c u r r e n t o f 20 A = %g
d e g r e e s \n , tc )

Scilab code Exa 4.6 Error calculation


1 // E r r o r
2
3 clc ;
4 clear ;

calculation

107

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

I =20; // C u r r e n t
V =230; // V o l t a g e
C =480; // Meter C o n s t a n t
L =4.6*(10^3) ; // Load
t =66/3600; // Time i n h o u r
R =40; //No o f r e v o l u t i o n s
Pc = L * t /1000; // Energy Consumed i n kWhr
Pr = R / C ; // Energy r e c o r d e d i n kWhr
err =( Pc - Pr ) *100/ Pc ;
printf ( The E r r o r i n t h e m e t e r i s t h a t t h e d i s c
r o t a t e s %g p e r c e n t s l o w \n , err )

Scilab code Exa 4.7 Dynamometer wattmeter power calculation of the load
1
2
3
4
5
6
7
8
9
10

// Dynamometer w a t t m e t e r power c a l c u l a t i o n o f t h e
load
clc ;
clear ;
P =250; // Power R e c o r d e d by t h e w a t t m e t e r
V =200; // Load v o l t a g e
R =2000; // R e s i s t a n c e o f t h e h i g h l y noni n d u c t i v e
pressure coil

11
12 I = V / R ; // Ohm s Law
13

108

14 Pcoil = V * I ; // Power Absorbed by t h e p r e s s u r e c o i l


15
16 Pl =P - Pcoil ; // Power t a k e n by t h e l o a d
17
18 printf ( The Power t a k e n by t h e l o a d = %g w a t t s . \n ,

Pl )

Scilab code Exa 4.8 Percentage error calculation in a wattmeter


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

// P e r c e n t a g e e r r o r c a l c u l a t i o n i n a w a t t m e t e r
clc ;
clear ;
// Rated P a r a m e t e r s
I =50;
V =230;
R =61; // No . o f r e v o l u t i o n s
t =37/3600; // Time i n h o u r s
C =520; // Normal D i s c Speed
Pfl = I * V ; // Power a t f u l l l o a d
Ps = Pfl * t /1000; // Power S u p p l i e d i n kWhr
Pr = R / C ; // Power r e c o r d e d i n kWhr
err =( Ps - Pr ) *100/ Ps ;
printf ( The P e r c e n t a g e E r r o r = %g p e r c e n t s l o w \n ,
err )

109

Chapter 5
Transformer

Scilab code Exa 5.1 To find flux density in the core and induced emf in
the secondary winding
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// To f i n d f l u x d e n s i t y i n t h e c o r e and i n d u c e d emf
in the secondary winding
clc ;
clear ;
E1 =500;
A =60*(10^ -4) ;
f =50;
N1 =400;
N2 =1000;
// E=4. 44 f NBmA I n d u c e d EMF e q u a t i o n
Bm = E1 /(4.44* f * N1 * A ) ;
E2 =4.44* f * N2 * Bm * A ;
printf ( a ) The peak v a l u e o f t h e f l u x d e n s i t y i n t h e
c o r e = %f t e s l a \n , Bm )
110

19

printf ( b ) The v o l t a g e i n d u c e d i n t h e s e c o n d a r y
w i n d i n g = %f V \n , E2 )

Scilab code Exa 5.2 To calculate the number of turns per limb on the high
and low voltage sides
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// To c a l c u l a t e t h e number o f t u r n s p e r l i m b on t h e
h i g h and low v o l t a g e s i d e s
clc ;
clear ;
f =50;
A =400*(10^ -4) ;
Bm =1;
V1 =3000;
V2 =220;
l =2; // Number o f l i m b s
// N e g l e c t i n g t h e s e r i e s v o l t a g e d r o p
// I n d u c e d EMF e q u a t i o n
a = V1 /(4.44* f * A * Bm ) ;
b = V2 * a / V1 ;
if ( modulo ( round ( a ) ,2) ==0) // No . o f t u r n s i s a w h o l e
e v e n number a s i t h a s 2 l i m b s
N1 = round ( a ) ;
else
N1 = round ( a ) +1;
end

22
23
24
25
26
27 if ( modulo ( round ( b ) ,2) ==0) // No .

111

o f t u r n s i s a whole

e v e n number a s i t h a s 2 l i m b s
N2 = round ( b ) ;

28
29 else
30
N2 = round ( b ) +1;
31 end
32
33 printf ( The number o f t u r n s i n t h e h i g h v o l t a g e

side
p e r l i m b = %d \n , N1 / l )
34 printf ( The number o f t u r n s i n t h e low v o l t a g e s i d e
p e r l i m b = %d \n , N2 / l )

Scilab code Exa 5.3 To calculate resistance of primary interms of secondary and vice versa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// To c a l c u l a t e r e s i s t a n c e o f p r i m a r y i n t e r m s o f
s e c o n d a r y and v i c e v e r s a
clc ;
clear ;
N1 =90;
N2 =180;
R2 =0.233;
R1 =0.067;
n = N2 / N1 ; // T r a n s f o r m a t i o n r a t i o
R1w2 =( n ^2) * R1 ;
R2w1 = R2 /( n ^2) ;
Rt = R1 + R2w1 ; // T o t a l r e s i s t a n c e i n t e r m s o f p r i m a r y
printf ( a ) R e s i s t a n c e o f p r i m a r y i n t e r m s o f t h e
s e c o n d a r y = %f ohms \n , R1w2 )
112

printf ( b ) R e s i s t a n c e o f s e c o n d a r y i n t e r m s o f t h e
p r i m a r y = %f ohms \n , R2w1 )
21 printf ( c ) T o t a l r e s i s t a n c e o f t h e t r a n s f o r m e r i n
t e r m s o f t h e p r i m a r y w i n d i n g =%f ohms \n , Rt )

20

Scilab code Exa 5.4 Total resitance and total copper loss at full load
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// T o t a l r e s i t a n c e and t o t a l c o p p e r l o s s a t f u l l
load
clc ;
clear ;
P =40*(10^3) ;
E1 =2000;
E2 =250;
n = E2 / E1 ; // T r a n s f o r m a t i o n r a t i o
R1 =1.15;
R2 =0.0155;
R1w2 = R1 *( n ^2) ;
R2w1 = R2 /( n ^2) ;
Rt = R2 + R1w2 ;
// F u l l l o a d c u r r e n t s
I1 = P / E1 ;
I2 = P / E2 ;
Pc1 =( I1 ^2) * R1 ; // Primary L o s s
Pc2 =( I2 ^2) * R2 ; // S e c o n d a r y L o s s
Pc = Pc1 + Pc2 ; // T o t a l Copper l o s s a t f u l l l o a d
113

28
29

printf ( a ) The t o t a l r e s i t a n c e i n t e r m s o f t h e
s e c o n d a r y w i n d i n g = %f ohms \n , Rt )
30 printf ( b ) T o t a l c o p p e r l o s s on f u l l l o a d = %f w a t t s
, Pc )

Scilab code Exa 5.5 Voltage regulation at a pf lagging


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// V o l t a g e r e g u l a t i o n a t 0 . 8 p f l a g g i n g
clc ;
clear ;
E1 =1100;
E2 =110;
P =5*(10^3) ;
I = P / E1 ; // Primary f u l l l o a d c u r r e n t
I2 = P / E2 ; // S e c o n d a r y f u l l l o a d c u r r e n t
V =33;
pf =0.8; // Power F a c t o r l a g g i n g , s o t h e a n g l e i s
positive

18
19 theta = acosd ( pf ) ; // Power f a c t o r
20
21 Pc =85;
22
23 R = Pc /( I ^2) ;
24
25 Z = V / I ;
26

114

angle

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

V1 = E1 ;
X = sqrt (( Z ^2) -( R ^2) ) ;
// U s i n g e q u a t i o n 5 . 2 2 t o d e t e r m i n e V2
V2 = poly ([0 1] , V2 , c ) ;
x =( V2 ^2) +(2* V2 * I * R * pf ) +(2* V2 * I * X * sind ( theta ) ) +(( I ^2)
*(( R ^2) +( X ^2) ) ) -( V1 ^2) ;
r = roots ( x ) ;
a1 = sqrt ( r (1) ) ;
a2 = sqrt ( r (2) ) ;
if ( imag ( a1 ) )
V2 = r (2) ;
else
if ( imag ( a2 ) )
V2 = r (1) ;
else
disp ( E r r o r )
end
end
reg =( V1 - V2 ) / V2 ; // V o l t a g e r e g u l a t i o n
regper = reg *100; // V o l t a g e r e g u l a t i o n p e r c e n t
disp (x , The c h a r a c t e r i s t i c e q u a t i o n t o f i n d V2
equated to zero i s )
disp ( regper , The p e r c e n t a g e v o l t a g e r e g u l a t i o n f o r a
load at 0.8 pf l a g g i n g i s )

115

Scilab code Exa 5.6 Regulation at lagging leading and unity power factors
1

// R e g u l a t i o n a t l a g g i i n g l e a d i n g and u n i t y power
factors

2
3 clc ;
4 clear ;
5
6 ol =0.01; // Ohmic l o s s i s 1% o f t h e o u t p u t
7
8 // Output = V I ; Ohmic l o s s =( I 2 ) R
9
10 // ( I R) /V = 0 . 0 1
11
12 rd =0.05; // R e a c t a n c e d r o p i s 5% o f t h e o u t p u t

voltage
13
14 // Power F a c t o r s
15 pf1 =0.8; // l a g
16 pf2 =1; // u n i t y
17 pf3 =0.8; // l e a d
18
19 deff ( y=a n g l e ( x ) , y=a c o s d ( x ) ) ; // F u n c t i o n t o f i n d

out the a n g l e
20
21 // A n g l e s
22 t1 = angle ( pf1 ) ; // P o s i t i v e s i g n a s i t i s l a g g i n g
23 t2 = angle ( pf2 ) ;
24 t3 = - angle ( pf3 ) ; // Minus s i g n a s i t i s l e a d i n g
25
26 deff ( a=v r ( b ) , a =(( o l c o s d ( b ) ) +( r d s i n d ( b ) ) ) 100 ) ;

// F u n c t i o n t o f i n d o u t v o l t a g e r e g u l a t i o n
27
28

printf ( The v o l t a g e r e g u l a t i o n p e r c e n t a g e s i s a s
116

follows
29 printf ( a )
30 printf ( b )
31 printf ( c )

\n )
For 0 . 8 p . f l a g = %f p e r c e n t \n , vr ( t1 ) )
For u n i t y p . f = %f p e r c e n t \n , vr ( t2 ) )
For 0 . 8 p . f l e a d = %f p e r c e n t \n , vr ( t3 ) )

Scilab code Exa 5.7 Calculate the circuit parameters of a transformer using OC and SC tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// C a l c u l a t e t h e c i r c u i t p a r a m e t e r s o f a t r a n s f o r m e r
u s i n g OC and SC t e s t s
clc ;
clear ;
E1 =200;
E2 =400;
n = E2 / E1 ; // T r a n s f o r m a t i o n r a t i o
// O . C C a l c u l a t i o n s
V1 =200;
Ioc =0.7;
Pi =70;
R0 =( V1 ^2) / Pi ;
Iw = V1 / R0 ;
Im = sqrt (( Ioc ^2) -( Iw ^2) ) ;
X0 = V1 / Im ;
// S . C C a l c u l a t i o n s on HT s i d e
Pc =80;
117

27
28
29
30
31
32
33
34
35

I =10;
V =15;
Rth = Pc /( I ^2) ;
Z=V/I;
Xth = sqrt (( Z ^2) -( Rth ^2) ) ;
// Both t h e s e v a l u e a r e r e f e r r e d t o HT s i d e , but t h e
a n s w e r i s r e q u i r e d t o be r e f e r r e d t o LT s i d e

36
37 Xtl = Xth /( n ^2) ; // R e a c t a n c e r e f e r r e d t o LT s i d e
38 Rtl = Rth /( n ^2) ; // R e s i s t a n c e r e f e r r e d t o LT s i d e
39
40 printf ( The C i r c u i t p a r a m e t e r s r e f e r r e d t o LT s i d e

i s a s f o l l o w s \n )
41
42

printf ( Ro = %f ohms \n Xo = %f ohms \n Rt = %f ohms


\n Xt = %f ohms \n ,R0 , X0 , Rtl , Xtl )

Scilab code Exa 5.8 To calculate terminal voltage and current and efficiency
1
2
3
4
5
6
7
8
9
10
11

// To c a l c u l a t e t e r m i n a l v o l t a g e and c u r r e n t and
efficiency
clc ;
clear ;
n =10; // T r a n s f o r m a t i o n r a t i o
E1 =200;
R0 =400;
X0 =251* %i ;
118

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

R1 =0.16;
X1 =0.7* %i ;
R2 =5.96; // As r e f e r r e d t o t h e p r i m a r y s i d e
X2 =4.44* %i ; // As r e f e r r e d t o t h e p r i m a r y s i d e
I1 = E1 /( R1 + R2 + X1 + X2 ) ;
t1 = atand ( imag ( I1 ) / real ( I1 ) ) ; // A n g l e f o r p r i m a r y
current
Iw = E1 / R0 ;
Im = E1 / X0 ;
Ip = Iw + Im + I1 ;
Zl = R2 + X2 ;
V2p = I1 * Zl ; // S e c o n d a r y t e r m i n a l v o l t a g e r e f e r r e d t o
primary s i d e
V2 = n * V2p ;
t2 = atand ( imag ( V2 ) / real ( V2 ) ) ; // A n g l e f o r V2
Po = ( abs ( I1 ) ^2) * R2 ; // Output power
Pc =( abs ( I1 ) ^2) * R1 ; // Copper L o s s
Pil =( abs ( Iw ) ^2) * R0 ; // I r o n L o s s
eff = Po *100/( Po + Pc + Pil ) // E f f i c i e n c y

printf ( a ) The s e c o n d a r y t e r m i n a l v o l t a g e = %f / %f
V \n , abs ( V2 ) , t2 )
45 printf ( b ) The p r i m a r y c u r r e n t = %f / %f A \n , abs (
I1 ) , t1 )
119

46

printf ( c ) The e f f i c i e n c y

i s %f p e r c e n t \n , eff )

Scilab code Exa 5.9 Regulation at full load pf lag


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

// R e g u l a t i o n a t f u l l l o a d p . f 0 . 8 l a g
clc ;
clear ;
Pi =500*(10^3) ; // Power I n p u t
Meff =97/100; // Max E f f i c i e n c y
pf1 =1;
E1 =3300;
E2 =500;
Po = Pi * pf1 *3/4;
// I r o n l o s s = Copper l o s s a t maximum e f f i c i e n c y
x = poly ([0 1] , x , c ) ;
Pin = Po +(2* x ) ;
xx =( Pin * Meff ) - Po ;
x = roots ( xx ) ; // I r o n L o s s = Copper L o s s
I2 = Po / E2 ;
R = x /( I2 ^2) ;
I2fl = Pi / E2 ;
Rfl = E2 / I2fl ;
120

32
33
34
35
36
37
38
39
40
41
42
43
44

// Per u n i t v a l u e s
Rpu = R *100/ Rfl ;
Zpu =10;
Xpu = sqrt (( Zpu ^2) -( Rpu ^2) ) ;
pf2 =0.8; // L a g g i n g
ang = acosd ( pf2 ) ; // P o s i t i v e A n g l e a s i t

is lagging

perreg =( Rpu * cosd ( ang ) ) +( Xpu * sind ( ang ) ) ;


printf ( The r e g u l a t i o n a t f u l l l o a d , p . f 0 . 8 l a g =
%f p e r c e n t \n , perreg )

Scilab code Exa 5.10 Calculate efficiency on unity pf at different cases


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// C a l c u l a t e e f f i c i e n c y on u n i t y p f a t d i f f e r e n t
cases
clc ;
clear ;
Pi =25*(10^3) ;
E1 =2000;
E2 =200;
Pil =350;
Pc =400;
// F u l l l o a d e f f i c i e n c y
nfl = Pi *100/( Pi + Pil + Pc ) ;

121

18 // H a l f Load e f f i c i e n c y
19
20 Pihl = Pi /2; // H a l f Load
21 nhl = Pihl *100/( Pihl + Pil +( Pc /4) ) ;
22
23 // Load a t which maximum e f f i c i e n c y o c c u r s
24
25 Piml = sqrt ( Pil / Pc ) * Pi ;
26 Pcm = Pc *(( Piml / Pi ) ^2) ;
27
28 printf ( a ) E f f i c i e n c y a t f u l l l o a d = %f p e r c e n t \n ,

nfl )
printf ( b ) E f f i c i e n c y a t h a l f l o a d = %f p e r c e n t \n ,
nhl )
30 printf ( c ) Maximum E f f i c i e n c y w i l l o c c u r a t %f KVA
and t h e l o s s e s a r e e a c h %d w a t t . \n ,( Piml /1000) ,
Pcm )
29

Scilab code Exa 5.11 Calcualte efficiencies at various loads


1
2
3
4
5
6
7
8
9
10
11

// C a l c u a l t e e f f i c i e n c i e s a t v a r i o u s l o a d s
clc ;
clear ;
P =100*(10^3) ; // Power I n p u t
Pc =1000; // Copper L o s s
Pil =1000; // I r o n L o s s
pf =0.8;

deff ( y=u n i t y ( x ) , y=(P 1 0 0 x ) / ( ( P x )+P i l +(Pc ( x 2 ) )


) ) // U n i t Power F a c t o r
12 deff ( y=p f a c t o r ( x ) , y=(P 1 0 0 x p f ) / ( ( P p f x )+P i l +(
Pc ( x 2 ) ) ) ) // 0 . 8 p . f

13

122

printf ( a ) U n i t y power f a c t o r e f f i c i e n c i e s a t \n \n
)
15 printf ( i ) H a l f o f f u l l l o a d = %f p e r c e n t \n , unity
(1/2) )
16 printf ( i i ) F u l l l o a d = %f p e r c e n t \n , unity (1) )
17 printf ( i i i ) ( 5 / 4 ) o f f u l l l o a d = %f p e r c e n t \n \n ,
unity (5/4) )
14

18
19
20
21

printf ( b ) 0 . 8 power f a c t o r e f f i c i e n c i e s a t \n \n )
printf ( i ) H a l f o f f u l l l o a d = %f p e r c e n t \n ,
pfactor (1/2) )
22 printf ( i i ) F u l l l o a d = %f p e r c e n t \n , pfactor (1) )
23 printf ( i i i ) ( 5 / 4 ) o f f u l l l o a d = %f p e r c e n t \n ,
pfactor (5/4) )

Scilab code Exa 5.12 To determine all day efficiency


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// To d e t e r m i n e a l l day e f f i c i e n c y
clc ;
clear ;
p =15*(10^3) ;
t1 =12;
t2 =6;
t3 =6;
pf1 =0.5;
pf2 =0.8;
pf3 =0.9;
x = poly ([0 1] , x , c ) ;
nm =0.98; // Max E f f i c i e n c y
123

18
19 y =( nm *( p +(2* x ) ) ) -p ;
20
21 x = roots ( y ) ; // To f i n d t h e i r o n

l o s s or copper l o s s
a t u n i t y p . f f o r maximum e f f i c i e n c y

22
23 Pil = x ; // I r o n l o s s
24
25 Pc = x ; // Copper L o s s a t u n i t y p . f

f o r maximum

efficiency
26
27 deff ( a=c u l o s s ( b , c ) , a=b Pc ( ( c / ( p / 1 0 0 0 ) ) 2 ) ) ;
28
29 Pc1 = culoss (12 ,(2/ pf1 ) ) ; // T o t a l Copper L o s s f o r 12

h r s 2 kW a t p . f 0 . 5
30 Pc2 = culoss (6 ,(12/ pf2 ) ) ; // T o t a l Copper L o s s f o r 6
h r s 12 kW a t p . f 0 . 8
31 Pc3 = culoss (6 ,(18/ pf3 ) ) ; // T o t a l Copper L o s s f o r 6
h r s 18 kW a t p . f 0 . 9
32
33 Po =((12*2) +(6*12) +(6*18) ) *(10^3) ; // Power Output
34
35 eff = Po *100/( Po +( Pc1 + Pc2 + Pc3 ) +(24* Pil ) ) ;
36
37 // Note t h e i r o n l o s s h a s t o be c o n s i d e r e d t o

c a l c u l a t e t h e E f f i c i e n c y , Text E r r o r
38
39

printf ( The a l l day e f f c i e n c y = %f p e r c e n t \n , eff )

Scilab code Exa 5.13 Calculating Efficiency using Sumpner test


1 // C a l c u l a t i n g
2
3 clc ;
4 clear ;

E f f i c i e n c y u s i n g Sumpner t e s t

124

5
6 P =200*(10^3) ;
7
8 W1 = 4*(10^3) ; // T o t a l i r o n

l o s s f o r both the
transformers
9 W2 = 6*(10^3) ; // T o t a l c o p p e r l o s s f o r b o t h t h e
transformers
10
11 n = P *100/( P +( W1 /2) +( W2 /2) ) ; // E f f i c i e n c y
12
13 printf ( The E f f i c i e n c y o f e a c h t r a n s f o r m e r a t

full

l o a d = %f p e r c e n t \n ,n )

Scilab code Exa 5.14 To determine the ratio of weights of copper


1 // To d e t e r m i n e t h e r a t i o o f w e i g h t s o f c o p p e r
2
3 clc ;
4 clear ;
5
6 n =3; // t r a n s f o r m a t i o n r a t i o
7
8 // R a t i o o f w e i g h t s o f c o p p e r i n an a t o t r a n s f o r m e r

and a two w i n d i n g t r a n s f o r m e r
9
10 roc =(1 -(1/ n ) ) ;
11
12 printf ( R a t i o o f w e i g h t s o f c o p p e r i n an a t o

t r a n s f o r m e r and a two w i n d i n g t r a n s f o r m e r = %f \n
, roc )

Scilab code Exa 5.15 To find voltage ratio and output


125

1
2
3
4
5
6
7
8
9

// To f i n d v o l t a g e r a t i o and o u t p u t
clc ;
clear ;
E1 =11500;
E2 =2300;
n1 =( E1 + E2 ) / E1 ; // V o l t a g e r a t i o o f 1 3 . 8 kV / 1 1 . 5 kV
auto t r a n s f o r m e r

10
11 Pi =100*(10^3) ;
12
13 P1 = Pi * n1 /( n1 -1) ;
14
15 n2 =( E1 + E2 ) / E2 ; // V o l t a g e

r a t i o o f 1 3 . 8 kV / 2 . 3 kV

auto t r a n s f o r m e r
16
17 P2 = Pi * n2 /( n2 -1) ;
18
19 printf ( The t r a n s f o r m a t i o n

r a t i o o f the auto
t r a n s f o r m e r i s %g and i s r a t e d %g / %g kV , %g KVA
\n ,n1 ,( E1 + E2 ) /1000 , E1 /1000 , P1 /1000)
20 printf ( The t r a n s f o r m a t i o n r a t i o o f t h e a u t o
t r a n s f o r m e r i s %g and i s r a t e d %g / %g kV , %g KVA
\n ,n2 ,( E1 + E2 ) /1000 , E2 /1000 , P2 /1000)

Scilab code Exa 5.16 Determine primary and secondary voltages and current
1

// D e t e r m i n e p r i m a r y and s e c o n d a r y v o l t a g e s and
current

2
3 clc ;
4 clear ;

126

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

R1 =100;
R2 =40;
P =2; // Power
r = sqrt ( R2 / R1 ) ; // n2 / n1 Turns r a t i o
if (r <1)
printf ( The t u r n s r a t i o i s 1 : %g \n ,(1/ r ) ) ;
else
printf ( The t u r n s r a t i o i s %g : 1 \n ,r ) ;
end
V1 = sqrt ( P *( R1 ) ) ;
V2 = sqrt ( P *( R2 ) ) ;
I1 = V1 / R1 ;
I2 = V2 / R2 ;
printf ( \n V o l t a g e s a r e a s f o l l o w s
printf ( The p r i m a r y v o l t a g e = %g V
printf ( The s e c o n d a r y v o l t a g e = %g
printf ( \n C u r r e n t s a r e a s f o l l o w s
printf ( The p r i m a r y c u r r e n t = %g A
printf ( The s e c o n d a r y c u r r e n t = %g

\n )
\n , V1 )
V \n , V2 )
\n )
\n , I1 )
A \n , I2 )

Scilab code Exa 5.17 Equivalent resistance and leakage reactance wrt primary
1

// E q u i v a l e n t r e s i s t a n c e and l e a k a g e r e a c t a n c e wrt
primary

2
3 clc ;
4 clear ;

127

5
6
7
8
9
10
11
12
13
14
15

P =1200;
V =60;
I1 =100;
R1eq = P /( I1 ^2) ;
Zeq = V / I1 ;
X1eq = sqrt (( Zeq ^2) -( R1eq ^2) ) ;
// S e c o n d a r y s h o r t c i r c u i t e d t h e r e t h e p a r a m e t e r s
c a l c u l a t e d a r e wrt t o p r i m a r y i t s e l f

16
17

printf ( E q u i v a l e n t R e s i s t a n c e o f t h e t r a n s f o r m e r w . r
. t p r i m a r y = %g ohms \n , R1eq )
18 printf ( L e a k a g e R e a c t a n c e o f t h e t r a n s f o r m e r w . r . t
p r i m a r y = %g ohms \n , X1eq ) // Text Book E r r o r
Please note

Scilab code Exa 5.18 To determine Input current and voltage during SC
test
1
2
3
4
5
6
7
8
9
10
11
12

// To d e t e r m i n e I n p u t c u r r e n t and v o l t a g e d u r i n g SC
test
clc ;
clear ;
Vh =6600;
Vl =250;
V =400;
a = Vh / Vl ; // Turns r a t i o
Rh =0.21;
128

13
14
15
16
17
18

Rl =2.72*(10^ -4) ;
Xh =1;
Xl =1.3*(10^ -3) ;

Rt = Rh + Rl *( a ^2) ; // E q u i v a l e n t r e s i s t a n c e w . r . t t h e
primary
19 Xt = Xh + Xl *( a ^2) ; // E q u i v a l e n t r e a c t a n c e w . r . t t h e
primary
20
21 ZHeq = sqrt (( Rt ^2) +( Xt ^2) ) ;
22
23 Ih = V / ZHeq ; // C u r r e n t on h i g h v o l t a g e s i d e
24
25 Pi =( Ih ^2) * Rt ; // Power i n p u t
26
27 printf ( W. R . T High V o l t a g e s i d e t h e e q u i v a l e n t

r e s i s t a n c e i s %g ohms and t h e e q u i v a l e n t
r e a c t a n c e i s %g ohms \n ,Rt , Xt )
28
29
30
31

printf ( The c u r r e n t on t h e h i g h v o l t a g e s i d e i s %g A
\n , Ih )
printf ( Power I n p u t on t h e h i g h v o l t a g e s i d e i s %g
kW \n , Pi /1000)

Scilab code Exa 5.19 To determine the load for max efficiency at two
power factors
1

// To d e t e r m i n e t h e l o a d f o r max e f f i c i e n c y a t two
power f a c t o r s

2
3 clc ;
4 clear ;
5

129

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22

P =100*(10^3) ; // Power I n p u t
E1 =1000;
E2 =10000;
Pil =1200;
I2 = P / E2 ; // F u l l l o a d c u r r e n t on t h e HV s i d e
Isc =6; // C u r r e n t f o r 500W c o p p e r l o s s i n HV w i n d i n g
Psc =500; // Copper L o s s f o r 6A i n HV w i n d i n g
Pc =(( I2 / Isc ) ^2) * Psc ; // Copper l o s s a t f u l l l o a d .
Pmax = sqrt ( Pil / Pc ) * P ; // I s a f a c t o r o f s q u a r e r o o t
o f t h e r a t i o o f I r o n l o s s and Copper l o s s a t f u l l
load .
deff ( x= e f f ( y , z ) , x=(P y z ) 1 0 0 / ( ( P y z )+P i l +(Pc ( z
2 ) ) ) ) // F u n c t i o n t o f i n d t h e e i f f i c i e n c y f o r a
g i v e n power f a c t o r ( y ) and l o a d ( z ) .

23
24

printf ( a ) The E f f i c i e n c y a t v a r i o u s l o a d s f o r u n i t y
power f a c t o r a r e a s f o l l o w s . \n )
25 printf ( i ) At 25 p e r c e n t l o a d = %f p e r c e n t \n , eff
(1 ,0.25) )
26 printf ( i i ) At 50 p e r c e n t l o a d = %g p e r c e n t \n , eff
(1 ,0.5) )
27 printf ( i i i ) At 100 p e r c e n t l o a d = %g p e r c e n t \n ,
eff (1 ,1) )
28
29

printf ( \n b ) The E f f i c i e n c y a t v a r i o u s l o a d s f o r
0 . 8 power f a c t o r a r e a s f o l l o w s . \n )
30 printf ( i ) At 25 p e r c e n t l o a d = %g p e r c e n t \n , eff
(0.8 ,0.25) )
31 printf ( i i ) At 50 p e r c e n t l o a d = %g p e r c e n t \n , eff
(0.8 ,0.5) )
32 printf ( i i i ) At 100 p e r c e n t l o a d = %g p e r c e n t \n \n
130

, eff (0.8 ,1) )


33
34

printf ( The Load a t which e f f i c i e n c y


kVA \n ,( Pmax /1000) )

i s maximum = %g

Scilab code Exa 5.20 To determine the max regulation and the pf at which
it occurs
1

//To d e t e r m i n e t h e max r e g u l a t i o n and t h e p f a t


which i t o c c u r s

2
3 clc ;
4 clear ;
5
6 Vr =2.5;
7 Vx =5;
8
9 printf ( The e x p r e s s i o n

f o r v o l t a g e r e q u l a t i o n i s y=
%g c o s ( p h i ) + %g s i n ( p h i ) \n ,Vr , Vx )

10
11
12
13

printf ( D i f f e r e n c i a t i n g w . r . t p h i and e q u a t i n g i t t o
z e r o , we g e t t h e power f a c t o r a n g l e \n )
printf ( We g e t t a n ( p h i )=> Vr /Vx => 5 / 2 . 5 => 2 \n \n
)

14
15 phi = atand ( Vx / Vr ) ; // power f a c t o r a n g l e
16
17 y = Vr * cosd ( phi ) + Vx * sind ( phi ) ; // Max V o l a t g e

regulation
18
19

printf ( The maximum r e g u l a t i o n i s %g p e r c e n t \n and


t h e power f a c t o r a t which i t o c c u r s i s %g d e g r e e s
\n ,y , phi )

131

Figure 5.1: To calculate secondary terminal voltage and full load efficiency
at unity pf

Scilab code Exa 5.21 To calculate secondary terminal voltage and full
load efficiency at unity pf
1

//To c a l c u l a t e s e c o n d a r y t e r m i n a l v o l t a g e and f u l l
load e f f i c i e n c y at unity pf

2
3 clc ;

132

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

clear ;
P =4*(10^3) ;
E1 =200;
E2 =400;
// O . C T e s t
V =200;
Pil =70; // I r o n L o s s
Ioc =0.8;
R0 =( V ^2) / Pil ;
Iw = V / R0 ;
Im = sqrt (( Ioc ^2) -( Iw ^2) ) ;
X0 = V / Im ;
// S . C T e s t
Vsc =17.5;
Isc =9;
Psc =50;
R2eq = Psc /( Isc ^2) ;
Z2eq = Vsc / Isc ;
X2eq = sqrt (( Z2eq ^2) -( R2eq ^2) ) ;
Is = P / E2 ; // F u l l l o a d c u r r e n t
Pc =(( Is / Isc ) ^2) * Psc ;
fleff =( P *100) /( P + Pil + Pc ) ; // F u l l l o a d e f f i c i e n c y
printf ( i ) The F u l l l o a d e f f i c i e n c y a t u n i t y power
f a c t o r = %g p e r c e n t \n \n , fleff )

40

133

41

// S e c o n d a r y T e r m i n a l v o l t a g e s c o s i d e r i n g
secondary current as r e f e r e n c e

42
43 Vs = poly ([0 1] , Vs , c ) ;
44
45 Vz = Is *( R2eq +( X2eq * %i ) ) ;
46
47 // U s i n g t h e c h a r a c t e r i s t i c
48
49
50

f u l l load

e q u a t i o n i n p o l a r form ,

Is as r e f e r e n c e
// E = V/ t h e t a + I s / 0 ( Z/ p h i )

// F u n c t i o n t o e v a l u l a t e t h e r i g h t s i d e o f t h e
e q u a t i o n i n c o m p l e x form
51 deff ( a=s t v ( b ) , a=Vs ( c o m p l e x ( c o s d ( b ) , s i n d ( b ) ) )+Vz
)
52
53
54
55
56
57

case1 = stv ( acosd (1) ) ;


case2 = stv ( acosd (0.8) ) ;
case3 = stv ( - acosd (0.8) ) ;

// F u n t i o n t o c a l c u l a t e t h e c h a r a c t e r i s t i c e q u a t i o n
o f Vs
58 deff ( x=s v o l ( y ) , x=( r e a l ( y ) 2 ) +( imag ( y ) 2 ) (E2 2 ) )
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

cs1 = svol ( case1 ) ;


cs2 = svol ( case2 ) ;
cs3 = svol ( case3 ) ;
// R o o t s o f t h e c h a r a c t e r i s t i c e q u a t i o n s
r1 = roots ( cs1 ) ;
r2 = roots ( cs2 ) ;
r3 = roots ( cs3 ) ;

// To f i n d t h e p o s i t i v e r o o t s
if ( imag ( sqrt ( r1 (1) ) ) )
Vs1 = r1 (2) ;
134

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

else
Vs1 = r1 (1) ;
end
if ( imag ( sqrt ( r2 (1) ) ) )
Vs2 = r2 (2) ;
else
Vs2 = r2 (1) ;
end
if ( imag ( sqrt ( r3 (1) ) ) )
Vs3 = r3 (2) ;
else
Vs3 = r3 (1) ;
end

printf ( i i ) The S e c o n d a r y t e r m i n a l v o l t a g e s f o r
v a r i o u s power f a c t o r s a r e a s f o l l o w s \n )
91 printf ( a ) At U n i t y power f a c t o r , Vs = %g V \n , Vs1 )
92 printf ( b ) At 0 . 8 power f a c t o r ( L a g g i n g ) , Vs = %g V \
n , Vs2 )
93 printf ( c ) At 0 . 8 power f a c t o r ( L e a d i n g ) , Vs = %g V \
n , Vs3 )

135

Chapter 6
DC Machines

Scilab code Exa 6.1 To Determine the useful flux per pole
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

//To D e t e r m i n e t h e u s e f u l f l u x p e r p o l e
clc ;
clear ;
E =600;
N =1200;
Z =250;
A =2;
P =6;
// EMF E q u a t i o n
phi = E * A *60/( N * Z * P ) ; // Flux d e v e l o p e d
printf ( The u s e f u l f l u x p e r p o l e = %g Wb \n , phi )

Scilab code Exa 6.2 Determine the EMF generated


136

1
2
3
4
5
6
7
8
9
10
11
12
13
14

// D e t e r m i n e t h e EMF g e n e r a t e d
clc ;
clear ;
phi =40*(10^ -3) ;
A =8; // Lap Winding
P =8;
N =400;
Z =960;
E = P * N * Z * phi /(60* A ) ; // EMF e q u a t i o n o f a DC machine
printf ( The EMF g e n e r a t e d = %g v o l t s \n ,E )

Scilab code Exa 6.3 Determine the EMF generated in a wave winding
1
2
3
4
5
6
7
8
9
10
11
12
13
14

// D e t e r m i n e t h e EMF g e n e r a t e d i n a wave w i n d i n g
clc ;
clear ;
phi =40*(10^ -3) ;
A =2; //Wave Winding
P =8;
E =400;
Z =960;
N = E *60* A /( phi * Z * P ) // EMF e q u a t i o n o f a DC machine
printf ( The s p e e d g e n e r a t e d = %g rpm \n ,N )

Scilab code Exa 6.4 Ratio of speeds of a generator and motor


137

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// R a t i o o f s p e e d s o f a g e n e r a t o r and motor
clc ;
clear ;
V =250;
Il =80;
Ra =0.12;
Rf =100; // F i e l d R e s i s t a n c e
Ish = V / Rf ; // F i e l d C u r r e n t
Ia1 = Il + Ish ; // Machine C u r r e n t g e n r a t e d
Ia2 = Il - Ish ; // Motor C u r r e n t t a k e n by t h e motor
E = V +( Ia1 * Ra ) ; // G e n e r a t o r I n d u c e d EMF
Eb =V -( Ia2 * Ra ) ; // Motor O p e r a t i n g EMF
// S p e e d s a r e d i r e c t l y p r o p o r t i o n a l t o t h e EMFs
Nr = E / Eb ; // R a t i o o f s p e e d s
printf ( The r a t i o o f G e n e r a t o r s p e e d t o motor s p e e d
= %g \n , Nr )

Scilab code Exa 6.5 Calculate Load Current in a shunt generator


1 // C a l c u l a t e Load C u r r e n t i n a s h u n t g e n e r a t o r
2
3 clc ;
4 clear ;
5
6 E =127;
7 V =120;

138

8
9
10
11
12
13
14
15
16
17

Ra =0.02;
Rf =15; // F i e l d R e s i s t a n c e
Ish = V / Rf ;
Ia =( E - V ) / Ra ;
Il = Ia - Ish ;
printf ( The l o a d c u r r e n t = %g A \n , Il )

Scilab code Exa 6.6 Useful Flux per pole on no load shunt motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// U s e f u l Flux p e r p o l e on no l o a d s h u n t motor
clc ;
clear ;
V =250;
Z =2*110; // One t u r n i s two c o n d u c t o r s
Ia =13.3;
N =908;
Ra =0.2;
A =2; //Wave Winding
P =6;
Eb =V -( Ia * Ra ) ; // Back EMF
phi = Eb *60* A /( N * Z * P ) ;
printf ( The u s e f u l f l u x p e r p o l e on no l o a d o f a 250
V, 6 p o l e s h u n t motor = %g mWb \n , phi *1000)

Scilab code Exa 6.7 To find efficiency and useful torque


139

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

//To f i n d e f f i c i e n c y and u s e f u l t o r q u e
clc ;
clear ;
V =500;
N =600/60; // R o t a t i o n p e r s e c o n d
I =18;
Hp =735.5; // The V a l u e o f one h o r s e power i s 7 3 5 . 5 W
Pd =10* Hp ; // Power Output
Pi = V * I ; // Power i n p u t
eff = Pd *100/ Pi ; // E f f i c i e n c y

// Power ouput e l e c t r i c a l = Power m e c h a n i c a l = Po= 2


p i NT
17 T = Pd /(2* %pi * N ) ;
18
19

printf ( The e f f i c i e n c y o f t h e s h u n t motor = %g


p e r c e n t \n , eff )
20 printf ( U s e f u l t o r q u e = %g Nm \n ,T )

Scilab code Exa 6.8 Speed calculation of series motor


1
2
3
4
5
6
7
8
9
10

// Speed c a l c u l a t i o n o f s e r i e s motor
clc ;
clear ;
N1 =800; // Speed i n Case 1
Ra =1;
I =15;
V =200;
Rs =5; // S e r i e s r e s i s t a n c e
140

11
12 Eb1 =V -( I * Ra ) ; // Back Emf i n Case 1
13 Eb2 =V -( I *( Ra + Rs ) ) ; // Back Emf i n c a s e 2
14
15 // Speed d i r e c t l y p r o p o r t i o n a l t o EMF
16
17 N2 = Eb2 * N1 / Eb1 ;
18
19 printf ( The s p e e d o f t h e motor when c o n n e c t e d i n

s e r i e s t o a r e s i s t a n c e o f 5 ohms = %g rpm \n , N2 )

Scilab code Exa 6.9 Parameters calculated due to armature reaction


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// P a r a m e t e r s c a l c u l a t e d due t o a r m a t u r e r e a c t i o n
clc ;
clear ;
P =8;
Z =960;
A =2; //Wave Winding
Ia =100;
cmti = Ia * Z /(2* A * P ) ; // T o t a l number o f m a g n e t i s i n g
turns
deff ( y=dm( x ) , y=c m t i 2 x / 1 8 0 ) // F u n c t i o n t o f i n d
o u t d e m a g n e t i s i n g ampere t u r n s
// The d e m a g n e t i s i n g and c r o s m a g n e t i s i n g ampere
turns of the three ca ses r e s p e c t i v e l y

17
18 DM1 = ceil ( dm (0) ) ;
19 CM1 = cmti - DM1 ;

141

20
21
22 DM2 = ceil ( dm (10) ) ; // To a v o i d d e c i m a l

error ceil

is

used
23 CM2 = cmti - DM2 ;
24
25
26 DM3 = ceil ( dm (10*4) ) ; // M e c h a n i c a l d e g r e e no o f

pair of poles = E l e c t r i c a l degree


27 CM3 = cmti - DM3 ;
28
29 printf ( i ) B r u s h e s a l o n g GNP. \n D e m a g n e t i s i n g and

c r o s s m a g n e t i s i n g ampere t u r n s a r e %g AT/ p o l e and


%g AT/ p o l e r e s p e c t i v e l y \n\n ,DM1 , CM1 )
30
31

32
33

printf ( i i ) B r u s h e s a r e s h i f t e d by 10 e l e c t r i c a l
d e g r e s s . \n D e m a g n e t i s i n g and c r o s s m a g n e t i s i n g
ampere t u r n s a r e %g AT/ p o l e and %g AT/ p o l e
r e s p e c t i v e l y \n\n ,DM2 , CM2 )
printf ( i i i ) B r u s h e s a r e s h i f t e d by 10 m e c h a n i c a l
d e g r e s s . \n D e m a g n e t i s i n g and c r o s s m a g n e t i s i n g
ampere t u r n s a r e %g AT/ p o l e and %g AT/ p o l e
r e s p e c t i v e l y \n\n ,DM3 , CM3 )

Scilab code Exa 6.10 Number of conductors of compensating winding


1
2
3
4
5
6
7
8

// Number o f c o n d u c t o r s o f c o m p e n s a t i n g w i n d i n g
clc ;
clear ;
P =8; // No o f P o l e s
Z =960; // No o f c o n d u c t o r s
ep =70/100; // E f f e c t i v e p o l e p i t c h
142

9
10 Zp = Z / P ; // No o s c o n d u c t o r s p e r p o l e
11
12 AZp = ep * Zp ; // No o f a c t i c e a r m a t u r e c o n d u c t o r s
13
14 Zpc = ceil ( AZp / P ) ; // C o n d u c t o r s i n c o m p e n s a t i n g

winding
15
16

printf ( The number o f c o n d u c t o r s o f c o m p e n s a t i n g


w i n d i n g = %g c o n d u c t o r / p o l e \n , Zpc )

Scilab code Exa 6.11 Swinburne test on a dc shunt motor


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// S w i n b u r n e t e s t on a dc s h u n t motor
clc ;
clear ;
V =500;
I =5;
Rf =250;
Ra =0.5;
P=V*I;
If = V / Rf ;
Ia =I - If ;
Pfc =( If ^2) * Rf ; // F i e l d Copper L o s s
Pac =( Ia ^2) * Ra ; // Armature Copper L o s s
Pil =P - Pfc - Pac ; // I r o n l o s s
// G e n e r a t o r
143

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

Vg =500;
Ig =100;
Pog = Vg * Ig ; // Power Output
Iag = Ig + If ; // Armature c u r r e n t
Pgac =( Iag ^2) * Ra ; // Armature Copper l o s s
slg =0.01* Pog ; // s t r a y l o s s
Pgtl = Pgac + Pfc + slg + Pil ; // T o t a l l o s s e s
effg = Pog *100/( Pog + Pgtl ) ;
// Motor
Vm =500;
Im =100;
Pim = Vm * Im ; // Power i n p u t t o t h e motor
Iam = Ig - If ; // Armature c u r r e n t
Pmac =( Iam ^2) * Ra ; // Armature Copper L o s s
Pom = Pim - Pmac - Pil - Pfc ; // Ouput o f t h e motor
slm =0.01* Pom ; // S t r a y l o s s
Pmtl = Pmac + Pil + Pfc + slm ; // T o t a l l o s s o f t h e motor
effm =( Pom - slm ) *100/( Pim ) ;

printf ( i ) The E f f i c i e n c y o f t h e machine a s a


g e n e r a t o r d e l i v e r i n g 100A a t 500V = %g p e r c e n t \n
, effg )
144

59
60

printf ( i i ) The E f f i c i e n c y o f t h e machine a s a motor


h a v i n g a l i n e c u r r e n t 100A a t 500V = %g p e r c e n t
\n , effm )

Scilab code Exa 6.12 Speed of a belt driven shunt generator


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

// Speed o f a b e l t d r i v e n s h u n t g e n e r a t o r
clc ;
clear ;
Pg =100*(10^3) ; // Power o u t p u t o f t h e g e n e r a t o r
Pm =10*(10^3) ; // Power i n p u t o f t h e motor
V =220;
Ng =300; // Running s p e e d o f t h e g e n e r a t o r
Ra =0.025; // Armature r e s i s t a n c e
Rf =60; // F i e l d R e s i s t a n c e
Vb =2; // V o l t a g e d r o p due t o b r u s h e s
Im = Pm / V ; // C u r r e n t t a k e n by t h e motor
Ig = Pg / V ; // C u r r e n t d e l i v e r e d by t h e g e n e r a t o r
Eg = V +( Ig * Ra ) + Vb ; // I n d u c e d EMF o f g e n e r a t o r
Eb =V -( Im * Ra ) - Vb ; // Back EMF o f t h e motor
Nm = Eb * Ng / Eg ;
printf ( The Speed u n d e r m o t o r i n g c o n d i t i o n = %g rpm
\n , Nm )

145

Scilab code Exa 6.13 Voltage between feeder and bus bar in a series generator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// V o l t a g e b e t w e e n f e e d e r and bus b a r i n a s e r i e s
generator
clc ;
clear ;
V =50;
I =200;
Rf =0.3; // F e e d e r r e s i s t a n c e
// V a r i o u s C u r r e n t s
I1 =160;
I2 =50;
deff ( y=v o l ( x ) , y=(x Rf ) (V x / I ) ) // F u n c t i o n t o
c a l c u l a t e the v o l t a g e s

16
17 Va = vol ( I1 ) ;
18 Vb = vol ( I2 ) ;
19
20 printf ( The v o l t a g e b e t w e e n t h e f a r end o f t h e

f e e d e r and t h e bus b a r a t a c u r r e n t o f \n )
21 printf ( a ) 160A = %g V \n , Va )
22 printf ( b ) 50A = %g V \n , Vb )

Scilab code Exa 6.14 Induced EMF and Armature current in a long shunt
compound generator
1

// I n d u c e d EMF and Armature c u r r e n t i n a l o n g s h u n t


compound g e n e r a t o r

146

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

clc ;
clear ;
Il =50; // Load C u r r e n t
Vl =500; // Load V o l t a g e
Ra =0.05; // Armature R e s i s t a n c e
Rfs =0.03; // S e r i e s F i e l d R e s i s t a n c e
Rfp =250; // Shunt F i e l d R e s i s t a n c e
Vb =2; // C o n t a c t d r o p
Ish = Vl / Rfp ;
Ia = Il + Ish ;
E = Vl +( Ia *( Ra + Rfs ) ) + Vb ; // I n d u c e d EMF
printf ( The I n d u c e d EMF and Armature C u r r e n t i s %g V
and %g A r e s p e c t i v e l y \n ,E , Ia )

Scilab code Exa 6.15 Speed at 50A considering armature reaction of a


shunt motor
1
2
3
4
5
6
7
8
9
10
11
12

// Speed a t 50A c o n s i d e r i n g a r m a t u r e r e a c t i o n o f a
s h u n t motor
clc ;
clear ;
N =1000; // Speed a t No l o a d
I =5; // C u r r e n t a t no l o a d
V =250;
Ra =0.2; // Armature R e s i s t a n c e
Rf =250; // F i e l d R e s i s t a n c e
Ish = V / Rf ; // F i e l d C u r r e n t
147

13
14
15
16
17
18
19
20
21
22

Ia =I - Ish ; // Armature C u r r e n t a t no l o a d
Eb =V -( Ia * Ra ) ; // Back EMF a t no l o a d
Il =50; // C u r e n t t a k e n when l o a d e d
Ebl =V -( Il - Ish ) * Ra ; // Back EMF when l o a d e d
Nl = Ebl * N /(0.97* Eb )
printf ( The Speed a t 50A c o n s i d e r i n g w e a k e n i n g o f
t h e f i e l d due t o a r m a t u r e r e a c t i o n = %g rpm \n ,
ceil ( Nl ) )

Scilab code Exa 6.16 Speed of shunt motor taking 50kW input
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Speed o f s h u n t motor t a k i n g 50kW i n p u t


clc ;
clear ;
Pog =50*(10^3) ; // Power ouput o f t h e g e n e r a t o r
Ng =400; // Speed o f t h e g e n e r a t o r
Vg =250;
Ra =0.02;
Rf =50;
Pim =50*(10^3) ; // Power I n p u t o f motor
Vm =250;
Vb =2; // C o n t a c t d r o p
// G e n e r a t o r
Ish = Vg / Rf ; // F i e l d C u r r e n t
Ilg = Pog / Vg ; // Load C u r r e n t
148

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Iag = Ish + Ilg ; // Armature C u r r e n t


Eg = Vg +( Iag * Ra ) + Vb ;
// Motor
Ilm = Pim / Vm ; // I n p u t C u r r e n t
Ish = Vm / Rf ; // F i e l d C u r r e n t
Iam = Ilm - Ish ; // Armature C u r r e n t
Eb = Vm -( Iam * Ra ) - Vb ; // Back EMF
Nm = Eb * Ng / Eg ;
printf ( The s p e e d o f s h u n t g e n e r a t o r a s a motor = %g
rpm , ceil ( Nm ) )

Scilab code Exa 6.17 Useful torque and efficiency of a shunt motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// U s e f u l t o r q u e and e f f i c i e n c y o f a s h u n t motor
clc ;
clear ;
Po =10.14*735; // 1 HP i s 735 W, Power D e v e l o p e d
N =600/60; // Speed i n r o t a t i o n s p e r s e c
I =18;
V =500;
Pi = V * I ; // Power i n p u t
eff = Po *100/ Pi ;
T = Po /(2* %pi * N ) ;
printf ( The E f f i c i e n c y and t h e u s e f u l t o r q u e o f t h e
149

s h u n t motor a r e %g p e r c e n t and %g Nm r e s p e c t i v e l y
\n ,eff , T )

Scilab code Exa 6.18 Total torque developed in a 4 pole shunt motor
1
2
3
4
5
6
7
8
9
10
11
12

// T o t a l t o r q u e d e v e l o p e d i n a 4 p o l e s h u n t motor
clc ;
clear ;
P =4;
A =4; // Lap Winding
Z =60*20; // S l o t s no o f c o m d u c t o r s i n e a c h s l o t
phi =23*(10^ -3) ;
Ia =50; // Armature c u r r e n t

printf ( The e q a u t i o n t o f i n d o u t t o r q u e i s g i v e n by
\n \n 2 p i NT = p h i ZPN/ ( 6 0 A) I a \n\n )
13 T =(( phi * Z * P * Ia ) /(60* A ) ) /(2* %pi /60) ;
14
15

printf ( T o t a l t o r q u e d e v e l o p e d = %g Nm \n ,T )

Scilab code Exa 6.19 EMF and copper losses of a Shunt Motor
1
2
3
4
5
6
7
8
9

//EMF and c o p p e r l o s s e s o f a Shunt Motor


clc ;
clear ;
V =250;
I =200;
Ra =0.02; // Armature R e s i s t a n c e
Rf =50; // F i e l d R e s i s t a n c e
150

10
11
12
13
14
15
16
17
18
19
20
21
22

Pil =950; // I r o n and f r i c t i o n a l

losses

Ish = V / Rf ; // F i e l d C u r r e n t
Ia = Ish + I ; // Armature C u r r e n t
Pac =( Ia ^2) * Ra ; // Armature c o p p e r l o s s
Pfc =( Ish ^2) * Rf ; // F i e l d c o p p e r l o s s
Pc = Pac + Pfc ;
E = V +( Ia * Ra ) ;
Prime =( V * I ) + Pil + Pc ; // Ouput o f p r i m e mover i s t h e
input to the generator

23
24 eff =( V * I *100) / Prime ;
25
26 printf ( i ) The EMF g e n e r a t e d = %g V \n ,E )
27 printf ( i i ) T o t a l Copper L o s s = %g w a t t s \n , Pc )
28 printf ( i i i ) Output o f t h e p r i m e mover i s %g w a t t s

and t h e e f f i c i e n c y

i s %g p e r c e n t \n , Prime , eff )

Scilab code Exa 6.20 Current taken by a motor at 90 percent efficiency


1
2
3
4
5
6
7
8
9
10
11

// C u r r e n t t a k e n by a motor a t 90 p e r c e n t e f f i c i e n c y
clc ;
clear ;
V =500;
N =400/60; // Speed i n r o t a t i o n s p e r s e c
eff =90/100;
T =195
Pd =2* %pi * N * T ; // Power d e v e l o p e d by t h e motor
151

12
13 Pi = Pd / eff ; // Power i n p u t t o t h e motor
14
15 I = Pi / V ;
16
17 printf ( The C u r r e n t t a k e n by t h e motor = %g A \n ,I )

Scilab code Exa 6.21 Rated torque calculation by resistance addition


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

// Rated t o r q u e c a l c u l a t i o n by r e s i s t a n c e a d d i t i o n
clc ;
clear ;
V =240;
I =40;
Ra =0.3;
N1 =1500/60; // s p e e d i n r o t a t i o n s p e r s e c
N2 =1000/60;
Pi = V * I ; // Power i n p u t
Pc =( I ^2) * Ra ; // Copper l o s s
Po = Pi - Pc ;
T = Po /(2* %pi * N1 ) ; // Rated t o r q u e
R1 = V / I ; // Back EMF i s z e r o
Rex1 = R1 - Ra ;
//Eb d i r e c t l y t o N( s p e e d )
Eb1500 =V -( I * Ra ) ;
152

27 Eb1000 = N2 * Eb1500 / N1 ;
28
29 R = poly ([0 1] , R , c ) ;
30
31 x =( V - Eb1000 ) -( I *( R + Ra ) ) ; // C h a r a c t e r i s t i c

equation

to f i n d e x t e r n a l r e s i s t a n c e
32
33
34
35

Rex2 = roots ( x ) ;

printf ( The v a l u e o f t h e r e s i s t a n c e t o be added t o


o b t a i n r a t e d t o r q u e \n )
36 printf ( a ) At s t a r t i n g = %g ohms \n , Rex1 )
37 printf ( b ) At 1 0 0 0 rpm = %g ohms \n , Rex2 )

Scilab code Exa 6.22 Efficiency at full load


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// E f f i c i e n c y a t f u l l l o a d
clc ;
clear ;
V =400;
Inl =5; // No l o a d c u r r e n t
Ra =0.5; // Armature R e s i s t a n c e
Rf =200; // F i e l d R e s i s t a n c e
Ifl =40; // F u l l l o a d c u r r e n t
Ish = V / Rf ; //

F i e l d Current

Psc =( Ish ^2) * Rf ; // F i e l d c o p p e r l o s s


Prs =( V * Inl ) - Psc ; // S t r a y l o s s e s a s s u m i n g no
armature l o s s e s

17
18 Ia = Ifl - Ish ; // Armature C u r r e n t

153

19
20
21
22
23
24
25
26
27
28

Pc =( Ia ^2) * Ra ; // Armature c o p p e r l o s s
Pi = Ifl * V ; // Power i n p u t
Po = Pi - Psc - Prs - Pc ;
eff = Po *100/ Pi ;
printf ( The e f f i c i e n c y a t f u l l l o a d = %g p e r c e n t \n
, eff )

154

Chapter 7
Three Phase Synchronous
Machines

Scilab code Exa 7.1 Power delivered to 3 phase synchronous motor


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Power d e l i v e r e d t o 3 p h a s e s y n c h r o n o u s motor
clc ;
clear ;
Vl =2300;
Il =8.8;
pf =0.8 // Lead Power F a c t o r
theta = acosd ( pf )
P = sqrt (3) * Vl * Il ; // Power d e l i v e r e d by t h e pump
I = P /( sqrt (3) * Vl * pf ) ; // I n c r e a s e i n C u r r e n t
Pr = sqrt (3) * Vl * I * sind ( theta ) ; // kVAr s u p p l i e d

printf ( The Power d e l i v e r e d by t h e pump = %g kW \n ,


P /1000)
18 printf ( The R h e o s t a t s h o u l d be d e c r e a s e d s u c h t h a t
155

t h e ammeter r e a d s %g A \n ,I )
19 printf ( The kVAr s u p p l i e d by t h e motor = %g kVAr , Pr
/1000)

Scilab code Exa 7.2 New plant pf and percent decrease in line current
1 //New p l a n t p f and p e r c e n t d e c r e a s e i n l i n e c u r r e n t
2
3 clc ;
4 clear ;
5
6 Pmp =5000*(10^3) ; // E l e c t r i c a l l o a d
7 pfmp =0.8; // Lag
8
9 Pim =500*735; // One h o r s e power i s 735W
10 Effim =96/100; // E f f i c i e n c y o f t h e motor
11 pfim =0.9; // Lag
12 pfsm =0.8; // Lead
13
14 Pime = Pim / Effim ; // E f f e c t i v e power d e l i v e r e d by t h e

i n d u c t i o n motor
15
16
17
18
19
20
21

deff ( x=com ( y , z ) , x=y+(%i y t a n d ( a c o s d ( z ) ) ) ) //


Function to f i n d the complex powers
// Complex Powers
Pcmp = com ( Pmp , pfmp ) ; // M a n u f a c t u r i n g P l a n t Load
Pcim = com ( Pime , pfim ) ; // I n d u c t i o n Motor
Pcsm = com ( Pime , - pfsm ) ; // S y n c h r o n o u s Machine , Minus
S i g n i n d i c a t e s Lead

22
23 Pr = Pcmp - Pcim + Pcsm ; // P l a n t R e q u i r e m e n t a f t e r

replacement
24
25

pfar = real ( Pr ) / abs ( Pr ) ; // New Power F a c t o r o f t h e


156

plant
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

Pnp = abs ( Pr ) ;
Vl = poly ([0 1] , Vl , c ) ;
Io = Pmp /( pfmp * sqrt (3) * Vl ) ;
In = Pnp /( sqrt (3) * Vl ) ; // Improved F a c t o r V a l u e =1;
red =( Io - In ) *100/ Io ; // R e d u c t i o n p e r c e n t i n
fractions
redeq = Vl - red ; // R e d u c t i o n p e r c e n t i n d e c i m a l
c h a r a c t e r i s t i c equation
redper = roots ( redeq (2) ) ;

printf ( The New Power F a c t o r o f t h e p l a n t = %g l a g \


n , pfar )
41 printf ( The P e r c e n t a g e d e c r e a s e i n l i n e c u r r e n t t h a t
w i l l r e s u l t i n i m p r o v e d p . f = %g p e r c e n t \n ,
redper )

Scilab code Exa 7.3 kVAr rating of a synchronous condenser


1
2
3
4
5
6
7
8
9

// kVAr r a t i n g o f a s y n c h r o n o u s c o n d e n s e r
clc ;
clear ;
P =5000*(10^3) ; // Power d e l i v e r e d t o t h e l o a d
pfo =0.8; // O r i g i n a l Power F a c t o r
pfn =0.9; // New Power F a c t o r
Pcomo = P + %i *( P * tand ( acosd ( pfo ) ) ) ; // O r i g i n a l Complex
Power
157

10 Pcomn = P + %i *( P * tand ( acosd ( pfn ) ) ) ; //New Complex Power


11
12 Psc = abs ( imag ( Pcomo - Pcomn ) ) ; // D i f f e r e n c e i n kVAr ;
13
14 printf ( The kVAr r a t i n g o f t h e s y n c h r o n o u s c o n d e n s e r

t o c o r r e c t t h e o r i g i n a l p . f t o 0 . 9 = %g kVAr \n
, Psc /1000)

Scilab code Exa 7.4 Calculate E per phase and Current and pf
1 // C a l c u l a t e E p e r p h a s e and C u r r e n t and p f
2
3 clc ;
4 clear ;
5
6 V =2300;
7 delta =20;
8 Pd =255*735.5; // Power d e l i v e r e d c o n v e r t e d t o W from
9
10
11
12
13
14
15
16

HP
Xs =10;
eff =90/100; // E f f i c i e n c y
P = Pd / eff ;
E = poly ([0 1] , E , c ) ;
x =( sqrt (3) * E * V * sind ( delta ) ) -( P * Xs ) ; //
C h a r a c t e r i s t i c Equation to f i n d E

17
18 E = roots ( x ) ;
19
20 Vph = V /( sqrt (3) ) ; // Phase V o l t a g e
21
22 I =(( Vph * expm ( %i *0) ) -( E * expm ( %i *( - %pi /9) ) ) ) /( %i * Xs ) ;

// C u r r e n t E q a u t i o n
158

23
24 [ Im , phi ]= polar ( I ) ; // A n g l e i n r a d i a n s and m a g n i t u d e
25
26 phid =( abs ( phi ) / %pi ) *180; // Power F a c t o r A n g l e i n

Degrees
27
28 pf = cosd ( phid ) ;
29
30 // High P r e c i s i o n Answers
31 printf ( a ) E p e r p h a s e = %g V \n ,E )
32 disp ( a m p e r e s ,I , b ) I = )
33 printf ( \n c ) p . f = %g l e a d \n , pf )

Scilab code Exa 7.5 Voltage Regulation of a 3 Phase alternator


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// V o l t a g e R e g u l a t i o n o f a 3 Phase a l t e r n a t o r
clc ;
clear ;
Ra =0.093;
Xs =8.5;
Z =( Ra +( %i * Xs ) ) ; // T o t a l Impedance
P =1500*(10^3) ; // Power d e l i v e r e d a t f u l l l o a d
V =6.6*(10^3) ; // V o l t a g e p e r l i n e
Vph = V /( sqrt (3) ) ; // V o l t a g e p e r p h a s e
Il = P /( sqrt (3) * V ) ; // F u l l Load C u r r e n t

// Taking v o l t a g e a s r e f e r e n c e
// Power A n g l e s
theta1 = - acos (0.8) ; // N e g a t i v e S i g n a s I t i s l a g g i n g
theta2 = acos (0.8) ;
159

21
22

deff ( a=p o t ( b ) , a=Vph+(( I l expm ( %i b ) ) Z ) ) //


Function to f i n d out the output phase v o l t a g e

23
24 E1 = pot ( theta1 ) ;
25 E2 = pot ( theta2 ) ;
26
27 deff ( y=vg ( x ) , y=( a b s ( x )Vph ) 1 0 0 / Vph ) // F u n c t i o n

to f i n d out the v o l t a g e r e g u l a t i o n u s i n g the


formuala
28
29
30
31
32

Vreg1 = vg ( E1 ) ;
Vreg2 = vg ( E2 ) ;

printf ( The V o l t a g e r e g u l a t i o n o f a 3Phase 1 5 0 0 kVA


, 6 . 6 kV a l t e r n a t o r a t \n )
33 printf ( i ) 0 . 8 l a g = %g p e r c e n t \n , Vreg1 )
34 printf ( i i ) 0 . 8 l e a d = %g p e r c e n t \n , Vreg2 )

Scilab code Exa 7.6 Internal Voltage drop in an alternator


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// I n t e r n a l V o l t a g e d r o p i n an a l t e r n a t o r
clc ;
clear ;
If =10;
Voc =900; // Open C i r c u i t V o l t a g e
Isc =150; // S h o r t C i r c u i t C u r r e n t
Zs = Voc / Isc ;
I =60; // Load c u r r e n t

160

15 Vd = I * Zs ; // I n t e r n a l
16
17 printf ( The i n t e r n a l

V o l t a g e Drop

v o l t a g e drop with a l o a d
c u r r e n t o f 60 A = %g V \n , Vd )

161

Chapter 8
Three Phase Induction Motors

Scilab code Exa 8.1 Find the percentage slip and poles of the motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Find t h e p e r c e n t a g e s l i p and p o l e s o f t h e motor


clc ;
clear ;
p =12;
n =500;
nlim =1440;
f = p * n /120;
c =1;
while (c >0) // Used t o f i n d o u t t h e p o l e s o f t h e
motor n e a r e s t t o t h e f u l l l o a d s l i p
P =2* c ;
N =120* f / P ;
g =(5/100) * N ;
if (( N - nlim ) >(0.05* N ) )
c = c +1;
else
c =0;
end
162

21 end
22
23 slip =( N - nlim ) *100/ N ;
24
25 printf ( The Number o f

p o l e s o f t h e i n d u c t i o n motor

i s %g \n ,P )
26 printf ( The p e r c e n t a g e s l i p

i s %g p e r c e n t \n , slip )

Scilab code Exa 8.2 To calculate motor speed and its slip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

//To c a l c u l a t e motor s p e e d and i t s

slip

clc ;
clear ;
f =50;
sf =3/2;
s = sf / f ;
p =8;
N =120* f /8;
Nr = poly ([0 1] , Nr , c ) ; // A c t u a l Speed V a r i a b l e
x =(750* s ) -(750 - Nr ) ; // E q u a t i o n To f i n d t h e A c t u a l
Speed

16
17 Nr = roots ( x ) ; // A c t u a l Speed C o n s t a n t
18
19 printf ( The motor r u n s a t a s p e e d o f %g rpm and h a s

a s l i p o f %g \n , ceil ( Nr ) ,s )

163

Scilab code Exa 8.3 To Calculate Parameters of a 3 phase 4 pole induction


machine
1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

// To C a l c u l a t e P a r a m e t e r s o f a 3 p h a s e 4 p o l e
i n d u c t i o n machine .
clc ;
clear ;
V1 =200;
R2 =0.1;
X2 =0.9;
f =50;
p =4;
s =4/100;
a =0.67; // The R a t i o o f r o t o r t o s t a t o r t u r n s
P =(( a * V1 ) ^2) * R2 *(1 - s ) * s /((( R2 ) ^2) +(( s * X2 ) ^2) ) ; //
Power D e l i v e r e d r e f e r r e d t o t h e r o t o r s i d e (
M e c h a n i c a l Power )
N =120* f / p ; // Rated Speed
N1 = N *(1 - s ) ; // Speed a t 4% s l i p
T4 = P *60/(2* %pi * N1 ) ; // T o t a l Torque a t 4% s l i p
sm = floor (( R2 / X2 ) *1000) /1000; // C o n d i t i o n f o r
Maximum Torque
Pmax =(( a * V1 ) ^2) * R2 *(1 - sm ) * sm /(( R2 ^2) +(( sm * X2 ) ^2) ) ; //
Power a t maximum t o r q u e
Nmax = ceil ( N *(1 - sm ) ) ; // Speed a t Maximum Torque
Tmax = Pmax *60/(2* %pi * Nmax ) ; // Maixmum Torque
// P l e a s e Note t h a t t h e a n s w e r s a r e a c c u r a t e and no
164

31
32
33
34
35

q u a n t i t i e s a r e n e g l e c t e d a s i n t h e t e x t book .
printf ( a ) T o t a l t o r q u e a t 4 p e r c e n t s l i p = %g Nm \n
, T4 )
printf ( b ) T o t a l M e c h a n i c a l Power a t 4 p e r c e n t s l i p
= %g w a t t s o r %g H . P \n ,P ,( P /735) )
printf ( c ) Maximum Torque = %g Nm \n , Tmax )
printf ( d ) Speed a t maximum t o r q u e = %g rpm \n , Nmax
)
printf ( e ) Maximum M e c h a n i c a l Power = %g w a t t o r %g
H . P \n , Pmax ,( Pmax /735) )

Scilab code Exa 8.4 Calculation of slip from losses


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// C a l c u l a t i o n o f s l i p from l o s s e s
clc ;
clear ;
eff =0.9; // E f f i c i e n c y
P =50*735; // Load i n w a t t s
x = poly ([0 1] , x , c ) ; // R o t o r Copper L o s s V a r i a b l e
tx =( x + x + x +( x /3) ) ; // T o t a l l o s s
loss =(( P + tx ) * eff ) -P ; // E q u a t i o n t o c a l c u l a t e x
x = roots ( loss ) ; // R o t o r Copper L o s s C o n s t a n t
s = poly ([0 1] , s , c ) ; // V a r i a b l e f o r s l i p
slip =( P * s ) -( x *(1 - s ) ) ; // G i v e s t h e v a r i a b l e e q u a t i o n
of s l i p

18
19 s = roots ( slip ) ; // N u m e r i c a l V a l u e o f s l i p
20
21 printf ( The s l i p o f an i n d u c t i o n motor o f

165

0.9

e f f i c i e n c y a t 50 HP l o a d = %g \n ,s )

Scilab code Exa 8.5 apping of an auto transformer to limit current in


squirrel cage motor
1
2
3
4
5
6
7
8
9
10

// Tapping o f an a u t o t r a n s f o r m e r t o l i m i t c u r r e n t i n
s q u i r r e l c a g e motor
clc ;
clear ;

V =400; // L i n e t o l i n e v o l t a g e
Vph = V / sqrt (3) ; // Phase v o l t a g e
Z =1.54; // S t a n d s t i l l i m p e d a n c e
Ifl =30; // F u l l Load C u r r e n t
Imax =75; // Max c u r r e n t which can be t a k e n by t h e
line
11 s =4/100; // F u l l l o a d s l i p
12
13 t = poly ([0 1] , t , c ) ; // V a r i a b l e

for tapping

p e r c e n t o f normal v o l t a g e
14
15 Is = t *( Vph /(100* Z ) ) ; // S t a r t i n g c u r r e n t i n t h e motor
16
17 Ias =( t /100) * Is ; // C u r r e n t on s u p p l y s i d e o f t h e

auto t r a n s f o r m e r
18
19 Tap = Ias - Imax ; // E q u a t i o n t o f i n d t
20
21 t = roots ( Tap ) ; // N u m e r i c a l V a l u e f o r t
22
23 if ( imag ( sqrt ( t (1) ) ) )
24
t = t (2) ;
25 else
26
t = t (1) ;

166

27 end
28
29
30 Ism = Imax *100/ t ; // S t a r t i n g

c u r r e n t i n t h e motor (

Numerical Value )
31
32 st =(( Ism / Ifl ) ^2) * s ; // S t a r t i n g

torque to f u l l load

torque r a t i o
33
34
35
36

printf ( The t a p p i n g p r o v i d e d t o t h e a u t o t r a n s f o r m e r
= %g p e r c e n t o f Normal V o l t a g e \n ,t )
printf ( The s t a r t i n g t o r q u e a v a i l a b l e i s %g t i m e s
t h e f u l l l o a d t o r q u e \n , st )

Scilab code Exa 8.6 To find the total mechannical power and rotor copper
loss
1
2
3
4
5
6
7
8
9
10
11

//To f i n d t h e t o t a l m e c h a n n i c a l power and r o t o r


copper l o s s
clc ;
clear ;
P =60*(10^3) ; // Power i n p u t
Pstat =1*(10^3) ; // S t a t o r L o s s e s
Pirot =P - Pstat ; // R o t o r I n p u t
s =3/100; // Running s l i p

Prc = poly ([0 1] , Prc , c ) ; // V a r i a b l e f o r r o t o r


copper l o s s
12 // Prc = I 2 2 R2
13
14
15

rloss =( Pirot * s ) -(3* Prc ) ;

167

16 Prc = roots ( rloss ) ; // N u m e r i c a l V a l u e o f

rotor loss

per phase ;
17
18 Pm = Pirot -(3* Prc ) ; // M e c h a n i c a l power d e v e l o p e d
19
20 printf ( The r o t o r l o s s p e r p h a s e = %g W \n , Prc )
21 printf ( The M e c h a n i c a l Power d e v e l o p e d = %g kW \n ,

Pm /1000)

Scilab code Exa 8.7 To determine the starting torque and current using
different starters
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// To d e t e r m i n e t h e s t a r t i n g t o r q u e and c u r r e n t
using d i f f e r e n t s t a r t e r s
clc ;
clear ;
// Rated P a r a m e t e r s o f t h e motor
V =400; // D e l t a c o n n e c t e d
P =50*735.5; // Power d e v e l o p e d
N =750; // Speed
Ifl =50; // F u l l Load c u r r e n t
Z =2.5; // Impedance p e r p h a s e
sf =4.5/100; // S l i p
f =50;
Tfl = P *60/(2* %pi * N ) ;
deff ( y=c u r r ( x ) , y=( s q r t ( 3 ) ) x /Z ) ;
deff ( a=s t o r ( b ) , a =(( b / I f l ) 2 ) s f T f l ) ;
// Case 1
168

23
24
25
26
27
28
29
30
31
32
33

I1 = curr ( V ) ;
T1 = stor ( I1 ) ;
// Case 2
I3 = curr (70* V /100) ;
T3 = stor ( I3 ) ;
T2 = Tfl *((1/ sqrt (3) ) ^2) ; // Case 2 t o r q u e
I2 = I1 ;
printf ( The s t a r t i n g t o r q u e and t h e s t a r t i n g c u r r e n t
u s i n g d i f f e r e n t s t a r t e r s a r e : \n )

34
35
36

printf ( i ) D . O . L s t a r t e r = %g Nm and %g A \n ,T1 , I1 )


printf ( i i ) S t a r d e l t a s t a r t e r = %g Nm and %g A \n ,
T2 , I2 )
37 printf ( i i i ) An a u t o t r a n s f o r m e r s t a r t e r w i t h 70
p e r c e n t t a p p i n g = %g Nm and %g A \n ,T3 , I3 )

Scilab code Exa 8.8 To actual rotor speed and the rotor frequency at 3
percent slip
1
2
3
4
5
6
7
8
9
10
11
12

// To a c t u a l r o t o r s p e e d and t h e r o t o r f r e q u e n c y a t
3 percent s l i p
clc ;
clear ;
P =2;
f =50;
V =400;
Vph = V / sqrt (3) ;
s =3/100;
Ns =120* f / P ;
169

13
14 Nr = Ns *(1 - s ) ;
15
16 rf = s * f ; // R o t o r F r e q u e n c y
17
18 printf ( The A c t u a l r o t o r s p e e d = %g rpm \n , Nr )
19 printf ( The r o t o r f r e q u e n c y = %g Hz \n , rf )

Scilab code Exa 8.9 To determine the various parameters of a 3 phase


400V 6 poles Induction Motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// To d e t e r m i n e t h e v a r i o u s p a r a m e t e r s o f a 3 p h a s e
400V 6 p o l e s I n d u c t i o n Motor
clc ;
clear ;
f =50;
p =6;
s =3/100;
V =400;
N =120* f / p ; // S y n c h r o n o u s s p e e d
Ns =0; // Speed o f s t a t o r
rf = s * f ; // R o t o r F r e q u e n c y
Nr = N *(1 - s ) ; // R o t o r s p e e d
Nrs =N - Ns ; // Speed o f R o t o r f i e l d wrt s t a t o r
Nrr =120* rf /6; // Speed o f r o t o r f i e l d wrt r o t o r
Nrmsm =0; // Speed o f r o t o r f i e l d wrt s t a t o r f i e l d

printf ( i ) The s p e e d o f t h e r o t o r = %g rpm \n , Nr )


printf ( i i ) The f r e q u e n c y o f r o t o r c u r r e n t = %g Hz \
n , rf )
21 printf ( i i i ) The Speed o f t h e r o t o r m a g n e t i c f i e l d w
. r . t t h e s t a t o r = %g rpm \n , Nrs )
170

printf ( i v ) The s p e e d o f t h e r o t o r m a g n e t i c f i e l d w .
r . t t h e r o t o r = %g rpm \n , Nrr )
23 printf ( v ) The s p e e d o f t h e r o t o r m a g n e t i c f i e l d w . r
. t t h e s t a t o r m a g n e t i c f i e l d = %g rpm \n , Nrmsm )

22

Scilab code Exa 8.10 To determine parameters of an 3 phase delta connected 4 pole induction motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

//To d e t e r m i n e p a r a m e t e r s o f an 3 p h a s e d e l t a
c o n n e c t e d 4 p o l e i n d u c t i o n motor
clc ;
clear ;
V =440;
f =50;
p =4;
E2 =150;
Nr =1450;
Ns =120* f / p ;
s =( Ns - Nr ) / Ns ;
rf = s * f ; // R o t o r f r e q u e n c y
Eir = s * E2 ; // R o t o r i n d u c e d EMF p e r p h a s e
gc =1;
// To f i n d t h e GCD o f b o t h t h e v o l t a g e s
for i = E2 : -1:1
a = modulo (V , i ) ;
b = modulo ( E2 , i ) ;
if ( a ==0& b ==0)
gc = gc * i ;
171

27
break ;
28
end
29 end
30
31 printf ( The p a r a m e t e r s
32
33
34
35

f o r a motor r u n n i n g a t 1 4 5 0

rpm a r e \n )
printf ( i ) The s l i p = %g p e r c e n t \n ,s )
printf ( i i ) The f r e q u e n c y o f t h e r o t o r i n d u c e d EMF =
%g Hz \n , rf )
printf ( i i i ) The r o t o r i n d u c e d EMF p e r p h a s e = %g V
\n , Eir )
printf ( i v ) S t a t o r t o r o t o r t u r n r a t i o = %g : %g \n
,V / gc , E2 / gc )

Scilab code Exa 8.11 Determine the shaft power of 6 pole Induction Motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// D e t e r m i n e t h e s h a f t power o f 6 p o l e I n d u c t i o n
Motor
clc ;
clear ;
f =50;
p =6;
rf =120/60; // R o t o r F r e q u e n c y
T =150; // F u l l Load t o r q u e
s = rf / f ;
Ns =120* f / p ;
Nr = Ns *(1 - s ) ;
Ps =2* %pi * Nr * T /60; // S h a f t power
172

18
19

printf ( The s h a f t power o f t h e motor = %g kW \n , Ps


/1000)

Scilab code Exa 8.12 Motor parameters at a load power factor


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Motor p a r a m e t e r s a t a l o a d power f a c t o r
clc ;
clear ;
p =4;
f =50;
V =400;
pf =0.8;
Nr =1440;
Pm =20*(10^3) ; // M e c h a n i c a l Power D e v e l o p e d
Ns =120* f / p ;
s =( Ns - Nr ) / Ns ;
rf = s * f ; // R o t o r f r e q u e n c y
Pstat =1000; // S t a t o r L o s s
// Power i n p u t t o t h e r o t o r = M e c h a n i c a l Power
D e v e l o p e d / (1 s )

20
21 Pirot = Pm /(1 - s ) ; // R o t o r Power I n p u t
22
23 Pi = Pirot + Pstat ; // Power i n p u t t o s t a t o r
24
25 Il = Pi /( sqrt (3) * V * pf ) ; // L i n e C u r r e n t
26
27 printf ( For a 4 p o l e motor r u n n i n g a t 1 4 4 0 rpm and

0 . 8 p . f \n )
173

printf ( i ) R o t o r C u r r e n t f r e q u e n c y = %g Hz \n , rf )
printf ( i i ) T o t a l i n p u t i f s t a t o r l o s s i s 1 0 0 0W = %g
kW \n , Pi /1000)
30 printf ( i i i ) The l i n e c u r r e n t = %g A \n , Il )

28
29

Scilab code Exa 8.13 To determine the auto tranformer ratio and starting
torque
1
2
3
4
5
6
7
8
9
10
11

// To d e t e r m i n e t h e a u t o t r a n f o r m e r r a t i o and
s t a r t i n g torque
clc ;
clear ;
V =400;
f =50;
p =4;
sfl =4/100;

Ria =2.5; // R a t i o o f s t a r t i n g c u r r e n t t o f u l l l o a d
c u r r e n t ( Auto t r a n s f o r m e r )
12 Rir =4; // R a t i o o f s t a r t i n g c u r r e n t t o f u l l l o a d
c u r r e n t ( For t h e Rated V o l t a g e )
13
14 x = sqrt ( Ria / Rir ) ;
15
16 Rt =(( x * Rir ) ^2) * sfl ; // R a t i o o f

s t a r t i n g torque to

f u l l load torque ;
17
18
19

printf ( The auto t r a n s f o r m e r r a t i o = %g \n ,x )


printf ( The s t a r t i n g t o r q u e a t t h e a b o v e t r a n s f o r m e r
r a t i o = %g p e r c e n t o f f u l l l o a d t o r q u e \n ,100*
Rt )

174

Scilab code Exa 8.14 To determine the starting torque in terms of full
load torque
1

//To d e t e r m i n e t h e s t a r t i n g t o r q u e i n t e r m s o f f u l l
load torque

2
3 clc ;
4 clear ;
5
6 sfl =4/100;
7
8 Rir =5; // R a t i o o f

s t a r t i n g current to the f u l l load


current at rated voltage

9
10 x =70.7/100; // Auto t r a n s f o r m e r t a p p i n g
11
12 Rsd =(( Rir ) ^2) * sfl /3; // R a t i o o f t h e s t a r t i n g

load
to f u l l load torque f o r a s t a r d e l t a s t a r t e r

13
14 Ra =(( x * Rir ) ^2) * sfl ; // R a t i o o f t h e

s t a r t i n g load to
f u l l l o a d t o r q u e f o r an 7 0 . 7% t a p p e d a u t o
transformer

15
16

printf ( The s t a r t i n g t o r q u e i n t e r m s o f f u l l l o a d
t o r q u e by \n )
17 printf ( i ) S t a r D e l t a s t a r t e r = %g T f l \n , Rsd )
18 printf ( i i ) An auto t r a n f o r m e r s t a r t e r w i t h 7 0 . 7
p e r c e n t t a p p i n g = %g T f l \n , Ra )

Scilab code Exa 8.15 Stator input of 3 phase 4 pole induction motor
1

// S t a t o r i n p u t o f 3 p h a s e 4 p o l e i n d u c t i o n motor
175

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

clc ;
clear ;
p =4;
f =50;
Pd =4000; // Power D e v e l o p e d
Nr =1440;
Ps =320; // S t a t o r l o s s
Ns =120* f / p ;
s =( Ns - Nr ) / Ns ;
Pir = Pd /(1 - s ) ; // Power t o t h e r o t o r
Pi = Pir + Ps ; // The i n p u t t o t h e s t a t o r
printf ( The s t a t o r i n p u t o f a 440V 3 p h a s e 4 p o l e
i n d u c t i o n motor = %g W \n , ceil ( Pi ) )

Scilab code Exa 8.16 Motor parameters of a 6 pole motor with 40 hp mechanical power
1
2
3
4
5
6
7
8
9
10

// Motor p a r a m e t e r s o f a 6 p o l e motor w i t h 40 hp
m e c h a n i c a l power
clc ;
clear ;
f =50;
p =6;
Pd =40*735.5; // M e c h a n i c a l Power d e v e l o p e d
V =500;
Nr =960;
176

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

pf = 0.8; // Lag
Pm =1500; // M e c h a n i c a l L o s s
Ns =120* f / p ;
s =( Ns - Nr ) / Ns ;
Ps =1800; // S t a t o r L o s s
Po = Pd - Pm ; // Power Output
Pir = Pd /(1 - s ) ; // Power i n p u t t o r o t o r
Prc = s * Pir ; // Copper L o s s o f t h e R o t o r
Pi = Pir + Ps ; // Power i n p u t t o t h e s t a t o r
eff = Po *100/ Pi ;
Il = Pi /( sqrt (3) * V * pf ) ; // L i n e C u r r e n t
printf ( For a 6 p o l e 3 p h a s e motor a t 500V w i t h a
power f a c t o r o f 0 . 8 l a g \n )
printf ( i ) R o t o r Copper L o s s = %g W \n , Prc )
printf ( i i ) T o t a l i n p u t t o s t a t o r i f t h e s t a t o r l o s s
i s 1 5 0 0W = %g W \n , Pi )
printf ( i i i ) The l i n e C u r r e n t = %g A \n , Il )
printf ( i v ) E f f i c i e n c y = %g p e r c e n t \n , eff )

Scilab code Exa 8.17 To determine parameters of 4 pole induction motor


considering circuit parameters
1

//To d e t e r m i n e p a r a m e t e r s o f 4 p o l e i n d u c t i o n motor
considering c i r c u i t parameters

2
3 clc ;

177

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

clear ;
R1 =0.5;
R2 =0.35;
X1 =1.2;
X2 = X1 ;
Xm =25;
f =50;
p =4;
Pd =25*735.5; // Power D e v e l o p e d
Prl =800; // R o t a t i o n a l L o s s e s
V =400;
Vph = V / sqrt (3) ;
Ns =120* f / p ;
s =2.5/100;
Nr =(1 - s ) * Ns ;
rf = s * f ; // R o t o r F r e q u e n c y
Z1 = R1 +( %i * X1 ) ;
Z2 =( R2 / s ) +( %i * X2 ) ;
Zm = %i * Xm ;
Z2m =( Zm * Z2 ) /( Zm + Z2 ) ;
Zeff = Z1 + Z2m ; // E f f e c t i v e Impedance
Is = Vph / Zeff ; // S t a t o r C u r r e n t

Psc = 3*( abs ( Is ) ^2) * R1 ; // Copper L o s s i n t h e S t a t o r


Ztheta = atand ( imag ( Zeff ) / real ( Zeff ) ) ; // Phase a n g l e
o f impedance
36 Ctheta = atand ( imag ( Is ) / real ( Is ) ) ; // Phase a n g l e o f
current
37
38 pf = cosd ( Ctheta ) ; // L a g g i n g Power F a c t o r
39 Ir = Is *( Zm /( Zm + Z2 ) ) ; // R o t o r C u r r e n t

178

40
41 Prc = 3*( abs ( Ir ) ^2) * R2 ; // R o t o r Copper L o s s
42
43 Pim = sqrt (3) * V * abs ( Is ) * cosd ( Ctheta ) ; // Power i n p u t

t o t h e motor
44 Pom = Pim - Prc - Psc - Prl ; // Power Output t o t h e motor
45
46 eff = Pom *100/ Pim ; // E f f i c i e n c y
47
48 printf ( For a r o t o r s l i p o f 2 . 5
49
50
51
52

percent at rated

v o l t a g e and f r e q u e n c y \n ) ;
printf ( i ) The motor s p e e d = %g rpm \n , Nr )
printf ( i i ) The s t a t o r C u r r e n t = %g / %g A \n , abs (
Is ) , Ctheta )
printf ( i i i ) The p . f = %g l a g g i n g \n , pf )
printf ( i v ) The e f f i c i e n c y = %g p e r c e n t \n , eff )

Scilab code Exa 8.18 Stator Current and pf and efficiency of a motor operating at rated slip
1
2
3
4
5
6
7
8
9
10
11
12
13
14

// S t a t o r C u r r e n t and p f and e f f i c i e n c y o f a motor


operating at 0.03 s l i p
clc ;
clear ;
V =400;
Vph = V / sqrt (3) ;
R1 =0.2;
R2 =0.15;
X1 = %i *0.5;
X2 = %i *0.3;
s =3/100;

179

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

Ptl =2000; // T o t a l L o s s e s
Z1 = R1 + X1 ;
Z2 =( R2 / s ) + X2 ;
Zt = Z1 + Z2 ; // T o t a l Impedance o f t h e c i r c u i t
Is = Vph / Zt ; // S t a t o r C u r r e n t
Ctheta = atand ( imag ( Is ) / real ( Is ) ) ; // Phase a n g l e o f
stator current
pf = cosd ( Ctheta ) ; // Power f a c t o r l a g g i n g
Pi = sqrt (3) * V * abs ( Is ) * cosd ( Ctheta ) ;
Po = Pi - Ptl ; // Power Output
eff = Po *100/ Pi ;

printf ( For a 3 phase , 4 p o l e , 400V I n d u c t i o n Motor


o p e r a t i n g a t 3 p e r c e n t s l i p \n )
34 printf ( i ) The S t a t o r c u r r e n t = %g / %g A \n , abs ( Is
) , Ctheta )
35 printf ( i i ) The p . f = %g l a g g i n g \n , pf )
36 printf ( i i i ) The e f f i c i e n c y = %g p e r c e n t \n , eff )

180

Chapter 10
Power System

Scilab code Exa 10.1 Determine the additional load which can be supplied
1

// D e t e r m i n e t h e a d d i t i o n a l l o a d which can be
supplied

2
3 clc ;
4 clear ;
5
6 printf ( a ) D . C two w i r e : \ nPower t r a n s m i t t e d by DC

7
8
9
10
11
12
13
14

two w i r e = P and V o l t a g e b e t w e e n t h e w i r e s = V\n


)
printf ( Copper L o s s = 2 (P/V) 2 ) R ; where R i s t h e
r e s i s t a n c e o f e a c h w i r e \n )
printf ( Per U n i t L o s s = 2PR/ (V 2 ) \n\n )
printf ( b ) 3 p h a s e 3 w i r e : \ nPower t r a n s m i t t e d = P
\n )
printf ( I = P / ( s q r t ( 3 ) V) f o r u n i t y p . f \n )
printf ( Copper L o s s = 3 ( ( P / ( s q r t ( 3 ) V) ) 2 ) R = ( (
P/V) 2 ) R\n )
printf ( Per U n i t L o s s = P R/ (V 2 ) \n\n )
printf ( E q u a t i n g t h e p e r u n i t l o s s we have \n )
printf ( 2PR/ (V 2 ) = P R/ (V 2 ) o r P = 2P\n
181

Which p r o v e s t h a t 100 %% a d i t i o n a l pwer can be


s u p p l i e d by 3 p h a s e 3 w i r e s y s t e m \n )

Scilab code Exa 10.2 Pf at which the slow machine will work
1
2
3
4
5
6
7
8
9

// Pf a t which t h e s l o w machine w i l l work


clc ;
clear ;

pf1 =0.8; // Power F a c t o r Lag ( Combined )


Pa =2500*(10^3) ; // Combined Power
Pr = Pa *( tand ( acosd ( pf1 ) ) ) ; // Combined VAr
Pat =1000*(10^3) ; // A c t i v e power o f t h e t u r b o
a l t e r n a t o r u n i t y p f s o no VAr
10 Prt =0;
11 Pas = Pa - Pat ; // A c t i v e power o f t h e s l o w s p e e d
alternator
12 Prs = Pr - Prt ; // R e a c t i v e power o f t h e s l o w s p e e d
alternator
13
14
15
16
17
18

theta = atand ( Prs / Pas ) ; // Power F a c t o r A n g l e


powfac = cosd ( theta ) ; // Power f a c t o r
printf ( The Power F a c t o r o f t h e s l o w s p e e d
a l t e r n a t o r i s %g\n , powfac )

Scilab code Exa 10.3 Detemine the load and pf of the other machine
1 // Detemine t h e l o a d and p f o f t h e o t h e r machine
2
3 clc ;

182

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

clear ;
Pa =3000*(10^3) ; // L i g h t i n g l o a d
Pma =5000*(10^3) ; // A g g r e g a t e Motor l o a d
pfm =0.71; // power f a c t o r o f motor l o a d
P1a =5000*(10^3) ; // One Machine l o a d
pf1 =0.8; // Power f a c t o r machine 1 ( l a g g i n g )
Pta = Pa + Pma ; // T o t a l l o a d a c t i v e power r e q u i r e m e n t
// R e a c t i v e power
Pr =0; // L i g h t i n g
Pmr = Pma * tand ( acosd ( pfm ) ) ; // Motor
P1r = P1a * tand ( acosd ( pf1 ) ) ; // Machine 1
P2a = Pta - P1a ; // A c t i v e power by o t h e r machine
P2r = Pr + Pmr - P1r ; // R e a c t i v e power by o t h e r machine
pf2 = cosd ( atand ( P2r / P2a ) ) ; // Power f a c t o r o f o t h e r
machine
printf ( The o t h e r machine s u p p l i e s : \ n )
printf (
A l o a d o f %g kw a t a p . f o f %g\n , P2a
/1000 , pf2 )

Scilab code Exa 10.4 Determine the value of a shunt capacitor


1 // D e t e r m i n e t h e v a l u e o f a s h u n t c a p a c i t o r
2
3 clc ;
4 clear ;
5
6 V =440; // L i n e t o l i n e v o l t a g e

183

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

f =50; // F r e q u e n c y o f o p e r a t i o n
w =2* %pi * f ; // A n g u l a r f r e q u e n c y
Vph = V / sqrt (3) ; // Phase v o l t a g e
I =40; // Magnitude o f c u r r e n t
pfi =0.7; // L a g g i n g power f a c t o r o f t h e c u r r e n t
ti = acosd (0.7) ;
// I v=I ( expm ( %i1%pi t i / 1 8 0 ) ) ;
// For p f = 0 . 7
Pa = Vph * I * pfi ; // A c t i v e power
Pr = Vph * I * sind ( ti ) ; // R e a c t i v e power
// To g a i n a p f o f 0 . 9
pfn =0.9;
Pnr = Pa * tand ( acosd ( pfn ) ) ; // R e a c t i v e power a t p f o f
0.9

23
24 PRC = Pr - Pnr ; // VArs s u p p l i e d from t h e c a p a c i t o r
25
26 C = PRC /(( Vph ^2) * w ) ; // C a p a c i t a n c e r e q u i r e d t o meet

the condition
27
28

printf ( The v a l u e o f t h e s h u n t c a p a c i t o r s h o u l d
r a i s e t h e p f t o 0 . 9 = %g mF\n ,C *1000)

Scilab code Exa 10.5 Calculate the inductance of a choke to enable the
lamp
1

// C a l c u l a t e t h e i n d u c t a n c e o f a c h o k e t o e n a b l e t h e
lamp

2
3 clc ;
4 clear ;
5

184

6
7
8
9
10

P =500; // Power R a t i n g o f a d i s c h a r g e lamp


I =4; // C u r r e n t drawn by t h e lamp
w =2* %pi *50; // A n g u l a r f r e q u e n c y

Vdl = P / I ; // S u p p l y v o l t a g e f o r t h e p r o p e r w o r k i n g o f
t h e lamp
11 V =250; // AC s u p p l y v o l t a g e
12
13 // A c c o r d i n g t h e V o l t a g e t r i a n g l e
14
15 Vil = sqrt (( V ^2) -( Vdl ^2) ) ; // V o l t a g e d r o p a c r o s s

inductor
16
17 Xl = Vil / I ; // R e a c t a n c e
18 L = Xl / w ; // I n d u c t o r
19
20 Prl =( I ^2) * Xl ; // R e a c t i v e power r e q u i r e m e n t o f t h e

coke
21
22 C = Prl /(( V ^2) * w ) ; // C a p a c i t o r s u p p l y i n g t h e

n e c e s s a r y r e a c t i v e power
23
24

printf ( The i n d u c t a n c e t h a t s h o u l d be c o n n e c t e d i n
s e r i e s w i t h t h e lamp t o make i t work = %g mH\n ,L
*1000)
25 printf ( The c a p a c i t o r t h a t s h o u l d be c o n n e c t e d i n
p a r a l l e t o make t h e power f a c t o r u n i t y = %g mF \n
,C *1000)

185

Chapter 11
Domestic Wiring

Scilab code Exa 11.1 Determine the size of the conductor for power and
lighting circuit
1
2
3
4
5
6
7
8
9
10
11

// D e t e r m i n e t h e s i z e o f t h e c o n d u c t o r f o r power and
lighting circuit
clc ;
clear ;
P5 =3*800; // Load w a t t a g e i n 5A c i r c u i t
P15 =2*1500; // Load w a t t a g e i n 15 A c i r c u i t
Pt = P5 + P15 ; // T o t a l Load
// Assume a a v e r a g e o f 0 . 8 pf , common f o r
d i s t r i b u t i o n systems

12
13 pf =0.8;
14
15 V =230; // S u p p l y v o l t a g e
16

186

Figure 11.1: Determine the size of the conductor for power and lighting
circuit

187

Figure 11.2: Determine the size of the conductor at 25 m distance


17 I = Pt /( V * pf ) ; // C u r r e n t a t 230 s u p p l y
18
19 Isc =1.5* I ; // S h o r t C i r c u i t C u r r e n t
20
21 printf ( The C u r r e n t i s %g A and t h e s h o r t

circuit

c u r r e n t i s %g A\n\n ,I , Isc )
22 printf ( From t h e r e s u l t s h e e t p r o v i d e d a l o n g w i t h
t h i s code , \ n f o r aluminium w i r e t h e s i z e o f t h e
c o n d u c t o r comes o u t t o be 25 mm 2 . \ n I n f a c t f o r
43 A i t i s 16 mm2 but we s h o u l d a l w a y s go f o r
one h i g h e r s i z e o f t h e c o n d u c t o r \n and h e n c e we
s e l e c t c o n d u c t o r o f s i z e 25 mm2 o r 7 / 2 . 2 4 mm. )
23 printf ( \n \n R e f e r t h e t a b l e i n t h e r e s u l t s h e e t \n
)

188

Scilab code Exa 11.2 Determine the size of the conductor at 25 m distance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// D e t e r m i n e t h e s i z e o f t h e c o n d u c t o r a t 25 m
distance
clc ;
clear ;
V =230; // S u p p l y V o l t a g e
d =25; // D i s t a n c e b e t w e e n mains and r e s i d e n c e
I =5; // S u p p l y c u r r e n t
pvd =1+((2/100) * V ) ; // P e r m i s s i b l e V o l t a g e d r o p
// From t h e t a b l e g i v e n i n t h e r e s u l t s h e e t a l o n g
w i t h t h i s code , Minimum s i z e o f w i r e f o r 10A
A =1.5*(10^ -6) ;
dm =2.3;
Vd = d / dm ; // V o l t a g e d r o p a t 10A
Vd5 = Vd /2; // V o l t a g e d r o p a t 5A
// A c c o r d i n g t o t h e t a b l e ( R e f e r b e l o w ) P e r m i s s i b l e
drop i s 5 . 6 V

22
23
24
25

printf ( The p e m i s s i b l e v o l t a g e d r o p = %g V\n , pvd )


printf ( The v o l t a g e d r o p a t 5 A = %g V\n , Vd5 )
printf ( As t h e p e r m i s s i b l e d r o p i s 5 . 6 v o l t s \ nand
t h e c o n d u c t o r w i t h 1 . 5 mm2 s e c t i o n g i v e s \
n v o l t a g e drop o f 5 . 4 v o l t s hence the s u i t a b l e
s i z e i s 1 / 1 . 4 0 mm. )
26 printf ( \n \n R e f e r t h e t a b l e i n t h e r e s u l t s h e e t \n
189

Figure 11.3: Size of conductor to be used for wiring a 10 kW 400V 3 Phase


induction motor
)

Scilab code Exa 11.3 Size of conductor to be used for wiring a 10 kW


400V 3 Phase induction motor
1

// S i z e o f c o n d u c t o r t o be u s e d f o r w i r i n g a 10 kW
400V 3 Phase i n d u c t i o n motor

2
3 clc ;
4 clear ;
5
6 P =10*(10^3) ; // Power R a t i n g

190

7
8
9
10
11
12
13
14

V =400; // V o l t a g e R a t i n g
f =50; // F r e q u e n c y o f o p e r a t i o n
// A s s u m p t i o n s Made
eff =85/100; // E f f i c i e n c y
pf =0.8 // Power F a c t o r
I = P /( sqrt (3) * V * eff * pf ) ; // C u r r e n t f l o w i n g i n t h e
conductor

15
16 Is =2* I ; // At t h e t i m e o f

s t a r t i n g the induction
motor may t a k e 2 t i m e s t h e r a t e d c u r r e n t

17
18
19

20
21

printf ( The Rated C u r r e n t = %g A\n\n ,I )


printf ( At t h e t i m e o f s t a r t i n g t h e i n d u c t i o n motor
may t a k e \n 2 t i m e s t h e r a t e d c u r r e n t and h e n c e
s t a r t i n g c u r r e n t = %g A \n\n , Is )
printf ( From t h e t a b l e c o r r e s p o n d i n g t o 4 2 . 4 A t h a t
i s 43 A\n t h e w i r e u s e d i s 7 / 1 . 7 mm o r 16 mm
2.\n )

191

Chapter 12
DC Circuits

Scilab code Exa 12.1 To Compute the number of electrons


1
2
3
4
5
6
7
8
9
10
11
12

// To Compute t h e number o f e l e c t r o n s .
clc ;
clear ;
I =(25) *(10^ -3) ;
t =(30) *(10^ -3) ;
C=I*t;
// 1C = 6 . 2 4 2 ( 1 0 1 8 )
n = 6.242*(10^18) ;
e_s = C * n ;
disp ( e_s , The Number Of E l e c t r o n s p a s s i n g t h r o u g h
the person i s )

Scilab code Exa 12.2 Computing the Average lighting current


1 // Compute A v e r a g e l i g h t i n g
2 clc ;

192

current

3 clear ;
4
5 q =20;
6 t =(10) *(10^ -3) ;
7
8 // Coulomb s Law
9
10 I = q / t ;
11
12 disp ( a m p e r e s ,I , The A v e r a g e L i g h t n i n g c u r r e n t = )

Scilab code Exa 12.3 To Calculate the average voltage


1
2
3
4
5
6
7
8
9
10
11

// To C a l c u l a t e t h e a v e r a g e v o l t a g e .
clc ;
clear ;
W =500;
I =40;
t =15*(10^ -3) ;
V = W /( I * t ) ;
disp ( v o l t s ,V , The A v e r a g e v o l a t a g e a c r o s s t h e
terminals of the device = )

Scilab code Exa 12.4 Calculating resistance


1 // C a l c u l a t i n g
2 clc ;
3 clear ;
4

resistance .

193

5 L =2.5*(10^ -2) ; // Length o f

rectangular cross

section .
6 B =0.05*(10^ -2) ; // B r e a d t h o f
7
8
9
10
11
12
13
14
15

rectangular cross

section .
A=L*B;
l =1*(10^3) ;
p =1.724*(10^ -8) ;
R=p*l/A;
disp ( ohms ,R , The R e s i s t a n c e o f t h e c o p p e r s t r i p =
)

Scilab code Exa 12.5 Current Calculation using ohms law


1
2
3
4
5
6
7
8
9
10
11
12

// C u r r e n t C a l c u l a t i o n u s i n g ohm s law .
clc ;
clear ;
V =220;
R =80;
// U s i n g Ohm s Law V=I R
I=V/R;
disp ( a m p e r e s ,I , The Load C u r r e n t = )

Scilab code Exa 12.6 Determination of conductance in a short circuit


1

// D e t e r m i n a t i o n o f c o n d u c t a n c e o f a s h o r t c i r c u i t
194

2
3
4
5
6
7
8
9
10
11

clc ;
clear ;
V =120;
I =500;
G=I/V;
disp ( s i e m e n s ,G , The C o n d u c t a n c e = )

Scilab code Exa 12.7 Power Rating Calculation


1
2
3
4
5
6
7
8
9
10
11
12
13

// Power R a t i n g C a l c u l a t i o n
clc ;
clear ;
V =250;
I =15;
// Power E q u a t i o n o r Watt s Law P=V I .
P=V*I;
disp ( w a t t s ,P , The power r a t i n g o f t h e d e v i c e = )

Scilab code Exa 12.8 To calculate current ratings and maximum voltage
of a rated resistor
1

//To c a l c u l a t e c u r r e n t r a t i n g s and maximum v o l t a g e


of a rated r e s i s t o r .

195

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

clc ;
clear ;
P =1;
R =10*(10^3) ;
// U s i n g Power E q u a t i o n and Ohm s Law .
V = sqrt ( P * R ) ;
I = sqrt ( P / R ) ;
disp ( v o l t s ,V , The Maximum v o l t a g e o f t h e r e s i s t o r
=)
disp ( a m p e r e s ,I , The C u r r e n t r a t i n g o f t h e r e s i s t o r
=)

Scilab code Exa 12.9 Determine the output power of the motor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// D e t e r m i n e t h e o u t p u t o f t h e motor .
clc ;
clear ;
eff =80/100;
V =220;
I =8;
// Power E q u a t i o n P=V I
P = V * I ; // I n p u t Power
Pout = eff * P ; // Output Power
196

16
17

disp ( w a t t s , Pout , The o u t p u t power o f t h e motor = )

Scilab code Exa 12.10 Calculation of Current and power dissipated in resistors connected in series
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

// C a l c u l a t i o n o f C u r r e n t and power d i s s i p a t e d i n
r e s i s t o r s connected in s e r i e s .
clc ;
clear ;
R1 =100;
R2 =200;
R3 =300;
Rt = R1 + R2 + R3 ;
V =250;
//Ohm s Law V=I R
I = V / Rt ;
// Power L o s s E q u a t i o n P=( I 2 ) R
P1 =( I ^2) * R1 ;
P2 =( I ^2) * R2 ;
P3 =( I ^2) * R3 ;
Pt = P1 + P2 + P3 ;
P=V*I;
disp ( ohms ,Rt , The t o t a l r e s i s t a n c e i n t h e c i r c u i t
197

29
30
31
32
33
34

=)
disp ( a m p e r e s ,I , The C u r r e n t i n t h e c i r c u i t = )
disp ( w a t t s ,P1 , The power l o s s i n t h e 100 ohms
resistor =)
disp ( w a t t s ,P2 , The power l o s s i n t h e 200 ohms
resistor =)
disp ( w a t t s ,P3 , The power l o s s i n t h e 300 ohms
resistor =)
disp ( w a t t s ,Pt , The t o t a l power l o s s i n t h e c i r c u i t
=)
disp ( w a t t s ,P , The power l o s s i n t h e c i r c u i t ( u s i n g
P=V I ) = )

Scilab code Exa 12.11 To find the value of the unknown resitance in the
series of resistances in a circuit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// To f i n d t h e v a l u e o f t h e unknown r e s i t a n c e i n t h e
s e r i e s of r e s i s t a n c e s in a c i r c u i t .
clc ;
clear ;
R1 =20;
V =220;
P =50;
R = poly ([0 1] , R , c ) ;
Rt = R1 + R ;
I = V / Rt ;
A =( I ^2) * R ; // To g e t t h e c h a r a c t e r i s t i c e q a u t i o n t o
f i n d R.
198

18
19
20
21
22
23

B =A -50;
C = B (2) ;
rts = roots ( C ) ; // To f i n d t h e two r e s i s t a n c e s
R = round (10000.* rts ) ./10000; // Rounding o f f t o f o u r
decimal points .

24
25 Rt = R1 + R ; // T o t a l r e s i s t a n c e
26
27 I = V ./ Rt ; // C u r r e n t s
28
29 pow =( I .^2) *( R ) ;
30
31 power = diag ( pow ) ;
32
33 disp ( B (2) , The C h a r a c t e r i s t i c

polynomial to f i n d
r e s i s t a n c e R equated to zero i s )

34
35
36
37

38
39
40
41

42
43

disp ( ohms ,R , The s o l u t i o n o f t h e a b o v e e q u a t i o n


y i e l d s two r e s i s t a n c e s )
disp ( Now t o c h e c k which r e s i s t a n c e i s s u i t a b l e by
f i n d i n g o u t t h e power d i s s i p a t e d by e a c h o f them
)
disp ( w a t t s , power , The Power d i s s i p a t e d by b o t h t h e
r e s i s t o r s are )
disp ( ohms ,R (1) , From c o m p a r i s o n w i t h t h e g i v e n
v a l u e ( 5 0 w a t t s ) , We f i n d t h a t t h e s u i t a b l e
resistance is )
// The h i g h e r r e s i s t a n c e i s p r e f e r r e d b e c a u s e i t
l i m i t s t h e amount o f c u r r e n t , ( P l e a s e s e e t h e
current r a t i n g s of the r e s i s t o r s ( Heating e f f e c t )
)

199

Scilab code Exa 12.12 To Compute the resistance when operating voltage
is altered
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// To Compute t h e r e s i s t o r , when o p e r a t i n g v o l t a g e
is altered .
clc ;
clear ;
V =120;
P =100;
Rd =( V ^2) / P ;
Vr =80; // Reduced v o l t a g e
Ir = Vr / Rd ; // Reduced c u r r e n t
Rt = V / Ir ; // The T o t a l R e s i s t a n c e r e q u i r e d t o
c i r c u l a t e the reduced current .

16
17 Re = Rt - Rd ; // E x t e r n a l r e s i s t a n c e r e q u i r e d .
18
19 disp ( ohms ,Re , The e x t e r n a l r e s i s t a n c e r e q u i r e d t o

be c o n n e c t e d i n s e r i e s t o o p e r a t e a t 80V )

Scilab code Exa 12.13 To Determine the voltage and branch currents in
a cicuit with resistors connected in parallel
1

// To D e t e r m i n e t h e v o l t a g e and b r a n c h c u r r e n t s i n a
c i c u i t with r e s i s t o r s connected in p a r a l l e l

200

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

clc ;
clear ;
R1 =750;
R2 =600;
R3 =200;
C1 =1/ R1 ;
C2 =1/ R2 ;
C3 =1/ R3 ;
C = C1 + C2 + C3 ; // T o t a l C o n d u c t a n c e
I =1;
// 1/C i s t o t a l r e s i s t a n c e R , We u s e Ohm s Law t o
f i n d the voltage applied .
V = I / C ; // V=I R
// Branch C u r r e n t s
I1 = V / R1 ;
I2 = V / R2 ;
I3 = V / R3 ;

disp ( v o l t s ,V , The a p p l i e d v o l t a g e = )
disp ( a m p e r e s ,I1 , The C u r r e n t t h r o u g h 750 ohm
Resistor =)
29 disp ( a m p e r e s ,I1 , The C u r r e n t t h r o u g h 600 ohm
Resistor =)
30 disp ( a m p e r e s ,I1 , The C u r r e n t t h r o u g h 200 ohm
Resistor =)
31 disp ( amperes , Hence V e r i f i e d . ,( I1 + I2 + I3 ) , The
Total Current through the c i r c u i t = )

201

Scilab code Exa 12.14 To determine resistances in parallel


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// To d e t e r m i n e r e s i s t a n c e s i n p a r a l l e l .
clc ;
clear ;
I =25;
V =200;
P1 =1500;
// V o l t a g e r e m a i n s t h e same i n b o t h t h e c o i l s .
// Power E q u a t i o n and Ohm s Law i s b e i n g
incorporated .
I1 = P1 / V ;
R1 = V / I1 ;
I2 =I - I1 ;
R2 = V / I2 ;
disp ( ohms ,R1 , The r e s i s t a n c e o f c o i l 1 = )
disp ( ohms ,R2 , The r e s i s t a n c e o f c o i l 2 = )

Scilab code Exa 12.15 To determine the currents in parallel branches of


a network
1

// To d e t e r m i n e t h e c u r r e n t s i n p a r a l l e l b r a n c h e s o f
a network .

2
3 clc ;
4 clear ;
5

202

6
7
8
9
10
11
12
13
14
15
16
17

I =40;
R1 =20;
R2 =60;
// C u r r e n t D i v i d e r e q u a t i o n I 1= I ( R2 / ( R1+R2 ) )
I1 = I *( R2 /( R1 + R2 ) ) ;
I2 = I *( R1 /( R1 + R2 ) ) ;
disp ( A ,I1 , The C u r r e n t i n t h e 20 ohm b r a n c h = )
disp ( A ,I2 , The C u r r e n t i n t h e 60 ohm b r a n c h = )

Scilab code Exa 12.16 To determine current through each resistor in series and parallel combinational circuit
1
2
3
4
5
6
7
8
9
10

// To d e t e r m i n e c u r r e n t t h r o u g h e a c h r e s i s t o r i n
s e r i e s and p a r a l l e l c o m b i n a t i o n a l c i r c u i t
clc ;
clear ;
R =10;
R1 =20;
R2 =30;
// R i s t h e r e s i s t a n c e i n s e r i e s w i t h t h e p a r a l l e l
c o m b i n a t i o n o f R1 and R2 .

11
12 V =100;
13
14 Reff =( R1 * R2 ) /( R1 + R2 ) ;
15
16 Rt = R + Reff ;
17

203

18
19
20
21
22
23
24
25

I = V / Rt ;
V1 = I * R ; // V o l t a g e d r o p a c r o s s 10 ohm r e s i s t o r .
I1 = I *( R2 /( R1 + R2 ) ) ;
I2 = I *( R1 /( R1 + R2 ) ) ;

disp ( ohms ,Rt , The t o t a l r e s i s t a n c e o f t h e n e t w o r k


=)
26 disp ( A ,I , The c u r r e n t t h r o u g h 10 ohm r e s i s t o r = )
27 disp ( A ,I1 , The c u r r e n t t h r o u g h 20 ohm r e s i s t o r = )
28 disp ( A ,I2 , The c u r r e n t t h r o u g h 30 ohm r e s i s t o r = )

Scilab code Exa 12.17 To calculate current in each branch of the given
network
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// To c a l c u l a t e c u r r e n t i n e a c h b r a n c h o f t h e g i v e n
network .
clc ;
clear ;

// R e f e r d i a g r a m ( a ) i n t h e book
R1 =6; // one o f t h e r e s i s t a n c e b e t w e e n a and b
R2 =3; // one o f t h e r e s i s t a n c e b e t w e e n a and b
R3 =8; // r e s i s t a n c e b e t w e e n c and a
R4 =15; // r e s i s t a n c e i n t h e m i d d l e b r a n c h
R5 =4; // r e s i s t a n c e b e t w e e n d and e
V =40;
Rab =( R1 * R2 ) /( R1 + R2 ) ; // E f f e c t i v e r e s i s t a n c e b e t w e e n
a and b
204

18
19 Rcb = Rab + R3 ; // E f f e c t i v e

r e s i s t a n c e o f the top

b r a n c h b e t w e e n c and b
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

Reff =( Rcb * R4 ) /( Rcb + R4 ) ;


Rt = Reff + R5 ;
I = V / Rt ;
I1 = I *( Rcb /( Rcb + R4 ) ) ;
I2 = I *( R4 /( Rcb + R4 ) ) ;
I3 = I2 *( R2 /( R1 + R2 ) ) ;
I4 = I2 *( R1 /( R1 + R2 ) ) ;
disp ( a m p e r e s ,I , The c u r r e n t t h r o u g h 4 ohm r e s i s t o r
=)
disp ( a m p e r e s ,I1 , The c u r r e n t t h r o u g h 15 ohm
resistor =)
disp ( a m p e r e s ,I2 , The c u r r e n t t h r o u g h 8 ohm
resistor =)
disp ( a m p e r e s ,I4 , The c u r r e n t t h r o u g h 3 ohm
resistor =)
disp ( a m p e r e s ,I3 , The c u r r e n t t h r o u g h 6 ohm
resistor =)

Scilab code Exa 12.18 To determine the current using loop analysis
1 // To d e t e r m i n e t h e c u r r e n t u s i n g l o o p
2
3 clc ;
4 clear ;

205

analysis

5
6 // MESH E q u a t i o n s
7 // 6 i 1 2 i 2 =30
8 // 2 i 1 +6 i 2 =40
9
10 R =[6 -2; -2 6];
11 E =[30; -40];
12
13 // The Loop C u r r e n t s
14
15 I = inv ( R ) * E ; // M a t r i x Method t o s o l v e

f o r two

unknowns i n two e a q u a t i o n s .
16
17 i1 = I (1) ;
18 i2 = I (2) ;
19 i3 = i1 - i2 ;
20
21 disp ( A ,i2 , i 2 = , A ,i1 , i 1 = , The C a l c u l a t e d

Loop C u r r e n t s a r e )
22
23

24
25
26
27
28
29
30
31
32
33

disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed


d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d .
)
if ( i1 <0) ;
i1 = abs ( i1 ) ;
end
if ( i2 <0) ;
i2 = abs ( i2 ) ;
end

disp ( A ,i1 , The C u r r e n t t h r o u g h 4 ohm r e s i s t o r on


t h e 30V s i d e = )
34 disp ( A ,i2 , The C u r r e n t t h r o u g h 4 ohm r e s i s t o r on
t h e 40V s i d e = )
35 disp ( A ,i3 , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r = )

206

Scilab code Exa 12.19 To calculate current in each branch using loop
analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// To c a l c u l a t e c u r r e n t i n e a c h b r a n c h u s i n g l o o p
analysis .
clc ;
clear ;
// MESH E q u a t i o n s f o r t h e g i v e n n e t w o r k .
// 3 i 1 i 2 +0 i 3 =11
// i 1 +10 i 2 2 i 3 =0
// 0 i 1 +2 i 2 +5 i 3 =13
// V o l t a g e s u p p l i e s a r e 11V and 13V
R =[3 -1 0; -1 10 -2; 0 -2 5];
E =[11;0;13];
// Loop C u r r e n t s
I = inv ( R ) * E ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
ia = i1 - i2 ; // Assumed d i r e c t i o n from Mesh 1
ib = i2 - i3 ; // Assumed d i r e c t i o n from Mesh 2
disp ( A ,ib , i b ( t h r o u g h 2 r e s i s t o r b e t w e e n 7 ohm
and 3 ohm r e s i s t o r ) = , A ,ia , i a ( t h r o u g h 1 ohm
r e s i s t o r ) = , A ,i3 , i 3 = , A ,i2 , i 2 = , A ,i1 ,
i 1 = , The C a l c u l a t e d Loop C u r r e n t s a r e )
207

28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed


d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d
)
// To o b t a i n t h e m a g n i t u d e o f d i r e c t i o n .
if ( i1 <0)
i1 = abs ( i1 ) ;
end
if ( i2 <0)
i2 = abs ( i2 ) ;
end
if ( i3 <0)
i3 = abs ( i3 ) ;
end
if ( ia <0)
ia = abs ( ia ) ;
end
if ( ib <0)
ib = abs ( ib ) ;
end
disp ( A ,i1 , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r
t h e 11V s i d e = )
disp ( A ,i2 , The C u r r e n t t h r o u g h 7 ohm r e s i s t o r
disp ( A ,i3 , The C u r r e n t t h r o u g h 3 ohm r e s i s t o r
t h e 13V s i d e = )
disp ( A ,ia , The C u r r e n t t h r o u g h 1 ohm r e s i s t o r
disp ( A ,ib , The C u r r e n t t h r o u g h 2 ohm r e s i s t o r
b e t w e e n t h e 7 and 3 ohm r e s i s t o r s = )

on
=)
on
=)

Scilab code Exa 12.20 To calculate current in each branch using loop
analysis and point voltages in a given network

208

// To c a l c u l a t e c u r r e n t i n e a c h b r a n c h u s i n g l o o p
a n a l y s i s and p o i n t v o l t a g e s i n a g i v e n n e t w o r k .

2
3 clc ;
4 clear ;
5
6 // MESH E q u a t i o n s f o r t h e g i v e n n e t w o r k .
7 // 3 . 9 5 i 1 3.75 i 2 +0 i 3 =120
8 // 3.75 i 1 +9.5 i 2 5.45 i 3 =0
9 // 0 i 1 5.45 i 2 +5 .55 i 3 =110
10
11 // P o s i t i v e o f 120V DC s u p p l y c o n n e c t e d t o 0 . 2 ohm

resistor
12 // P o s i t i v e o f 110 DC s u p p l y c o n n e c t e d t o 0 . 1 ohm
resistor
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

// V o l t a g e s u p p l i e s a r e 120V and 110V


R =[3.95 -3.75 0; -3.75 9.5 -5.45; 0 -5.45 5.55];
E =[120;0; -110];
R1 = abs ( R (2) ) ; // R e s i s t o r c a r r y i n g i a
R2 = abs ( R (8) ) ; // R e s i s t o r c a r r y i n g i b
// Loop C u r r e n t s
I = inv ( R ) * E ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
ia = i1 - i2 ; // Assumed d i r e c t i o n from Mesh 1
ib = i2 - i3 ; // Assumed d i r e c t i o n from Mesh 2
// U s i n g Nodal A n a l y s i s t o f i n d V1 and V2 .
V1 = R1 * ia ;
V2 = R2 * ib ;
209

36
37

38
39

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

disp ( A ,ib , i b ( t h r o u g h 2 r e s i s t o r b e t w e e n 7 ohm


and 3 ohm r e s i s t o r ) = , A ,ia , i a ( t h r o u g h 1 ohm
r e s i s t o r ) = , A ,i3 , i 3 = , A ,i2 , i 2 = , A ,i1 ,
i 1 = , The C a l c u l a t e d Loop C u r r e n t s a r e )
disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed
d i r e c t i o n o f f l o w o f c u r r e n t s h o u l d be r e v e r e s e d
)
// To o b t a i n t h e m a g n i t u d e o f d i r e c t i o n .
if ( i1 <0)
i1 = abs ( i1 ) ;
end
if ( i2 <0)
i2 = abs ( i2 ) ;
end
if ( i3 <0)
i3 = abs ( i3 ) ;
end
if ( ia <0)
ia = abs ( ia ) ;
end
if ( ib <0)
ib = abs ( ib ) ;
end
disp ( A ,i1 , The
t h e 120V s i d e
disp ( A ,i2 , The
)
disp ( A ,i3 , The
t h e 110V s i d e
disp ( A ,ia , The
)
disp ( A ,ib , The
)

C u r r e n t t h r o u g h 0 . 2 ohm r e s i s t o r on
=)
C u r r e n t t h r o u g h 0 . 3 ohm r e s i s t o r =
C u r r e n t t h r o u g h 0 . 1 ohm r e s i s t o r on
=)
C u r r e n t t h r o u g h 3 . 7 5 ohm r e s i s t o r =
C u r r e n t t h r o u g h 5 . 4 5 ohm r e s i s t o r =

210

64
65
66

disp ( V ,V1 , The v o l t a g e V1 = )


disp ( V ,V2 , The v o l t a g e V2 = )

Scilab code Exa 12.21 To calculate current from a battery and pd across
points A and B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// To c a l c u l a t e c u r r e n t from a b a t t e r y and pd a c r o s s
p o i n t s A and B
clc ;
clear ;
// R e s i s t a n c e s i n t h e g i v e n n e t w o r k
R1 =4;
R2 =2;
R3 =3;
R4 =6;
R5 =8;
// MESH E q u a t i o n s
// 9 i 1 5 i 2 =10
// 5 i 1 +19 i 2 =0
// S u p p l y v o l t a g e 10V
R =[( R1 + R2 + R3 ) -( R2 + R3 ) ; -( R2 + R3 ) ( R2 + R3 + R4 + R5 ) ];
V =[10;0];
// Loop C u r r e n t s
I = inv ( R ) * V ;
i1 = I (1) ;
i2 = I (2) ;

211

28 i3 = i1 - i2 ; // From Mesh 1
29
30 // P o i n t V o l t a g e s
31 Va = i3 * R3 ;
32 Vb = i2 * R5 ;
33
34 disp ( a m p e r e s , abs ( i1 ) , The c u r r e n t t h r o u g h 4 ohm

r e s i s t o r and t h e b a t t e r y = )
35 disp ( a m p e r e s , abs ( i2 ) , The c u r r e n t t h r o u g h 6 ohm
and 8 ohm r e s i s t o r s = )
36 disp ( a m p e r e s , abs ( i3 ) , The c u r r e n t t h r o u g h 2 ohm
and 3 ohm r e s i s t o r s = )
37
38
39
40

disp ( v o l t s , abs ( Va ) , The v o l t a g e a t p o i n t A = )


disp ( v o l t s , abs ( Vb ) , The v o l t a g e a t p o i n t B = )
disp ( v o l t s ,( Va - Vb ) , The v o l t a g e a c r o s s P o i n t s A
and B = )

Scilab code Exa 12.22 Determine Current through branch AB of the given
network
1

// D e t e r m i n e C u r r e n t t h r o u g h b r a n c h AB o f t h e g i v e n
network

2
3 clc ;
4 clear ;
5
6 // MESH E q u a t i o n s
7 // 4 i 1 2 i 2 +0 i 3 =10
8 // 2 i 1 +6 i 2 2 i 3 =0
9 // 0 i 1 2 i 2 +6 i 3 =0
10
11 // S u p p l y V o l t a g e i s 10V ( Note p r i n t i n g
12
13 R =[4 -2 0; -2 6 -2; 0 -2 6];

212

mistake )

14
15
16
17
18
19
20
21
22
23
24

V =[10;0;0];
// Loop C u r r e n t s
I = inv ( R ) * V ;
i1 = I (1) ;
i2 = I (2) ;
i3 = I (3) ;
disp ( a m p e r e s , abs ( i2 ) , The c u r r e n t t h r o u g h b r a n c h
AB o f t h e n e t w o r k = )

Scilab code Exa 12.23 Determine the current in the branches of the network using nodal analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// D e t e r m i n e t h e c u r r e n t i n t h e b r a n c h e s o f t h e
network u s i n g nodal a n a l y s i s
clc ;
clear ;
// S u p p l y v o l t a g e s
V1 =30;
V2 =40;
// R e s i s t a n c e s i n t h e n e t w o r k
R1 =4;
R2 =2;
R3 =4;
Vb = poly ([0 1] , Vb , c ) ;
AD =( V1 - Vb ) / R1 ;
BD =( V2 - Vb ) / R3 ;
213

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

CD = Vb / R2 ;
X = AD + BD - CD ;
disp ( The C h a r a c t e r i c t i c E q u a t i o n t o f i n d Vb i s )
disp ( CD , = ,AD ,

+ , BD )

Vb = roots ( X ) ; // S t o r e s t h e n u m e r i c a l v a l u e o f Vb
i1 =( V1 - Vb ) / R1 ;
i2 =( V2 - Vb ) / R3 ;
i3 = Vb / R2 ;

disp ( a m p e r e s ,i1 , C u r r e n t t h r o u g h 4 ohm r e s i s t o r on


t h e 30V s u p p l y s i d e = )
34 disp ( a m p e r e s ,i2 , C u r r e n t t h r o u g h 4 ohm r e s i s t o r on
t h e 40V s u p p l y s i d e = )
35 disp ( a m p e r e s ,i3 , C u r r e n t t h r o u g h 2 ohm r e s i s t o r =
)

Scilab code Exa 12.24 To Calculate current in all branches of the network
shown using nodal analysis
1

// To C a l c u l a t e c u r r e n t i n a l l b r a n c h e s o f t h e
n e t w o r k shown u s i n g n o d a l a n a l y s i s

2
3 clc ;
4 clear ;
5
6 // Nodal E q u a t i o n s
7 // 13Va4Vb=300
8 //Va+4Vb=120
9
10 X =[13 -4; -1 4];

214

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

V =[300;120];
E = inv ( X ) * V ;
Va = E (1) ;
Vb = E (2) ;
i1 =(100 - Va ) /20;
i2 =( Va - Vb ) /15;
i3 =( Va /10) ;
i4 =( Vb /10) ;
i5 =(80 - Vb ) /10;
disp ( V ,Vb , V o l t a g e Vb = , V ,Va , V o l t a g e Va = )
disp ( The Branch C u r r e n t s a s c a l c u l a t e d a r e )
disp ( i5 , i 5 ,i4 , i 4 ,i3 , i 3 ,i2 , i 2 ,i1 , i 1 )
disp ( a m p e r e s r e s p e c t i v e l y )
disp ( The N e g a t i v e s i g n i n d i c a t e s t h a t t h e assumed
d i r e c t i o n o f f l o w o f c u r r e n t must be r e v e r e s e d )
disp ( a m p e r e s , abs ( i1 ) , The C u r r e n t
r e s i s t o r on t h e 100V s i d e = )
disp ( a m p e r e s , abs ( i2 ) , The C u r r e n t
resistor =)
disp ( a m p e r e s , abs ( i3 ) , The C u r r e n t
r e s i s t o r (AE) = )
disp ( a m p e r e s , abs ( i4 ) , The C u r r e n t
r e s i s t o r (BE) = )
disp ( a m p e r e s , abs ( i5 ) , The C u r r e n t
r e s i s t o r on t h e 80V s i d e = )

215

t h r o u g h 20 ohm
t h r o u g h 15 ohm
t h r o u g h 10 ohm
t h r o u g h 10 ohm
t h r o u g h 10 ohm

Chapter 13
Electromagnetic Induction

Scilab code Exa 13.1 Computing Induced EMF


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Computing I n d u c e d EMF
clc ;
clear ;
l =0.5;
v =50;
b =1;
// A n g l e s
x =90;
y =30;
z =0;
// EMFs
e1 = b * l * v *( sind ( x ) ) ;
e2 = b * l * v *( sind ( y ) ) ;
e3 = b * l * v *( sind ( z ) ) ;
disp ( v o l t s ,e1 , i )
to the f i e l d )

The I n d u c e d EMF p e r p e n d i c u l a r

216

disp ( v o l t s ,e2 , i i ) The I n d u c e d EMF a t an a n g l e 30


degrees to the f i e l d )
22 disp ( v o l t s ,e3 , i i i ) The I n d u c e d EMF p a r a l l e l t o t h e
field )
21

Scilab code Exa 13.2 Computing Instantaneous Induced EMF


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

// Computing I n s t a n t a n e o u s I n d u c e d EMF
clc ;
clear ;
l =0.2;
n =1000;
b =0.5;
r = l /2;
t =200;
// Number o f c o n d u c t o r s
c =2* t ;
// V e l o c i t y E q u a t i o n .
v =2*( %pi ) * r *1000/60;
// A n g l e s
x =90;
y =30;
z =0;
// EMFs
e1 = c * b * l * v *( sind (90 - x ) ) ;
e2 = c * b * l * v *( sind (90 - y ) ) ;
e3 = c * b * l * v *( sind (90 - z ) ) ;
disp ( v o l t s ,e1 , i )

The I n d u c e d EMF p e r p e n d i c u l a r
217

to the f i e l d )
29 disp ( v o l t s ,e2 , i i ) The I n d u c e d EMF a t an a n g l e 30
degrees to the f i e l d )
30 disp ( v o l t s ,e3 , i i i ) The I n d u c e d EMF p a r a l l e l t o t h e
field )

Scilab code Exa 13.3 EMF Induced between wing tips


1
2
3
4
5
6
7
8
9
10
11

// EMF I n d u c e d b e t w e e n wing t i p s .
clc ;
clear ;
l =6.1;
vel =800;
v = vel *1000/3600;
b =(50) *(10^ -6) ;
e=b*l*v;
disp ( v o l t s ,e , The EMF i n d u c e d b e t w e e n t h e wing
t i p s= )

Scilab code Exa 13.4 EMF generated due to a bar magnet


1
2
3
4
5
6
7
8
9
10

// EMF g e n e r a t e d due t o a b a r magnet .


clc ;
clear ;
b =(300) *(10^ -6) ;
N =500;
t =(1/10) ;
// Faraday s LAW.

218

11 e = b * N / t ;
12
13 disp ( v o l t s ,e , The EMF g e n e r a t e d b e t w e e n t h e

coil

ends = )

Scilab code Exa 13.5 EMF induced between two coils in a circular iron
core
//EMF i n d u c e d b e t w e e n two c o i l s i n a c i r c u l a r i r o n
core
2 clc ;
3 clear ;

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

area = 5*(10^ -4) ;


l =0.5;
na =200;
nb =500;
dI =15;
dt =(1/10) ;
mr =250;
mo = 4* %pi *(10^ -7) ;
mfa = na * dI ;
H = mfa / l ;
B = mo * mr * H ;
// Flux L i n k e d
flux = B * area ;

219

27 eb = nb * flux / dt ;
28
29 disp ( v o l t s ,eb , The I n d u c e d EMF by c o i l B = )

Scilab code Exa 13.6 Force on the conductor due to a uniform magentic
field
// F o r c e on t h e c o n d u c t o r due t o a u n i f o r m m a g e n t i c
field
2 clc ;
3 clear ;
1

4
5
6
7
8
9
10
11

l =0.5;
B =0.12;
I =15;
F=B*I*l;
disp ( N ,F , The F o r c e on t h e c o n d u c t o r = )

Scilab code Exa 13.7 To determine force between single phase bus bars
1 // To d e t e r m i n e f o r c e b e t w e e n s i n g l e
2
3 clc ;
4 clear ;
5
6 eload =10^7;
7 voltage =15*(10^3) ;
8
9 mo =4* %pi *(10^ -7) ;
10
11 l =1;

220

p h a s e bus b a r s

12
13
14
15
16
17
18
19
20
21
22
23
24

r =0.3;
// N o r m a l l y
I = eload / voltage ;
F = mo * I * I * l /(2* %pi * r ) ;
// S h o r t C i r c u i t
Isc =10* I ;
Fsc = mo * Isc * Isc * l /(2* %pi * r ) ;

disp ( N ,F , i ) F o r c e p e r m e t r e u n d e r n o r m a l
condition =)
25 disp ( N ,Fsc , i i ) F o r c e p e r m e t r e u n d e r s h o r t
circuit condition =)

Scilab code Exa 13.8 To Compute the Maximum Induced EMF


1 // To Compute t h e Maximum I n d u c e d EMF
2
3 clc ;
4 clear ;
5
6 T =1/50;
7 fluxmax =0.02;
8 N =100;
9
10 flux = fluxmax *( poly ([1 -4/ T ] , t , c ) ) ; // Flux

Equation under c o n s i d e r a t i o n .
11
12 e = N *( -1) * derivat ( flux ) ;
13
14 disp ( v o l t s ,e , The Maximum i n d u c e d EMF= )

221

Scilab code Exa 13.9 Compute Inductance and EMF induced


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Compute I n d u c t a n c e and EMF i n d u c e d


clc ;
clear ;
d =0.25;
l = %pi * d ;
n =1000;
area =6.25*(10^ -4) ;
I =200;
mo =4* %pi *(10^ -7) ;
L = mo * area * n * n / l ;
V=L*I;
disp ( H ,L , The I n d u c t a n c e o f t o r i o d )
disp ( v o l t s ,V , The I n d u c e d EMF i n t h e t o r i o d )

Scilab code Exa 13.10 Change in Inductance


1
2
3
4
5
6
7
8
9
10

// Change i n I n d u c t a n c e
clc ;
clear ;
L =120*(10^ -3) ;
N =1000;
mr =75;
Nr =200;
Nc =N - Nr ;

222

11

// I n d u c t a n c e d i r e c t l y p r o p o r t i o n a l t o t h e p r o d u c t
o f t h e s q u a r e o f t u r n s and t h e r e l a t i v e
permeability

12
13 Lc = L *(( Nc / N ) ^2) *75;
14
15 disp ( H ,Lc , The New v a l u e o f i n d u c t a n c e = )

Scilab code Exa 13.11 Computation of Current


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// Compute C u r r e n t
clc ;
clear ;
i =3;
L =10;
t =20*(10^ -3) ;
V =20*(10^3) ;
E = L * i * i /2;
P=E/t;
I=P/V;
disp ( a m p e r e s ,I , The C u r r e n t i n t h e s p a r k p l u g = )

Scilab code Exa 13.12 To determine Mutual and Self Inductances


1 // To d e t e r m i n e Mutual and S e l f
2
3 clc ;
4 clear ;

223

Inductances

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

K =0.8;
I1 =3;
flux1 =0.4*(10^ -3) ;
E2 =85;
t =3*(10^ -3) ;
N1 =300;
L1 = N1 * flux1 / I1 ;
M = E2 * t / I1 ;
L2 =((( M / K ) ^2) / L1 ) ;
flux2 = K * flux1 ;
N2 =( M * I1 / flux2 ) ;
disp ( H ,L1 , The i n d u c t a n c e o f c o i l 1 ) ;
disp ( H ,L2 , The i n d u c t a n c e o f c o i l 2 ) ;
disp ( H ,M , The i n d u c t a n c e b e t w e e n t h e c o i l s ) ;
disp ( Turns ,N2 , The number o f t u r n s o f c o i l 2 ) ;

Scilab code Exa 13.13 Computation of Mutual and self inductance in coils
1
2
3
4
5
6
7
8
9
10

// Computation o f Mutual and s e l f i n d u c a t a n c e s


clc ;
clear ;
n1 =600;
i1 =2.5;
flux1 =0.4*(10^ -3) ;
flux2 =0.8*(10^ -3) ;
n2 =2000;
224

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

tflux = flux1 + flux2 ;


L1 = n1 * tflux / i1 ;
K = flux2 / tflux ;
M = n2 * flux2 / i1 ;
L2 =(( M / K ) ^2) / L1 ;
disp ( H ,L1 , The s e l f i n d u c t a n c e o f c o i l 1= )
disp ( H ,L2 , The s e l f i n d u c t a n c e o f c o i l 2= )
disp ( ( Note t h e a c c u r a c y o f t h e a n s w e r . ) )
disp ( H ,M , The Mutual i n d u c t a n c e o f b o t h c o i l s = )
disp (K , The c o u p l i n g co e f f i c i e n t )

Scilab code Exa 13.14 EMF induced in coils parallel to each other
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// EMF i n d u c e d i n c o i l s

p a r a l l e l to each other

clc ;
clear ;
Nx =1000;
Ix =5;
flux1 =0.05*(10^ -3) ;
di =12;
dt =10^ -2;
K =60/100;
Lx = Nx * flux1 / Ix ;
// S i n c e two c o i l s a r e i d e n t i c a l , Both w i l l have
equal s e l f inductances .
225

16
17 Ly = Lx ;
18
19 M = K * sqrt ( Lx * Ly ) ;
20
21 Ey = M * di / dt ;
22
23 disp ( v o l t s ,Ey , The EMF i n d u c e d by t h e c o i l Y = )
24 disp ( H ,Lx , The S e l f I n d u c t a n c e o f C o i l X= )
25 disp ( H ,Ly , The S e l f I n d u c t a n c e o f C o i l X= )
26 disp ( H ,M , The Mutual I n d u c t a n c e o f C o i l s )

Scilab code Exa 13.15 To Compute the maximum flux set by an coil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

//To Compute t h e maximum f l u x s e t by an c o i l .


clc ;
clear ;
L1 =0.5;
L2 =1;
K =0.8;
N2 =1500;
M = K * sqrt ( L1 * L2 ) ;
i1 =20;
theta = poly (0 , t ) ;
fact = derivat ( theta ) ; // D e r i v a t i v e o f t h e t i m e f a c t o r
( Linear function of t ) .
omega =314; // The A n g u l a r F r e q u e n c y F a c t o r

226

21 v2 = M * fact * omega * i1 ; // Maximum C o i l 2 V o l t a g e


22
23 disp ( c o s 314 t V ,v2 , The V o l t a g e A c r o s s C o i l 2= )
24
25 dflx = v2 / N2 ;
26
27 Mxflux =( dflx / omega ) *(1/ fact ) ;
28
29
30 disp ( s i n 314 t Wb , Mxflux , The f l u x s e t u p by C o i l 1=

)
31
32

disp ( Wb , Mxflux , The Maximum Flux S e t u p by C o i l 1=


)

Scilab code Exa 13.16 Compute Loss of energy


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Compute L o s s o f e n e r g y
clc ;
clear ;
w =10;
f =50; // 50 c y c l e s i n a s e c o n d .
ls_vol =250;
density =7.5; // D e n s i t y i n gm/cm3
d = density *(10^6) /(10^3) ;
vol = w / d ;
ls_cycle = ls_vol * vol ;

227

19
20
21
22
23

ls_sec = ls_cycle *50;


ls_hr = ls_sec *3600;
disp ( j o u l e s , ls_hr , The L o s s o f e n e r g y p e r h o u r o f
an i r o n l o o p )

Scilab code Exa 13.17 Determining Hysteresis loss


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// D e t e r m i n i n g H y s t e r e s i s l o s s
clc ;
clear ;
fluxmax =1.5;
x =15/(10^ -2) ;
y =1;
f =50;
a = x * y ; // l o s s f o r one c e n t i m e t r e s q u a r e .
area =0.6; // i n c e n t i m e t r e s q u a r e .
hy_ls = area * a ;
vol =1500*(10^ -6) ;
hyls_cycle = vol * hy_ls ;
hyls_sec = hyls_cycle * f ;
disp ( w a t t s , hyls_sec , The H y s t e r e s i s l o s s = )

228

Scilab code Exa 13.18 Compute the Loss per Kg at a particular frequency
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// Compute t h e L o s s p e r Kg a t a p a r t i c u l a r f r e q u e n c y .
clc ;
clear ;
hy_ls =4.9;
f1 =50;
maxflux =1;
density =7.5;
d = density *(10^6) /(10^3) ;
hy_ls_cycle = hy_ls * d / f1 ;
n = hy_ls_cycle /(( maxflux ) ^1.7) ;
disp (n , i ) The v a l u e o f t h e Co E f f i c i e n t = )
mflux2 =1.8;
f2 =25;
hy_ls2 = hy_ls *( f2 / f1 ) *((1.8) ^1.7) ;
disp ( w a t t / kg , hy_ls2 , i i ) The L o s s p e r kg a t 25 Hz
and 1 . 8 Wb p e r s q u a r e m e t r e= )

Scilab code Exa 13.19 Theory Based Proof relation between self mutual
inductances

229

// Theory Based P r o o f r e l a t i o n b e t w e e n s e l f mutual


inductances

2
3 clc ;
4 clear ;
5
6 disp ( L1 =((N1 ) 2 ) MoA/ l )
7 disp ( L2 =((N2 ) 2 ) MoA/ l )
8 disp ( R= l / (MoA) )
9
10 disp ( L1 =((N1 ) 2 ) /R) )
11 disp ( L2 =((N2 ) 2 ) /R) )
12
13 disp ( M=K ( ( L1 L2 ) ( 1 / 2 ) ) )
14
15 disp ( ( S u b s t i t u t i n g L1 and L2 i n t h e a b o v e e q u a t i o n )

)
16
17
18

disp ( M=KN1N2/R )
disp ( Hence Proved )

230

Das könnte Ihnen auch gefallen