Scilab Textbook Companion for Power Electronics by B. R. Gupta And V. Singhal1 Created by Avishek Goyal Electrical Electrical Engineering Thapar University patiala College Teacher Dr. Sunil Kumar Singla Cross-Checked by Prof. Chaya S May 26, 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: Power Electronics Author: B. R. Gupta And V. Singhal Publisher: S. K. Kataria & Sons, New Delhi Edition: 3 Year: 2002 ISBN: 8185749531
1
Book Description Title: Power Electronics Author: B. R. Gupta And V. Singhal Publisher: S. K. Kataria & Sons, New Delhi Edition: 3 Year: 2002 ISBN: 8185749531
1
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.
2
Contents List of Scilab Codes
4
1 Power electronics devices
11
2 Controlled Rectifiers
28
3 Inverters
50
4 Choppers
59
5 AC Regulators
68
6 Cycloconverters
76
7 Applications of Thyristors
78
8 Integrated circuits and operational amplifiers
92
9 Number systems
102
3
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 Exa 1.18 Exa 1.19 Exa 1.20 Exa 1.21 Exa 1.22 Exa 1.23 Exa 1.24
Calculate the equivalent capacitance of depletion layer Calculate the voltage required to Turn ON the thyristor Find gate voltage gate current and resistance to be connected in series . . . . . . . . . . . . . . . . . . . . . . Calculate the minimum width of the gate pulse . . . . Calculate the minimum width of the gate pulse . . . . Find if thyristor will turn ON and the value of resistance Find if thyristor will turn OFF and maximum value of resistance . . . . . . . . . . . . . . . . . . . . . . . . . Can a negative gate current turn off a thyristor . . . . Find RMS current and form factor . . . . . . . . . . . Find the power supplied to load and average current . Calculate the average power loss . . . . . . . . . . . . Find the resistance to be connected in series and average power loss . . . . . . . . . . . . . . . . . . . . . . . . . Find the value of power dissipation when the current flows for different periods of cycle . . . . . . . . . . . . Find different current ratings . . . . . . . . . . . . . . Find source resistance gate current and voltage . . . . Find the thermal resistance and temperature . . . . . Find the maximum loss . . . . . . . . . . . . . . . . . Find the maximum loss . . . . . . . . . . . . . . . . . Design a UJT relaxation oscillator . . . . . . . . . . . Find the values of different components of circuit . . . Find the time of conduction of thyristor . . . . . . . . Find the values of L and C . . . . . . . . . . . . . . . Find the value of C . . . . . . . . . . . . . . . . . . . Calculate the value of C and L . . . . . . . . . . . . . 4
11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22
Exa 1.25 Exa 1.26 Exa 1.27 Exa 1.28 Exa 1.29 Exa 1.30 Exa 1.31 Exa 1.32 Exa 1.33 Exa 1.34 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 2.11 Exa 2.12 Exa 2.13 Exa 2.14 Exa 2.15 Exa 2.16 Exa 2.17 Exa 2.18
Find the commutation time and the current rating of the thyristor . . . . . . . . . . . . . . . . . . . . . . . Find the value of R and C . . . . . . . . . . . . . . . . Find the value of R C and snubber power loss and power rating of resistance . . . . . . . . . . . . . . . . . . . . Find the maximum permissible values . . . . . . . . . Find number of thyristor in series and parallel . . . . . Find the value of R and C for static and dynamic equalizing circuits . . . . . . . . . . . . . . . . . . . . . . . Find the value of resistance to be connected in series . Find the steady and transient state rating and derating of thyristor . . . . . . . . . . . . . . . . . . . . . . . . Find number of thyristor in series and parallel . . . . . Find Stored charge and peak reverse current . . . . . . Calculate the different parameters of half wave diode rectifier . . . . . . . . . . . . . . . . . . . . . . . . . . Calculate the different parameters of full wave centre tapped diode rectifier . . . . . . . . . . . . . . . . . . Find the RMS and average voltage and current . . . . Find the average current . . . . . . . . . . . . . . . . . Find the average current . . . . . . . . . . . . . . . . . Calculate the various parameters of a single phase half wave rectifier . . . . . . . . . . . . . . . . . . . . . . . Find the RMS and average voltage and current of a single phase full wave rectifier . . . . . . . . . . . . . . Calculate the different parameters of full wave converter with centre tapped transformer . . . . . . . . . . . . . Calculate the voltage rating of full wave central tap and bridge rectifiers . . . . . . . . . . . . . . . . . . . . . Find the output voltage firing angle and load current . Find the average power output of full wave mid point and bridge converter . . . . . . . . . . . . . . . . . . . Find dc output voltage and power . . . . . . . . . . . Find dc output voltage and power . . . . . . . . . . . Calculate the firing angle and power factor . . . . . . Find the average value of load current . . . . . . . . . Calculate the different parameters of full wave converter with bridge transformer . . . . . . . . . . . . . . . . . 5
23 23 24 24 25 25 26 26 27 27 28 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36
Exa 2.19 Exa 2.20 Exa 2.21 Exa 2.22 Exa 2.23 Exa 2.24 Exa 2.25 Exa 2.26 Exa 2.27 Exa 2.28 Exa 2.29 Exa 2.30 Exa 2.31 Exa 2.32 Exa 2.33 Exa 2.34 Exa 2.35 Exa 3.1 Exa 3.2 Exa 3.3 Exa 3.4 Exa 3.5 Exa 3.6
Find the value of dc voltage rms voltage and form factor of a single phase semi converter . . . . . . . . . . . . . Calculate the different parameters of single phase semi converter bridge . . . . . . . . . . . . . . . . . . . . . Calculate the different parameters of single phase full converter . . . . . . . . . . . . . . . . . . . . . . . . . Calculate the different parameters of single phase full controlled bridge converter . . . . . . . . . . . . . . . Calculate the different parameters of single phase full controlled bridge converter . . . . . . . . . . . . . . . Calculate peak circulating current and peak current of converter . . . . . . . . . . . . . . . . . . . . . . . . . Calculate inductance of current limiting reactor and peak current of converter . . . . . . . . . . . . . . . . . . . Calculate inductance of current limiting reactor and resistance . . . . . . . . . . . . . . . . . . . . . . . . . . Find the parameters of three phase bridge rectifier circuit Find the parameters of three phase full converter . . . Find the firing angle of a 3 phase fully controlled bridge converter . . . . . . . . . . . . . . . . . . . . . . . . . Find the parameters of six pulse thyristor converter . . Find the parameters of three phase semi converter bridge circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . Find the parameters of three phase fully controlled bridge converter . . . . . . . . . . . . . . . . . . . . . . . . . Calculate the overlap angles . . . . . . . . . . . . . . . Find the value of circulating currents for 3 phase dual converter . . . . . . . . . . . . . . . . . . . . . . . . . Find the value of inductance . . . . . . . . . . . . . . Find the maximum output frequency . . . . . . . . . . Find the frequency of output . . . . . . . . . . . . . . Find the available circuit turn off time and maximum possible frequency . . . . . . . . . . . . . . . . . . . . Design a parallel inverter . . . . . . . . . . . . . . . . Calculate the various parameters of single phase half bridge inverter . . . . . . . . . . . . . . . . . . . . . . Calculate the various parameters of single phase full bridge inverter . . . . . . . . . . . . . . . . . . . . . . 6
37 37 38 38 40 40 41 42 42 43 44 44 45 46 47 47 48 50 50 51 51 52 53
Exa 3.7 Exa 3.8 Exa 3.9 Exa 3.10 Exa 3.11 Exa 3.12
Exa 3.13 Exa 3.14 Exa 3.15 Exa 4.1 Exa 4.2 Exa 4.3 Exa 4.4 Exa 4.5 Exa 4.6 Exa 4.7 Exa 4.8 Exa 4.9 Exa 4.10 Exa 4.11 Exa 4.12 Exa 4.13 Exa 4.14 Exa 4.15 Exa 4.16 Exa 4.17 Exa 5.1 Exa 5.2
Calculate the various parameters of full bridge inverter Calculate the value of C for proper load commutation Calculate peak value of load current . . . . . . . . . . Find the different parameters of 3 phase bridge inverter for 120degree conduction mode . . . . . . . . . . . . . Find the different parameters of 3 phase bridge inverter for 180degree conduction mode . . . . . . . . . . . . . Find the RMS value of load current and thyristor current of 3 phase bridge inverter for 180degree conduction mode . . . . . . . . . . . . . . . . . . . . . . . . . . . Find the parameters of single phase full bridge inverter Calculate the RMS value of the output voltage . . . . Calculate the RMS value of the output voltage . . . . Calculate the period of conduction and blocking . . . Calculate the period of conduction and blocking . . . Calculate the duty cycle for the rated torque and half of rated torque . . . . . . . . . . . . . . . . . . . . . . Find the different parameters of a dc chopper . . . . . Find the chopper frequency . . . . . . . . . . . . . . . Find the different parameters of a chopper feeding a RL load . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculate the load inductance . . . . . . . . . . . . . . Calculate the current . . . . . . . . . . . . . . . . . . Find the speed of motor . . . . . . . . . . . . . . . . Calculate average load voltage . . . . . . . . . . . . . Find maximum minimum and average load current and load voltage . . . . . . . . . . . . . . . . . . . . . . . . Find maximum minimum and average output voltage . Calculate the series inductance in the circuit . . . . . Calculate the motor speed and current swing . . . . . Calculate the value of capacitance and inductance . . Calculate the period of conduction of a step up chopper Calculate the period of conduction of a step up chopper Calculate the different parameters of AC voltage regulator using integral cycle control . . . . . . . . . . . . Calculate the different parameters of single phase half wave AC regulator . . . . . . . . . . . . . . . . . . . .
7
53 54 55 55 56
56 57 57 58 59 59 60 60 61 61 62 63 63 64 64 65 65 66 66 67 67 68 69
Exa 5.3 Exa 5.4 Exa 5.5 Exa 5.6 Exa 5.7 Exa 5.8 Exa 5.10 Exa 5.11 Exa 5.12 Exa 6.1 Exa 6.2 Exa 6.3 Exa 7.1 Exa 7.2 Exa 7.3 Exa 7.4 Exa 7.5 Exa 7.6 Exa 7.7 Exa 7.8 Exa 7.9 Exa 7.10 Exa 7.11 Exa 7.12 Exa 7.13
Calculate the different parameters of single phase full wave AC regulator . . . . . . . . . . . . . . . . . . . . Calculate the different parameters of single phase full wave AC regulator . . . . . . . . . . . . . . . . . . . . Find RMS output voltage and average power . . . . . Find the firing angle . . . . . . . . . . . . . . . . . . . Find the conduction angle and RMS output voltage . Calculate the different parameters of single phase full wave AC regulator . . . . . . . . . . . . . . . . . . . . Find the current and voltage rating . . . . . . . . . . . Calculate the different parameters of 3 phase star connected resistance load with firing angle 30 degree . . . Calculate the different parameters of 3 phase star connected resistance load with firing angle 60 degree . . . Find the input voltage SCR rating and Input Power Factor . . . . . . . . . . . . . . . . . . . . . . . . . . . Find RMS value of output voltage for firing angle 30 and 45 degree . . . . . . . . . . . . . . . . . . . . . . . Find RMS value of output voltage for firing angle 0 and 30 degree . . . . . . . . . . . . . . . . . . . . . . . . . Find the value of Voltage which will turn On the crowbar Find the value of input voltage . . . . . . . . . . . . . Find the value of R and C . . . . . . . . . . . . . . . . Find Duty cycle and Ratio for different output powers Find RMS value of output voltage . . . . . . . . . . . Find the power supplied to heater for different firing angles . . . . . . . . . . . . . . . . . . . . . . . . . . . Find the firing angles when different powers are supplied to heater . . . . . . . . . . . . . . . . . . . . . . . . . Find the current rating and peak inverse voltage . . . Find firing angle and power factor of converter in the armature circuit . . . . . . . . . . . . . . . . . . . . . Find the torque developed and motor speed . . . . . . Find armature current and Firing angle of the semi converter . . . . . . . . . . . . . . . . . . . . . . . . . . . Find the firing angle of converter in the armature circuit and power fed back to the source . . . . . . . . . . . . Find the firing angle of converter in the armature circuit 8
70 70 71 72 72 73 73 74 75 76 76 77 78 78 79 79 80 80 81 82 82 83 84 84 85
Exa 7.14 Exa 7.15 Exa 7.16 Exa 7.17 Exa 7.18 Exa 7.19 Exa 7.20 Exa 7.21 Exa 8.1 Exa 8.2 Exa 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.17 Exa 8.18 Exa 8.21 Exa 8.22 Exa 9.1 Exa 9.2 Exa 9.3 Exa 9.4 Exa 9.5 Exa 9.6 Exa 9.7
Find the input power speed and torque of separately excited dc motor . . . . . . . . . . . . . . . . . . . . . Find the average voltage power dissipated and motor speed of the chopper . . . . . . . . . . . . . . . . . . . Find the speed for different values of torque . . . . . . Find the speed at no load and firing angle . . . . . . . Find the motor speed . . . . . . . . . . . . . . . . . . Find the load torque stator applied voltage and rotor current . . . . . . . . . . . . . . . . . . . . . . . . . . Find the load torque stator applied voltage and rotor current . . . . . . . . . . . . . . . . . . . . . . . . . . Find the starting torques at different frequencies . . . Find dc currents and voltages . . . . . . . . . . . . . . Calculate the different parameters of differential amplifier Find the closed loop gain output and error voltage . . Find the closed loop gain output and error voltage . . Find the input and output impedances . . . . . . . . . Find closed loop gain and desensitivity . . . . . . . . . Find the closed loop gain and upper cut off frequency Find the slew rate . . . . . . . . . . . . . . . . . . . . Find the slew rate distortion of the op amp . . . . . . Find the slew rate distortion of the op amp and amplitude of the input signal . . . . . . . . . . . . . . . . . Find the different parameters of inverting amplifier . . Find the different parameters of non inverting amplifier Find the different parameters of ac amplifier . . . . . . Find the output voltage . . . . . . . . . . . . . . . . . Find the output voltage . . . . . . . . . . . . . . . . . Find CMRR in dB . . . . . . . . . . . . . . . . . . . . Find the different parameters of high pass filter . . . . Find the different parameters of low pass filter . . . . Convert decimal number into equivalent binary number Convert decimal number into equivalent binary number Convert binary number into equivalent decimal number Convert decimal number into equivalent binary number Calculate the subtraction of two binary numbers . . . Calculate the subtraction of two binary numbers . . . Express the decimals in 16 bit signed binary system . 9
85 86 87 88 89 89 90 91 92 92 93 94 94 95 95 96 96 97 97 98 98 99 100 100 100 101 102 102 103 103 103 104 104
Exa 9.8 Exa 9.9 Exa 9.10 Exa 9.11 Exa 9.12 Exa 9.13 Exa 9.14 Exa 9.15 Exa 9.16 Exa 9.17 Exa 9.18 Exa 9.19 Exa 9.20
Calculate the twos complement representation . . . . . Find the largest positive and negative number for 8 bits Calculate addition and subtraction of the numbers . . Calculate addition and subtraction of the numbers . . Convert decimal number into equivalent binary number Convert decimal number into equivalent binary number Convert decimal number into equivalent binary number Find the addition of binary numbers . . . . . . . . . . Convert binary number into equivalent decimal number Convert hexadecimal number into equivalent decimal number . . . . . . . . . . . . . . . . . . . . . . . . . . Convert decimal number into equivalent hexadecimal number . . . . . . . . . . . . . . . . . . . . . . . . . . Convert decimal number into equivalent hexadecimal number . . . . . . . . . . . . . . . . . . . . . . . . . . Convert hexadecimal number into equivalent decimal number . . . . . . . . . . . . . . . . . . . . . . . . . .
10
105 106 106 107 107 108 109 110 110 112 112 112 113
Chapter 1 Power electronics devices
Scilab code Exa 1.1 Calculate the equivalent capacitance of depletion layer
1 2 3 4 5 6 7
// 1. 1 clc ; Ic=8*10^-3;
/ / l e t dv / d t =A A=190*10^6; C=Ic/A*10^12; printf ( ” E q u iv a l en t c a p a ci t an c e o f d e p l e t i o n l a y e r = % . 1 f uF ” , C)
Scilab code Exa 1.2 Calculate the voltage required to Turn ON the thyris-
tor 1 // 1. 2 2 clc ; 3 disp ( ’ When t h y r i s t o r
i s n o t c on d u ct i n g t h er e i s no c u r r e nt t hr ou gh i t ’ ) 4 disp ( ’ so Vo=20V ’ ) 5 VG=0.75;
11
6 7 8 9
10 11 12 13 14 15 16 17
IG=7*10^-3; RG=2000; Vs=VG+IG*RG; printf ( ” V o l ta g e r e q u i r e d t o Turn On The t h y r i s t o r = % . 2 f V” , Vs ) R = 2 00 ; VR=5*10^-3*R; printf ( ” / n V o lt a ge d ro p a c r o s s R = %. 0 f V” , VR ) disp ( ’ H ence Vcc s h ou l d be r ed uc ed t o l e s s t ha n 1V ’ ) Vconduct=0.7; Vreq=VR+Vconduct; printf ( ” V o l t a ge r e q u i r e d = %. 1 f V” , V re q ) disp ( ’ H ence Vcc s h o ul d be r ed uc ed t o l e s s t h a n 1 . 7V ’ )
Scilab code Exa 1.3 Find gate voltage gate current and resistance to be
connected in series 1 2 3 4 5 6 7 8 9 10
// 1. 3
clc ; P_loss_avg=0.6; P_loss_conduction=0.6*2*%pi/%pi; Ig=0.314; printf ( ” Ig=%.3 f A” , I g ) Vg=1+9*Ig; printf ( ” \nVg=%. 3 f V” , V g ) Rg=(24-9*Ig)/Ig; printf ( ” \ n R e s is t a n ce t o be c o nn ec te d i n s e r i e s =%. 2 f ohm” , Rg )
Scilab code Exa 1.4 Calculate the minimum width of the gate pulse
1 // 1. 4
12
2 3 4 5 6 7 8
clc ; V=100; L=10; i=80*10^-3; t=i*L/V*10^3; printf ( ” t= %. 0 f ms ” , t ) disp ( ’ So t he w i d t h o f t he p u l se s ho u l d be more t h a n 8 ms ’ )
Scilab code Exa 1.5 Calculate the minimum width of the gate pulse
1 2 3 4 5 6 7 8
// 1. 5
clc ; V=100; R=10; i=50*10^-3; t=-0.5* log (1-((i*R/V)))*10^3 printf ( ” t= %. 1 f ms ” , t ) disp ( ’ So t he minimum w i d th o f t he g a t e p u l se ms ’ )
is 2.5
Scilab code Exa 1.6 Find if thyristor will turn ON and the value of resis-
tance 1 2 3 4 5 6 7 8 9
// 1. 6
clc ; V=90; R=25; t=40*10^-6; L=0.5; i=(V/R)*(1- exp (-R*t/L)) iL=40*10^-3; printf ( ” The c i r c u i t c u r r e nt
13
i s = %. 4 f A” , i )
10 disp ( ’ S i n ce t h e
c i r c u i t c u r r e n t i s l e s s th a n l a t c h i n g c u r r en t o f 40mA s o t h y r i s t o r w i l l n o t turn ON’ )
11 R=V/(iL-i); 12 printf ( ”R= % . 0 f Ohm” , R) 13 disp ( ’R s h ou l d be l e s s th an 2 74 3 ohm ’ )
Scilab code Exa 1.7 Find if thyristor will turn OFF and maximum value
of resistance 1 2 3 4 5 6 7 8 9 10
// 1. 7
11 12
clc ; V=100; R=20; t=50*10^-6; L=0.5; i=(V/R)*(1- exp (-R*t/L)) iH=50*10^-3; printf ( ” The c i r c u i t c u r r e nt i s = %. 5 f A” , i ) disp ( ’ S i n ce t h e c i r c u i t c u r r e n t i s l e s s th a n h o l d i ng c u r r e n t o f 50mA so t h y r i s t o r w i l l t ur n OFF ’ ) R=V/(iH-i); printf ( ”Maximum va lu e o f R= %.3 f Ohm” , R)
Scilab code Exa 1.8 Can a negative gate current turn off a thyristor
1 // 1. 8 2 clc ; 3 disp ( ’A n e g a t i v e g at e c u r r e n t c a n n ot t ur n
off a t h y r i s t o r . T h i s i s due t o t h e r ea s o n t ha t c at h od e r e g i o n i s much b i g g e r i n a re a th a n g a t e r e g i o n ’ )
14
Scilab code Exa 1.9 Find RMS current and form factor
1 2 3 4 5 6 7 8 9 10
// 1. 9
clc ; I=120; gama=180; th=360; I_rms=I*(gama/th)^0.5; printf ( ” The RMS v a l u e o f c u r r e n t = %. 2 f A” ,I_rms) I_avg=I*(gama/th); Form_factor=I_rms/I_avg; printf ( ” \nForm f a c t o r = %. 3 f A” ,Form_factor)
Scilab code Exa 1.10 Find the power supplied to load and average current
// 1. 10
1 2 3 4
5 6 7 8 9
10 11 12 13 14 15
clc ; disp ( ’ I f t h e t h y r i s t o r i s f i r e d a t 60 d eg re e ’ ) Irms=(0.8405*((%pi-%pi*60/180)- sin (2*%pi)/2+ sin (2* %pi*60/180)/2))^0.5; R=100; P=Irms^2*R; printf ( ” P ow er s u p p l i e d t o l o a d =%. 0 f W” ,P) disp ( ’ I f t h e t h y r i s t o r i s f i r e d a t 45 d eg re e ’ ) Irms=(0.8405*((%pi-%pi*45/180)- sin (2*%pi)/2+ sin (2* %pi*45/180)/2))^0.5; R=100; P=Irms^2*R; printf ( ” P ow er s u p p l i e d t o l o a d =%. 1 f W” ,P) disp ( ’ I f t h e t h y r i s t o r i s f i r e d a t 60 d eg re e ’ ) Iavg=3.25/(2*%pi)*(- cos (%pi)+ cos (%pi*60/180)) printf ( ” A v e r a g e C u r r e n t=% . 3 f A” ,Iavg)
15
16 disp ( ’ I f t h e t h y r i s t o r i s f i r e d a t 45 d eg re e ’ ) 17 Iavg=3.25/(2*%pi)*(- cos (%pi)+ cos (%pi*45/180)) 18 printf ( ” A v e r a g e C u r r e n t=% . 3 f A” ,Iavg)
Scilab code Exa 1.11 Calculate the average power loss
1 2 3 4 5 6 7 8 9 10 11 12 13
// 1. 11 clc ;
/ /when c o nd u ct i on p e r i od i s 2∗ p i amplitude=200; pd=1.8; p o w e r _l o s s _a v e r a ge = a m p li t u de * p d * 2 * % p i / ( 2* % p i ) ; printf ( ” power l o s s a v er a ge when c o nd u ct i on p e r i od 2∗ pi= %.0 f W” ,power_loss_average)
is
// when c o nd u ct i on p e r i od i s p i amplitude=400; pd=1.9; p o w e r _l o s s _a v e r a ge = a m p li t u de * p d * % p i / ( 2* % p i ) ; printf ( ” \ np ower l o s s a v e ra g e w hen c o n d uc t i o n p e r i o d i s p i = %. 0 f W” ,power_loss_average)
Scilab code Exa 1.12 Find the resistance to be connected in series and
average power loss 1 2 3 4 5 6 7
// 1. 12
clc ; P_loss_peak=6; Ig=0.763; Vg=1+9*Ig; Rg=(11-9*Ig)/Ig; printf ( ” \ n R e s is t a n ce t o be c o nn ec te d i n s e r i e s =%. 3 f ohm” , Rg )
16
8 duty=0.3; 9 P_loss_average=P_loss_peak*duty; 10 printf ( ” \ n A v er a g e p o we r l o s s =% . 1 f W” , P_loss_average)
Scilab code Exa 1.13 Find the value of power dissipation when the cur-
rent flows for different periods of cycle 1 2 3 4 5 6 7 8
// 1. 13
9 10 11 12 13
clc ; disp ( ’ when c u r r e n t i s c o n st a n t It=20; Vt=0.9+0.02*It; P_dissipation=Vt*It; printf ( ” P ow er d i s s i p a t i o n =%. 0 f disp ( ’ when c u r r e n t i s c o ns t an t c y c l e i n e a ch f u l l c y c l e ’ ) P_dissipation=Vt*It/2; printf ( ” P ow er d i s s i p a t i o n =%. 0 f disp ( ’ when c u r r e n t i s c o ns t an t c y c l e i n e a ch f u l l c y c l e ’ ) P_dissipation=Vt*It/3; printf ( ” P ow er d i s s i p a t i o n =%. 2 f
20A ’ )
W” ,P_dissipation) 20A f o r on e h a l f
W” ,P_dissipation) 20A f o r on e t h i r d
W” ,P_dissipation)
Scilab code Exa 1.14 Find different current ratings
1 2 3 4 5 6 7
// 1. 14
clc ; Isub=2000; T=10*10^-3; t=5*10^-3; I=(Isub^2*t/T)^0.5; printf ( ” o ne c y c l e s u r ge c u r r en t r a t i n g =%. 1 f A” , I )
17
8 // a=I ˆ2 t 9 a=I^2*T; 10 printf ( ” \ n I ˆ 2 t =% . 1 f Aˆ 2 S e c ” , a)
Scilab code Exa 1.15 Find source resistance gate current and voltage
// 1. 15
1 2 3 4 5
clc ; P=0.3; Vs=12; disp ( ’ S i n ce l oa d l i n e h a s a s l o p e o f −100V/A, the s o u r c e r e s i s t a n c e f o r t h e g at e i s 1 0 0 ohm ’ ) 6 Rs=100; 7 / / s i n c e Vs=Vg+ I g ∗Rs 8 / / on s o l v i n g I g = 35 .5 mA 9 Ig=35.5*10^-3; 10 printf ( ” \ n G at e c u r r e n t =% . 4 f A” ,Ig) 11 Vg=P/Ig; 12 printf ( ” \ n Ga te v o l t a g e =% . 2 f V” ,Vg)
Scilab code Exa 1.16 Find the thermal resistance and temperature
1 2 3 4 5 6 7 8
// 1. 16
9 10
clc ; l=0.2; w=0.01; d=0.01; the_cond=220; the_res=l/(the_cond*w*d); printf ( ” T he rm al r e s i s t a n c e = %. 3 f d e g r e e C/W” , the_res) T1=30; P=3;
18
11 T2=P*the_res+T1; 12 printf ( ” \ n Tem per atu re o f t he s u r f a c e = %. 2 f d e gr e e C ”, T2)
Scilab code Exa 1.17 Find the maximum loss
1 2 3 4 5 6 7 8 9
// 1. 17
clc ; l=2*10^-3; A=12*10^-4; the_cond=220; the_res=l/(the_cond*A); T=4; //T=T2−T1 P=T/the_res; printf ( ”Maximum l o s s w h ic h c an b e h a n d l e d by m od ul e= %. 2 f W” , P)
Scilab code Exa 1.18 Find the maximum loss
1 2 3 4 5 6 7 8 9
// 1. 18
clc ; T2=125; T1=50; T=T2-T1; P=30; Total_the_res=T/P; the_res =Total_ the_res -1 -0.3; printf ( ” Thermal r e s i s t a n c e o f h ea t s i n k= %. 1 f d e g re e C/W” , t h e_ re s )
19
Scilab code Exa 1.19 Design a UJT relaxation oscillator
// 1. 19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
17 18 19 20
clc ; T=1/50; V=32; Vp=0.63*V+0.5; C=0.4*10^-6; Ip=10*10^-6; Rmax=(V-Vp)/Ip; printf ( ”Rmax=%. 0 f ohm” , R ma x ) Vv=3.5; Iv=10*10^-3; Rmin=(V-Vv)/Iv; printf ( ” \nRmin=%. 0 f ohm” , R mi n ) R=T/(C* log (1/(1-0.63))); printf ( ” \nR=%. 0 f ohm” , R ) disp ( ’ s i n c e t h e v a l u e o f R i s b et we en Rmin and Rmax s o t h e v al ue i s s u i t a b l e ’ ) R4=50*10^-6/C; printf ( ” \nR4=%. 0 f ohm” , R4 ) R3=10^4/(0.63*V); printf ( ” \nR3=%. 0 f ohm” , R3 )
Scilab code Exa 1.20 Find the values of different components of circuit
1 2 3 4 5 6 7 8 9
// 1. 20
clc ; T=.5*10^-3; V=10; Vp=0.6*V+0.5; Ip=5*10^-3; Rmax=(V-Vp)/Ip; printf ( ”Rmax=%. 0 f ohm” , R ma x ) C=1*10^-6;
20
10 R=T/(C* log (1/(1-0.6))); 11 printf ( ” \nR=%. 1 f ohm” , R ) 12 disp ( ’ s i n c e t he v al ue o f R i s v al ue i s s u i t a b l e ’ )
l e s s th a n Rmax s o t h e
Scilab code Exa 1.21 Find the time of conduction of thyristor
1 2 3 4 5 6 7
// 1. 21
clc ; R=0.8; L=10*10^-6; C=50*10^-6; t0=10^6*%pi/((1/(L*C))-(R^2/(4*L^2)))^0.5; printf ( ” Time o f c o nd u ct i on o f t h y r i s t o r = %. 2 f u s ” , t0 )
Scilab code Exa 1.22 Find the values of L and C
1 2 3 4 5 6
// 1. 22 clc ; Ip=16; V=90;
// C/L=( I p /V) ˆ 2 ; (i) // Assume t h a t c i r c u i t i s r e v e r s e b i a s e d f o r one− f o u r t h p e r i o d o f r es o n a n t c i r c u i t . t hu s 7 / / % p i / 2 ∗ ( L∗C) ˆ0.5=4 0∗1 0 ˆ −6 ; ( ii ) 8 // on s o l v i n g ( i ) and ( i i ) 9 10 11 12 13
C=4.527*10^-6; L=C/(Ip/V)^2*10^6; C=4.527*10^-6*10^6; printf ( ”C=%. 3 f uF” ,C) printf ( ” \nL=%. 2 f uH” ,L )
21
Scilab code Exa 1.23 Find the value of C
1 2 3 4 5 6 7
// 1. 23
clc ; t_off=50*10^-6; R1=10; a = l o g (2); C=t_off/(a*R1)*10^6; Th e v a l u e o f C= % . 2 f uF ” , C ) printf ( ” Th
Scilab code Exa 1.24 Calculate the value of C and L
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 1. 24
clc ; Vc=100; IL=40; t_off=40*10^-6*1.5; C=IL*t_off/Vc; Th e v a l u e o f c a p a c i t o r = % . 6 f F ” , C ) printf ( ” Th
/ / L>(VCˆ2 (VCˆ2∗ ∗ C/ IL ˆ2 ) ; //IC peak=Vc ∗ ( C/ C/ L ) ˆ 0 . 5 ; / / I C p ea e a k s h o u ld l d b e l e s s t ha h a n ma m aximum l o a d c u r r e n t s o i f L = 2 ∗ 10 ˆ − 4
L=2*10^-4; IC_peak=Vc*(C/L)^0.5; t = % . 2 f A” ,IC_peak) printf ( ” \ n P e a k c a p a c i t o r c u r r e n t= n c e t he h e p e a k c a p a c i t o r c u r re re n t l e s s than disp ( ’ S i nc
maximum l o a d c u r r e n t 4 0 A s o uF ’ )
22
L = 2∗ 10ˆ 10 ˆ − 4 and C=24
Scilab code Exa 1.25 Find the commutation time and the current rating
of the thyristor 1 2 3 4 5 6 7 8 9
// 1. 25
clc ; L=0.1*10^-3; Vc=100; C=10*10^-6; IL=10; t_off=Vc*C/IL*10^6; o m mu mu ta t a ti ti oon n t i m e= e = %. %. 0 f u s ” ,t_off) printf ( ” C om Th e c om o m m u t a t i o n t im i m e o f t he he t h y r i s t o r disp ( ’ Th
i s more t h a n t h e t ur ur n o f f t i m e o f t h e main t h y r i s t o r i . e . 2 5 u s and i s t h u s s u f f i c i e n t t o c o mm mm ut ut a te te t h e main t h y r i s t o r ’ )
10 I C _ pe pe a k = V c * ( C / L) L ) ^ 0 . 5; 5; 11 printf ( ” Pe P e a k c a p a c i t o r c u r r e n t= t = % . 2 f A” ,IC_peak) 12 disp ( ’ T Th h e ma m aximum c u r r e nt n t r a t i n g o f t he he t h y r i s t o r s h o u ld l d b e m o r e t ha h a n 3 1 . 6 2A 2A ’ )
Scilab code Exa 1.26 Find the value of R and C
1 2 3 4 5 6 7 8 9 10 11
// 1. 26 clc ; Vm=230*2^0.5; L=0.2*10^-3;
//a=dv/dt
a=25*10^6; sig=0.65; C=(1/(2*L))*(0.564*Vm/a)^2*10^9; R=2*sig*(L/(C*10^-9))^0.5; Th e v a l u e o f c a p a c i t o r = % . 2 f nF ” , C ) printf ( ” Th printf ( ” \ n T h e v a l u e o f R e s i s t o r = % . 1 f Ohm” , R )
23
Scilab code Exa 1.27 Find the value of R C and snubber power loss and
power rating of resistance 1 2 3 4 5 6 7 8 9 10 11 12
// 1. 27 clc ; f=2000; V=300; RL=10;
//a=dv/dt
a=100*10^6; R=300/100; C=(0.632*V*RL)/(a*(R+RL)^2)*10^6; Th e v a l u e o f c a p a c i t o r = % . 3 f uF ” , C ) printf ( ” Th Power_Loss_snubber=0.5*C*10^-6*V^2*f; ow er er L o s s = %. %. 2 f W” , printf ( ” \ n S n u b b e r P ow Power_Loss_snubber) 13 disp ( ’ A ll l l t he h e e ne n e rg r g y s t or o r e d i n t h e c a pa p a c it i t a nc nc e C i s
d i s s i p a t e d i n r e s i s t a n c e R . H e n c e p o w e r R a ti t i ng ng o f R i s 1 0 . 1W 1W ’ )
Scilab code Exa 1.28 Find the maximum permissible values
1 2 3 4 5 6 7 8
// 1. 28
9
clc ; C=6*10^-6; R=4; V=300; L=6*10^-6; b_max=V/L*10^-6; / / b= d i / d t Th e ma m aximum p e r m i s s i b l e printf ( ” Th f MA/ s ” ,b_max) Isc=V/R;
24
v a l u e o f d i / d t = %. 0
10 //a=dv/dt 11 a=((R*b_max*10^6)+(Isc/C))*10^-6; 12 printf ( ” \nThe maximum p e r m i s s i b l e . 1 f MV/ s ” ,a)
v a l u e o f dv / d t = %
Scilab code Exa 1.29 Find number of thyristor in series and parallel
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 1. 29
clc ; Im=750; De=0.25; It=175; np=(Im/It)/(1-De); printf ( ” np = %. 2 f ” ,np) disp ( ’ s o t h e no . o f t h y r i s t o r s i n p a r a l l e l a re 6 ’ ) Vs=3000; De=0.25; Vd=800; ns=(Vs/Vd)/(1-De); printf ( ” n s = %. 2 f ” ,ns) disp ( ’ s o t h e no . o f t h y r i s t o r s i n s e r i e s a re 5 ’ )
Scilab code Exa 1.30 Find the value of R and C for static and dynamic
equalizing circuits 1 2 3 4 5 6 7 8
// 1. 30
clc ; ns=5; Vd=800; Vs=3000; Ib=8*10^-3; dQ=30*10^-6; R=(ns*Vd-Vs)/((ns-1)*Ib)
25
9 C=((ns-1)*dQ)/(ns*Vd-Vs)*10^6; 10 printf ( ” The v a l ue o f r e s i s t a n c e = %. 2 f ohm ” ,R ) 11 printf ( ” \nThe v a lu e o f c a p a c i t a nc e = %. 2 f uF ” ,C)
Scilab code Exa 1.31 Find the value of resistance to be connected in series
1 2 3 4
// 1. 31 clc ; R=(1.5-1.2)/100; printf ( ” The v al ue o f r e s i s t a n c e t o b e c on ne ct ed i n s e r i e s = % . 3 f ohm” ,R)
Scilab code Exa 1.32 Find the steady and transient state rating and der-
ating of thyristor // 1. 32
1 2 3 4 5 6 7 8 9 10 11
12 13 14 15
16
clc ; ns=12; Vd=800; V=16000; Ib=10*10^-3; dQ=150*10^-6; C=0.5*10^-6; R=56*10^3; Vd=(V+(ns-1)*R*Ib)/ns; printf ( ”maximum s t ea d y s t a t e v o l t a g e r a t i n g o f e ac h t h y r i s t o r = %. 2 f V” ,Vd) De=1-(V/(ns*Vd)); printf ( ” \ n S te a d y s t a t e v o l t ag e d e r a t i n g = %. 3 f ” ,De) Vd=(V+(ns-1)*(dQ/C))/ns; printf ( ” \nmaximum t r a n s i e n t s t a t e v o l t a g e r a t i n g o f e ac h t h y r i s t o r = %. 2 f V” ,Vd) De=1-(V/(ns*Vd));
26
17 printf ( ” \ n t r a n s i en t De )
s t a t e v o l t a g e d e ra t i n g = %. 3 f ” ,
Scilab code Exa 1.33 Find number of thyristor in series and parallel
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 1. 33
clc ; Im=1000; De=0.14; It=75; np=(Im/It)/(1-De); printf ( ” np = %. 2 f ” ,np) disp ( ’ s o t h e no . o f t h y r i s t o r s i n p a r a l l e l a re 16 ’ ) Vs=7500; De=0.14; Vd=500; ns=(Vs/Vd)/(1-De); printf ( ” n s = %. 2 f ” ,ns) disp ( ’ s o t h e no . o f t h y r i s t o r s i n s e r i e s a re 18 ’ )
Scilab code Exa 1.34 Find Stored charge and peak reverse current
1 2 3 4 5 6 7 8 9
// 1. 34 clc ; trr=2.5*10^-6;
//b=di/dt
b=35*10^6; Qrr=0.5*trr^2*b*10^6; printf ( ” S t o r e d c h a r g e= %. 3 f uC” ,Qrr) Irr=(2*Qrr*10^-6*b)^0.5; printf ( ” Peak r e v e r s e c u r r e n t= %. 1 f A” ,Irr)
27
Chapter 2 Controlled Rectifiers
Scilab code Exa 2.3 Calculate the different parameters of half wave diode
rectifier 1 2 3 4 5 6
// 2. 3 clc ; Vp_sec=230*2^0.5/4; alph=asind(12/Vp_sec); alph1=180-alph;
/ / t he d io d e w i l l c on du ct fro m 8 . 8 9 d e g r e e t o 1 7 1. 5 1 degree
7 Angle_conduction=alph1-alph; 8 printf ( ” C o n du c ti o n A ng le = %. 2 f d e g r e e ” , Angle_conduction) 9 Idc=4; 10 R=1/(2*Idc*%pi)*(2*Vp_sec*cosd(alph)+(2*12*alph*%pi /180) -12*%pi ); 11 printf ( ” \ n R e s i s t a n c e = %. 2 f ohm ” , R) 12 Irms=((1/(2*%pi*R^2))*(((Vp_sec^2/2+12^2)*(%pi-2* alph*%pi/180))+(Vp_sec^2/2*sind(2*alph))-(4* Vp_sec*12*cosd(alph))))^0.5; 13 P_rating=Irms^2*R; 14 printf ( ” \ nPower r a t i n g o f r e s i s t o r = %. 2 f W” , P_rating)
28
Pdc=12*Idc; t_charging=150/Pdc; printf ( ” \ n Ch a rg i ng t i me = %. 3 f h ” , t _ c ha r g in g ) R e c t i fi e r _ e ff i c i e nc y = P dc / ( P d c + I r ms ^ 2 * R ) ; printf ( ” \ n R e c t i f i e r e f f i c i e n c y = %. 2 f ” , Rectifier_efficiency) 20 PIV=Vp_sec+12; 21 printf ( ” \nPIV = %.3 f V” ,PIV) 15 16 17 18 19
Scilab code Exa 2.4 Calculate the different parameters of full wave centre
tapped diode rectifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// 2. 4
clc ; Vm=100; R=5; Idc=2*Vm/(%pi*R); printf ( ” \ n I d c = %. 3 f A” ,Idc) Vdc=Idc*R; printf ( ” \nVdc = %.3 f V” ,Vdc) Irms=0.707*Vm/R; printf ( ” \ n I r m s = %. 3 f A” ,Irms) Vrms=Irms*R; printf ( ” \nVrms = %.3 f V” ,Vrms) Pdc=Idc^2*R; printf ( ” \ nPdc = %. 3 f W” ,Pdc) Pac=Irms^2*R; printf ( ” \ nPac = %.3 f W” ,Pac) FF=Vrms/Vdc; printf ( ” \nFF = %. 3 f ” ,FF) RF=(FF^2-1)^0.5; printf ( ” \nRF = % . 3 f ” ,RF) TUF=0.5732; printf ( ” \nTUF = %.3 f ” ,TUF) PIV=2*Vm;
29
24 printf ( ” \nPIV = %.0 f V” ,PIV) 25 CF=0.707; 26 printf ( ” \nCF = % . 3 f ” ,CF)
Scilab code Exa 2.5 Find the RMS and average voltage and current
1 2 3 4 5 6 7 8 9
// 2. 5
10 11 12 13
clc ; Vm=400; alpha=30; R=50; Vdc=(Vm/(2*%pi))*(1+cosd(alpha)); printf ( ” A v er ag e Load v o l t a g e = %. 1 f V” , Vd c) Load_current_average=Vdc/R; printf ( ” \ n A ve r ag e Lo ad c u r r e n t = %. 3 f A” , Load_current_average) V=400*(((%pi-(%pi/6))/(4*%pi))+(sind(60)/(8*%pi))) ^0.5; printf ( ” \nRMS v o l t a g e = % . 1 f V” , V ) RMS_current=V/R; printf ( ” \nRMS c u r r e n t = %. 3 f A” , R M S _ cu r r e nt )
Scilab code Exa 2.6 Find the average current
1 // 2. 6 2 clc ; 3 current_average=(1/(2*%pi))*(-10* cos (5*%pi/6)+10* cos (%pi/6) -(5*5*%pi/6)+(5*%pi /6)); 4 printf ( ” \ n Av er ag e c u r r e n t = %. 3 f A” , current_average)
30
Scilab code Exa 2.7 Find the average current
1 // 2. 7 2 clc ; 3 / / t he t h y r i s t o r
w i l l c on du ct when i n s t a n t e n o u s v a l ue o f s o u r ce emf i s more th an t he ba ck emf i . e . 2 ˆ0 .5 ∗ 1 0 0 s i n wt = 5 5. 5
4 wt1=asind(55.5/(2^0.5*110)); 5 wt2=180-wt1; 6 current_average=(1/(2*%pi))*(-15.554*(cosd(wt2)-cosd (wt1)) -5.55*(2.7768 -0.3684)); 7 printf ( ” \ n Av er ag e c u r r e n t = %. 2 f A” , current_average)
Scilab code Exa 2.8 Calculate the various parameters of a single phase
half wave rectifier // 2. 8
1 2 3 4 5 6
7 8 9 10 11 12 13 14 15 16 17
clc ; Vm=230*2^0.5; Vdc=(Vm/(2*%pi))*(1+cosd(90)); Idc=Vdc/15; Vrms=Vm*(((%pi-(%pi/2))/(4*%pi))+( sin (2*%pi)/(8*%pi) ))^0.5; Irms=Vrms/15; Pdc=Vdc*Idc; Pac=Vrms*Irms; Rec_effi=Pdc/Pac; Form_factor=Vrms/Vdc; printf ( ” \n Form F a c t o r = %. 1 f ” , F o r m _f a c t or ) ripple_factor=(Form_factor^2-1)^0.5; printf ( ” \n R i pp l e F ac to r = %. 1 f ” , r i p p le _ f a ct o r ) VA_rating=230*7.66; printf ( ” \n VA r a t i n g = %. 1 f VA” , V A _r a ti n g ) TUF=Pdc/VA_rating;
31
18 printf ( ” \n TUF = % . 3 f ” , F o r m_ f a c to r ) 19 PIV=Vm; 20 printf ( ” \n PIV = %. 1 f V” , PIV )
Scilab code Exa 2.9 Find the RMS and average voltage and current of a
single phase full wave rectifier 1 2 3 4 5 6 7
// 2. 9
8 9 10 11
clc ; Vm=150*2^0.5; Vdc=(Vm/(%pi))*(1+cosd(45)); R=30; Load_current_average=Vdc/R; printf ( ” \ n A ve r ag e Lo ad c u r r e n t = %. 2 f A” , Load_current_average) Vrms=Vm*(((%pi-(%pi/4))/(2*%pi))+(sind(90)/(4*%pi))) ^0.5; printf ( ” \nRMS v o l t a g e = % . 1 f V” , V rm s ) RMS_current=Vrms/R; printf ( ” \nRMS c u r r e n t = %. 3 f A” , R M S _ cu r r e nt )
Scilab code Exa 2.10 Calculate the different parameters of full wave con-
verter with centre tapped transformer 1 2 3 4 5 6 7 8 9
// 2. 10
clc ; Vdc=100; Vm=(Vdc+1.7)*%pi/(2*cosd(30)); Vrms_sec=Vm/2^0.5; Vrms_pri=230; Turn_ratio=Vrms_pri/Vrms_sec; printf ( ” \ n Turn R a t i o = %. 2 f ” , T u r n _r a t io ) Ip=15;
32
10 Irms_sec=(Ip^2/2)^0.5; 11 Trans_rating=2*Vrms_sec*Irms_sec; 12 printf ( ” \ n T r a n s f or m e r r a t i n g = %. 2 f VA” , Trans_rating) 13 PIV=2*Vm; 14 printf ( ” \nPIV = %.2 f V” , PI V) 15 printf ( ” \nRMS v a lu e o f t h y r i s t o r c u r r e n t = %. 2 f A” , Irms_sec)
Scilab code Exa 2.11 Calculate the voltage rating of full wave central tap
and bridge rectifiers 1 2 3 4 5 6 7 8
// 2. 11
9 10 11
clc ; Idc=50; Vdc=10*1000/Idc; Vm=200*%pi/2; PIV_central_tap=2*Vm; V _ r a t in g _ c e nt r a l _ ta p = 2* P I V _ ce n t r al _ t a p ; printf ( ” The r a t ed v o l t a g e o f f u l l wave c e n t r a l t ap t r a n s f o r m e r r e c t i f i e r = % . 2 f V” , V _ r a t in g _ c e nt r a l _t a p ) PIV_bridge=Vm; V_rating_bridge=2*PIV_bridge; printf ( ” \nThe r a t ed v o l t a g e o f f u l l wave b r i d g e r e c t i f i e r = %. 2 f V” , V _ ra t in g _b r id g e )
Scilab code Exa 2.12 Find the output voltage firing angle and load cur-
rent 1 // 2. 12 2 clc ; 3 Vm=230*2^0.5;
33
4 Vrms=(800/1000*230^2)^0.5; 5 printf ( ” O ut pu t V o l t a g e = %. 2 f V” , Vrms ) 6 //Vrms=Vm∗ ( ( % p i−al ph ) /(2 ∗ % pi ) +s i n d ( 2 ∗ al ph ) /(4 ∗ %pi) )
ˆ 0 . 5 on s o l v i n g 7 8 9 10
alph=61; printf ( ” \ n F i r in g a n g le = %. 0 f d e g re e ” , alph ) I=800/Vrms; printf ( ” \ nLoad c u r r e n t = %. 2 f A” , I )
Scilab code Exa 2.13 Find the average power output of full wave mid
point and bridge converter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// 2. 13
clc ; disp ( ’ F or Mid p o i n t c o n v e r t e r ’ ) Vm=800/(2*2.5); alph=0; Vo=Vm/(%pi)*(1+cosd(alph)); Idc=30/2.5; Pdc=Idc*Vo; printf ( ” A v e r a g e o u t p u t p o we r = % . 2 f W” , P d c ) disp ( ’ F or b r i d ge c o n v e r t e r ’ ) Vm=800/(2.5); alph=0; Vo=Vm/(%pi)*(1+cosd(alph)); Idc=30/2.5; Pdc=Idc*Vo; printf ( ” A v e r a g e o u t p u t p o we r = % . 2 f W” , P d c )
Scilab code Exa 2.14 Find dc output voltage and power
1 // 2. 14 2 clc ;
34
3 4 5 6 7 8 9
Vm=230*2^0.5; alph=30; Vo=Vm/(2*%pi)*(3+cosd(alph)); Idc=Vo/10; printf ( ” d c o u tp ut v o l t a g e = %. 1 f V” , V o ) Pdc=Idc*Vo; printf ( ” \ n d c p o w er = %. 2 f W” , P d c )
Scilab code Exa 2.15 Find dc output voltage and power
1 2 3 4 5 6 7 8
// 2. 15
clc ; Vm=230*2^0.5; Vo=2*Vm/%pi; Idc=Vo/10; printf ( ” d c o u tp ut v o l t a g e = %. 2 f V” , V o ) Pdc=Idc*Vo; printf ( ” \ n d c p o w er = %. 2 f W” , P d c )
Scilab code Exa 2.16 Calculate the firing angle and power factor
1 2 3 4 5 6 7 8 9 10 11 12
//
clc ; disp ( ’ I f E=10 0 V ’ ) Vm=230*2^0.5; E=100; R=0.5; Io=15; alph=acosd((E+15*0.5)*%pi/(2*Vm)); printf ( ” F i r i n g A ng le = %. 2 f d e g r e e ” , a lp h ) pf=(100*15+15^2*0.5)/(230*15); printf ( ” \ nPower f a c t o r = %. 3 f l a g g i n g ” , pf ) disp ( ’ I f E=−1 0 0 V ’ )
35
13 E=-100; 14 alph=acosd((E+15*0.5)*%pi/(2*Vm)); 15 printf ( ” \ n F i r i n g A ng le when E i s −100 = %. 2 f W” , alph) 16 pf=(100*15-15^2*0.5)/(230*15); 17 printf ( ” \ nPower f a c t o r = %. 3 f l a g g i n g ” , pf )
Scilab code Exa 2.17 Find the average value of load current
1 2 3 4 5 6
// 2. 17
clc ; Vm=230*2^0.5; alph=40; Io=((2*Vm/%pi*cosd(alph))-50)/5; printf ( ” A ver ag e v a lu e o f l o ad c u r r e nt = %. 2 f A” , Io )
Scilab code Exa 2.18 Calculate the different parameters of full wave con-
verter with bridge transformer 1 2 3 4 5 6 7 8 9 10 11 12
// 2. 18
13
clc ; Vdc=100; Vm=(Vdc+2*1.7)*%pi/(2*cosd(30)); Vrms_sec=Vm/2^0.5; Vrms_pri=230; Turn_ratio=Vrms_pri/Vrms_sec; printf ( ” \ n Turn R a t i o = %. 2 f ” , T u r n _r a t io ) Irms_sec=15/2^0.5; Ip=15; Trans_rating=Vrms_sec*Ip; printf ( ” \ n T r a n s f or m e r r a t i n g = %. 2 f VA” , Trans_rating) PIV=Vm;
36
14 printf ( ” \nPIV = %.2 f V” , PI V) 15 printf ( ” \nRMS v a lu e o f t h y r i s t o r Irms_sec)
c u r r e n t = %. 2 f A” ,
Scilab code Exa 2.19 Find the value of dc voltage rms voltage and form
factor of a single phase semi converter 1 2 3 4 5 6 7 8 9
// 2. 19
clc ; Vm=230*2^0.5; Vdc=Vm/%pi*(1+cosd(90)); printf ( ” dc v a lu e o f v o l t a g e = %. 2 f V” , Vdc ) Vrms=230*((1/%pi)*(%pi-(%pi/2)+ sin (%pi)/2))^0.5; printf ( ” \n RMS v a l u e o f v o l t a g e = %. 2 f V” , V rm s ) form_factor=Vrms/Vdc; printf ( ” \nForm f a c t o r = %. 2 f ” , f o r m_ f a c to r )
Scilab code Exa 2.20 Calculate the different parameters of single phase
semi converter bridge 1 2 3 4 5 6 7 8 9 10 11 12
// 2. 20
clc ; Vm=230*2^0.5; Vdc=Vm/%pi*(1+cosd(90)); printf ( ” dc v a lu e o f v o l t a g e = %. 2 f V” , Vdc ) Vrms=230*((1/%pi)*(%pi-(%pi/2)+ sin (%pi)/2))^0.5; printf ( ” \n RMS v a l u e o f v o l t a g e = %. 2 f V” , V rm s ) Is=(1-(%pi/2)/%pi)^0.5; Is1=2/%pi*2^0.5* cos (%pi/4); HF=((Is/Is1)^2-1)^0.5; printf ( ” \n H armo nic f a c t o r = %. 3 f ” , HF ) Displacement_factor= cos (-%pi/4);
37
13 printf ( ” \n D i s pl a ce m en t f a c t o r = %. 4 f ” , Displacement_factor) 14 Power_factor=Is1/Is* cos (-%pi/4); 15 printf ( ” \n Power f a c t o r = %. 4 f l a g g i n g ” , P o w e r_ f a c to r )
Scilab code Exa 2.21 Calculate the different parameters of single phase
full converter 1 2 3 4 5 6 7 8 9 10 11 12 13
// 2. 21
14 15
clc ; Vm=230*2^0.5; Vdc=2*Vm/%pi*cosd(60); printf ( ” dc v a lu e o f v o l t a g e = %. 2 f V” , Vdc ) Vrms=230; printf ( ” \n RMS v a l u e o f v o l t a g e = %. 2 f V” , V rm s ) Is1=2*2^0.5/%pi; Is=1; HF=((Is/Is1)^2-1)^0.5; printf ( ” \n H armo nic f a c t o r = %. 3 f ” , HF ) Displacement_factor= cos (-%pi/3); printf ( ” \n D i s pl a ce m en t f a c t o r = %. 1 f ” , Displacement_factor) Power_factor=Is1/Is* cos (-%pi/3); printf ( ” \n Power f a c t o r = %. 2 f l a g g i n g ” , P o w e r_ f a c to r )
Scilab code Exa 2.22 Calculate the different parameters of single phase
full controlled bridge converter 1 // 2. 22 2 clc ; 3 Vm=230*2^0.5;
38
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
Vdc=2*Vm/%pi*cosd(30); R=Vdc/4; printf ( ” dc v a lu e o f v o l t a g e = %. 1 f V” , Vdc ) IL=4; I=2*2^0.5/%pi*IL; P_input_active=230*I*cosd(30); printf ( ” \n A c t i v e i n p u t p ow er= %. 2 f W” , P_input_active) P_input_reactive=230*I*sind(30); printf ( ” \n r e a c t i v e i n p u t po we r= %. 2 f V ar s ” , P_input_reactive) P_input_appearent=230*I; printf ( ” \n A c t i v e i n p u t p ow er= %. 2 f VA” , P_input_appearent) disp ( ’ When f r e e w h e e l i n g d i od e i s p r e s e n t ’ ) Vm=230*2^0.5; Vdc=Vm/%pi*(1+cosd(30)); printf ( ” dc v a lu e o f v o l t a g e = %. 1 f V” , Vdc ) IL=Vdc/R; I=2*2^0.5/%pi*IL*cosd(15); P_input_active=230*I*cosd(15); printf ( ” \n A c t i v e i n p u t p ow er= %. 2 f W” , P_input_active) P_input_reactive=230*I*sind(15); printf ( ” \n r e a c t i v e i n p u t po we r= %. 2 f V ar s ” , P_input_reactive) P_input_appearent=230*I; printf ( ” \n A c t i v e i n p u t p ow er= %. 2 f VA” , P_input_appearent) disp ( ’ When T h3 g e t o pe n c i r c u i t ’ ) Vdc=230/(2^0.5*%pi)*(1+cosd(30)); printf ( ” dc v a lu e o f v o l t a g e = %. 3 f V” , Vdc ) Idc=Vdc/R; printf ( ” \ n Av er ag e d c o u t pu t c u r r e n t = %. 2 f A” , Idc )
39
Scilab code Exa 2.23 Calculate the different parameters of single phase
full controlled bridge converter // 2. 23
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
clc ; Vm=230*2^0.5; Vdc=2*Vm/%pi*cosd(30); printf ( ” dc v a lu e o f v o l t a g e = %. 1 f V” , Vdc ) Irms=10; I=10; printf ( ” \n RMS v a l u e o f c u r r e n t = %. 0 f A” , I rm s ) Is1=2*2^0.5/%pi*I; printf ( ” \n F un da me nt al c om po ne nt o f i n p u t c u r r e n t = % . 0 f A” , Is 1) Is=10; HF=((Is/Is1)^2-1)^0.5; printf ( ” \n H armo nic f a c t o r = %. 3 f ” , HF ) Displacement_factor=cosd(-30); printf ( ” \n D i s pl a ce m en t f a c t o r = %. 3 f ” , Displacement_factor) Power_factor=Is1/Is* cos (-%pi/6); printf ( ” \n Power f a c t o r = %. 3 f l a g g i n g ” , P o w e r_ f a c to r ) Out_rms=230; Form_factor=Out_rms/Vdc; Ripple_factor=(Form_factor^2-1)^0.5; printf ( ” \n R ip pl e f a c t o r = %. 3 f ” , R i p p le _ f a ct o r )
Scilab code Exa 2.24 Calculate peak circulating current and peak current
of converter 1 // 2. 24
40
2 3 4 5 6 7 8 9 10 11
12 13 14
clc ; Vm=230*2^0.5; alph1=60; alph2=120; w=100*%pi; L=50*10^-3; wt=2*%pi; R=15; Ip_circulating=2*Vm/(w*L)*( cos (wt)-cosd(alph1)); printf ( ” \n Peak c i r c u l a t i n g c u r r e n t= %. 1 f A” , Ip_circulating) Ip_load=Vm/R; Ip_converter1=Ip_circulating+Ip_load; printf ( ” \n Peak c u r r e n t o f c o n v e r t e r 1= %. 2 f A” , Ip_converter1)
Scilab code Exa 2.25 Calculate inductance of current limiting reactor and
peak current of converter 1 2 3 4 5 6 7 8 9 10 11
// 2. 25
12 13 14
clc ; Vm=230*2^0.5; alph1=30; alph2=150; w=100*%pi; wt=2*%pi; R=10; Ip_circulating=10.2; L=2*Vm/(w*Ip_circulating)*( cos (wt)-cosd(alph1)); printf ( ” \n I nd u c ta n c e o f c u r r e n t l i m i t i n g R ea ct or= % . 4 f H” ,L) Ip_load=Vm/R; Ip_converter1=Ip_circulating+Ip_load; printf ( ” \n Peak c u r r e n t o f c o n v e r t e r 1= %. 2 f A” , Ip_converter1)
41
Scilab code Exa 2.26 Calculate inductance of current limiting reactor and
resistance 1 2 3 4 5 6 7 8 9 10 11
// 2. 26
12 13 14 15
clc ; Vm=230*2^0.5; alph1=45; alph2=135; w=100*%pi; wt=2*%pi; R=10; Ip_circulating=11.5; L=2*Vm/(w*Ip_circulating)*( cos (wt)-cosd(alph1)); printf ( ” \n I nd u c ta n c e o f c u r r e n t l i m i t i n g R ea ct or= % . 4 f H” ,L) Ip_converter1=39.7; I p _ lo a d = I p _c o n ve r t er 1 - I p _ c i r c ul a t i ng ; R=Vm/Ip_load; printf ( ” \n Load r e s i s t a n c e = %. 3 f ohm” , R)
Scilab code Exa 2.27 Find the parameters of three phase bridge rectifier
circuit 1 2 3 4 5 6 7 8
// 2. 27
clc ; Vm=400*2^0.5/3^0.5; Vdc=360; alph=acosd(Vdc*%pi/(3*3^0.5*Vm)); printf ( ” F i r i n g A ng le = %. 1 f d e g r e e ” , a lp h ) VL=400; IL=200;
42
9 10 11 12 13 14 15 16 17 18 19 20 21 22
S=3^0.5*VL*IL; printf ( ” \ nApparent Power = %.0 f VA” ,S ) P=S*cosd(alph); printf ( ” \ n A c t i v e P ow er = %. 1 f W” ,P ) Q=(S^2-P^2)^0.5; printf ( ” \ n R e a c t i v e P ow er = %. 1 f VA” ,Q ) disp ( ’ When AC l i n e v o l t a g e i s 4 40V ’ ) V=440; alph=acosd(Vdc*%pi/(3*2^0.5*V)); printf ( ” F i r i n g A ng le = %. 1 f d e g r e e ” , a lp h ) disp ( ’ When AC l i n e v o l t a g e i s 3 60V ’ ) V=360; alph=acosd(Vdc*%pi/(3*2^0.5*V)); printf ( ” F i r i n g A ng le = %. 1 f d e g r e e ” , a lp h )
Scilab code Exa 2.28 Find the parameters of three phase full converter
1 2 3 4 5 6 7 8 9
// 2 ,28
10 11 12 13 14 15
clc ; Vm=2^0.5*400/3^0.5; Vdc=3*3^0.5*Vm/%pi* cos (%pi/3); Idc=150; Pdc=Vdc*Idc; printf ( ”Output Power = %. 1 f W” , Pdc ) Iavg_thy=Idc/3; printf ( ” \ n Av er ag e t h y r i s t o r c u r r e n t = %. 0 f A” , Iavg_thy) Irms_thy=Idc*(2/6)^0.5; printf ( ” \nRMS v a lu e o f t h y r i s t o r c u r r e n t = %. 1 f A” , Irms_thy) Ip_thy=Idc; printf ( ” \ nPeak c u r r e nt t hr ou gh t h y r i s t o r = %. 0 f A” , Ip_thy) PIV=2^0.5*400; printf ( ” \ nPeak i n v e r s e v o l t a g e = %. 1 f V” , PIV )
43
Scilab code Exa 2.29 Find the firing angle of a 3 phase fully controlled
bridge converter 1 2 3 4 5
// 2. 29
6
clc ; Vm=400*2^0.5/3^0.5; Vrms=(400*100)^0.5; alph=acosd(((Vrms/(Vm*3^0.5))^2-0.5)/(3*3^0.5/(4*%pi )))/2; printf ( ” F i r i n g a n g l e = %. 2 f d e g re e ” , a lp h )
Scilab code Exa 2.30 Find the parameters of six pulse thyristor converter
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 2. 30
clc ; Vm=415*2^0.5/3^0.5; Vdc=460; Idc=200; alph=acosd(Vdc*%pi/(3*3^0.5*Vm)); printf ( ” F i r i n g A ng le = %. 2 f d e g r e e ” , a lp h ) Pdc=Vdc*Idc; printf ( ” \ ndc Power = %. 2 f W” , Pd c) Iac=Idc*(120/180)^0.5; printf ( ” \nAC l i n e c u r r e n t = %. 2 f A” , Iac ) Ip=Idc; Irms_thy=Ip*(120/360)^0.5; printf ( ” \nRMS t h y r i s t o r c u r r e n t = %. 1 f A” , I r ms _ th y )
44
Scilab code Exa 2.31 Find the parameters of three phase semi converter
bridge circuit // 2. 31
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
clc ; Vm=400*2^0.5/3^0.5; alph=0; Vdc_max=3*3^0.5*Vm/(2*%pi)*(1+cosd(alph)); Vdc=0.5*Vdc_max; alph=acosd((Vdc/(3*3^0.5*Vm/(2*%pi)))-1) printf ( ” F i r i n g A ng le = %. 2 f d e g r e e ” , a lp h ) R=10; Idc=Vdc/R; disp ( ’ F or d i s c o n t i n i o u s l o a d ’ ) Vrms=(3^0.5*Vm)*((3/(4*%pi))*(%pi-(%pi/2)+0.5* sin ( %pi)))^0.5; printf ( ” \nRMS v a l u e o f v o l t a g e = %. 2 f V” , V rm s ) Irms=Vrms/R; printf ( ” \nRMS v a l u e o f c u r r e n t = %. 2 f A” , I rm s ) I_avg=Idc/3; printf ( ” \ n Av er ag e v a lu e o f t h y r i s t o r c u r r e nt = %. 2 f A” , I _a vg ) I_rms=Irms/3^0.5; printf ( ” \nRMS v a lu e o f t h y r i s t o r c u r r e n t = %. 2 f A” , I_rms) efficiency=Vdc*Idc/(Vrms*Irms); printf ( ” \ n R e c t i f i c a t i o n e f f i c i e n c y = %. 3 f A” , efficiency) Irms_line_current=Irms*(120/180)^0.5; VA_input=3*400/3^0.5*Irms_line_current; TUF=Vdc*Idc/VA_input; printf ( ” \ n Tr an sf or me r u t i l i z a t i o n f a c t o r = %. 2 f ” , TUF) output_power_active=Irms^2*R; input_power_active=output_power_active; pf_input=input_power_active/VA_input; printf ( ” \ n i np u t po we r f a c t o r = %. 2 f l a g g i n g ” , pf_input)
45
Scilab code Exa 2.32 Find the parameters of three phase fully controlled
bridge converter // 2. 31
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
clc ; Vm=400*2^0.5/3^0.5; alph=0; Vdc_max=3*3^0.5*Vm/(%pi)*cosd(alph); Vdc=0.5*Vdc_max; alph=acosd(0.5); printf ( ” F i r i n g A ng le = %. 2 f d e g r e e ” , a lp h ) R=10; Idc=Vdc/R; disp ( ’ F or d i s c o n t i n i o u s l o a d ’ ) Vrms=(3^0.5*Vm)*(3*3^0.5/(4*%pi)*cosd(2*alph)+0.5) ^0.5; printf ( ” \nRMS v a l u e o f v o l t a g e = %. 2 f V” , V rm s ) Irms=Vrms/R; printf ( ” \nRMS v a l u e o f c u r r e n t = %. 2 f A” , I rm s ) I_avg=Idc/3; printf ( ” \ n Av er ag e v a lu e o f t h y r i s t o r c u r r e nt = %. 2 f A” , I _a vg ) I_rms=Irms/3^0.5; printf ( ” \nRMS v a lu e o f t h y r i s t o r c u r r e n t = %. 2 f A” , I_rms) efficiency=Vdc*Idc/(Vrms*Irms); printf ( ” \ n R e c t i f i c a t i o n e f f i c i e n c y = %. 3 f A” , efficiency) Irms_line_current=Irms*(120/180)^0.5; VA_input=3*400/3^0.5*Irms_line_current; TUF=Vdc*Idc/VA_input; printf ( ” \ n Tr an sf or me r u t i l i z a t i o n f a c t o r = %. 2 f ” , TUF) output_power_active=Irms^2*R;
46
27 input_power_active=output_power_active; 28 pf_input=input_power_active/VA_input; 29 printf ( ” \ n i np u t po we r f a c t o r = %. 2 f l a g g i n g ” , pf_input)
Scilab code Exa 2.33 Calculate the overlap angles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// 2. 33
clc ; Vm=326.56; f=50; Ls=0.2*10^-3; Io=200; w=2*%pi*f; a=3*w*Ls*Io/%pi; b=3*3^0.5*Vm/%pi; disp ( ’ F or f i r i n g a n g le 20 d e g re e ’ ) alph=20; A n g l e_ o v e rl a p = a c os d ( ( b * c o sd ( a l p h ) - a ) / b ) - a lp h ; printf ( ” O v er la p a n g l e= %. 1 f d e g r e e ” , A n g l e_ o v e rl a p ) disp ( ’ F or f i r i n g a n g le 30 d e g re e ’ ) alph=30; A n g l e_ o v e rl a p = a c os d ( ( b * c o sd ( a l p h ) - a ) / b ) - a lp h ; printf ( ” O v er la p a n g l e= %. 2 f d e g r e e ” , A n g l e_ o v e rl a p ) disp ( ’ F or f i r i n g a n g le 60 d e g re e ’ ) alph=60; A n g l e_ o v e rl a p = a c os d ( ( b * c o sd ( a l p h ) - a ) / b ) - a lp h ; printf ( ” O v er la p a n g l e= %. 4 f d e g r e e ” , A n g l e_ o v e rl a p )
Scilab code Exa 2.34 Find the value of circulating currents for 3 phase
dual converter 1 // 2. 34
47
2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19
20 21 22 23
clc ; Vm=400*2^0.5/3^0.5; f=50; w=2*%pi*f; L=60*10^-3; alph=0; disp ( ’ C i r c u l a t i n g c u r r e n t a t wt=0 ’ ) wt=0; ir=3*Vm/(w*L)*(sind(wt-30)-sind(alph)) printf ( ” C i r c u l a t i n g c u r r e n t a t wt 0 i s = %. 3 f A” , ir ) disp ( ’ C i r c u l a t i n g c u r r e n t a t wt=30 ’ ) wt=30; ir=3*Vm/(w*L)*(sind(wt-30)-sind(alph)) printf ( ” C i r c u l a t i n g c u r r e nt a t wt 30 i s = %. 3 f A” , ir ) disp ( ’ C i r c u l a t i n g c u r r e n t a t wt=90 ’ ) wt=90; ir=3*Vm/(w*L)*(sind(wt-30)-sind(alph)) printf ( ” C i r c u l a t i n g c u r r e nt a t wt 90 i s = %. 3 f A” , ir ) disp ( ’ Maximum C i r c u l a t i n g c u r r e n t w i l l o c cu r a t wt =120 ’ ) wt=120; ir=3*Vm/(w*L)*(sind(wt-30)-sind(alph)) printf ( ”Maximum C i r c u l a t i n g c u r r e n t i s = %. 3 f A” , ir )
Scilab code Exa 2.35 Find the value of inductance
1 2 3 4 5 6 7
// 2. 35
clc ; Vm=400*2^0.5/3^0.5; f=50; w=2*%pi*f; ir=42; L=3*Vm/(w*ir)*(sind(120-30)-sind(0))
48
8 printf ( ” I n d u c t a n c e= %. 3 f H” , L)
49
Chapter 3 Inverters
Scilab code Exa 3.1 Find the maximum output frequency
1 2 3 4 5 6 7 8 9 10
// 3. 1
11 12
clc ; R=80; L=8*10^-3; C=1.2*10^-6; a=R^2; b=4*L/C; printf ( ”Rˆ 2 = % . 0 f ” , a) printf ( ” 4∗L /C = %. 0 f ” , b) disp ( ’ s i n c e Rˆ2 < 4L/C i t w i l l work a s s e r i e s i n v e r t e r ’) fmax=(1/(L*C)-(R^2/(4*L^2)))^0.5; printf ( ” Maximum f r e q u e n c y = %. 2 f r a d / s e c ” , f ma x )
Scilab code Exa 3.2 Find the frequency of output
1 // 3. 2 2 clc ;
50
3 4 5 6 7
f=1416.16; T=1/f; Toff=14*10^-6; fo=1/(T+2*Toff); printf ( ” o u t p u t f r e q u e n c y = %. 1 f Hz ” , f o )
Scilab code Exa 3.3 Find the available circuit turn off time and maximum
possible frequency 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 3. 3
15 16
clc ; R=4; L=50*10^-6; C=6*10^-6; a=R^2; b=4*L/C; wr=(1/(L*C)-(R^2/(4*L^2)))^0.5; fr=wr/(2*%pi); Tr=1/fr; fo=6000; wo=2*%pi*fo; toff=%pi*(1/wo-1/wr); printf ( ” A v i al a b l e c i r c u i t t ur n o f f t im e = %. 8 f s e c ” , toff) fmax=1/(2*(%pi/wr+6*10^-6)); printf ( ” \nMaximum f r e q u e n c y = %. 1 f Hz ” , f ma x )
Scilab code Exa 3.4 Design a parallel inverter
1 2 3 4
// 3. 4 clc ; tq=50*10^-6; Vin=40;
51
5 6 7 8 9
Vo=230; IL=2; IL_ref=2*Vo/Vin;
// C/L=(IL−r e f / Vin ) ˆ 2 ; (i) // Assume t h a t c i r c u i t i s r e v e r s e b i a s e d f o r one− f o u r t h p e r i o d o f r es o n a n t c i r c u i t . t hu s 10 / / % p i / 3 ∗ ( L∗C) ˆ0.5=5 0∗1 0 ˆ −6 ; ( ii ) 11 // on s o l v i n g ( i ) and ( i i ) 12 13 14 15 16
C=13.73*10^-6; L=C/(IL_ref/Vin)^2*10^6; C=13.73*10^-6*10^6; printf ( ”C=%. 3 f uF” ,C) printf ( ” \nL=%. 2 f uH” ,L )
Scilab code Exa 3.5 Calculate the various parameters of single phase half
bridge inverter // 3. 5
1 2 3 4 5
6 7 8 9 10 11
12 13 14 15
clc ; V=30; Vrms1=2*V/(2^0.5*%pi); printf ( ”RMS v a l u e o f f u n da m e nt a l c om po ne nt o f i n p u t v o l t a g e = %. 1 f V” , V rm s1 ) VL=V/2; R=3; Pout=VL^2/R; printf ( ” \ nOutput Power = %.0 f W” , P ou t ) Ip_thy=VL/R; printf ( ” \ nPeak c u r r e nt i n e ac h t h y r i s t o r = %. 0 f A” , Ip_thy) Iavg=Ip_thy/2; printf ( ” \ n av er ag e c u r r e n t i n e a ch t h y r i s t o r = %. 1 f A ” , I av g ) PIV=2*VL; printf ( ” \ nPeak r e v e r s e b l o c k i n g v o l t a h e = %. 0 f V” ,
52
PIV)
Scilab code Exa 3.6 Calculate the various parameters of single phase full
bridge inverter // 3. 6
1 2 3 4 5
6 7 8 9 10 11
12 13 14 15
clc ; V=30; Vrms1=4*V/(2^0.5*%pi); printf ( ”RMS v a l u e o f f u n da m e nt a l c om po ne nt o f i n p u t v o l t a g e = %. 1 f V” , V rm s1 ) VL=V; R=3; Pout=VL^2/R; printf ( ” \ nOutput Power = %.0 f W” , P ou t ) Ip_thy=VL/R; printf ( ” \ nPeak c u r r e nt i n e ac h t h y r i s t o r = %. 0 f A” , Ip_thy) Iavg=Ip_thy/2; printf ( ” \ n av er ag e c u r r e n t i n e a ch t h y r i s t o r = %. 1 f A ” , I av g ) PIV=VL; printf ( ” \ nPeak r e v e r s e b l o c k i n g v o l t a h e = %. 0 f V” , PIV)
Scilab code Exa 3.7 Calculate the various parameters of full bridge in-
verter 1 2 3 4 5
// 3. 7 clc ; R=10; V=200; IL_rms_funda=9.28/2^0.5;
53
6 printf ( ”RMS v a l u e
o f f u n da m e nt a l c om po ne nt o f l o a d
c u r r e n t =% . 2 f A” , I L _ r ms _ f u nd a ) 7 IL_peak=(9.28^2+6.55^2+1.89^2+0.895^2+0.525^2); 8 printf ( ” \ n Peak v a l u e o f l o a d c u r r e n t =%. 2 f A” , IL_peak) 9 Irms_harmonic=(11.56^2-9.28^2)^0.5/2^0.5; 10 printf ( ” \nRMS h a r m o n i c c u r r e n t =% . 3 f A” ,Irms_harmonic ) 11 TMH=(11.56^2-9.28^2)^0.5/9.28; 12 printf ( ” \ n T o ta l h a rm o ni c d i s t o r t i o n =%. 3 f ” ,TMH) 13 IL_rms=11.56/2^0.5; 14 Po=IL_rms^2*R; 15 printf ( ” \ n T o t a l o u t p u t p o w er=% . 1 f W” ,Po) 16 Po_funda=IL_rms_funda^2*R; 17 printf ( ” \ nFundamental Component o f power=%.3 f W” , Po_funda) 18 Iavg=Po/V; 19 printf ( ” \ n A ve r ag e i n p u t c u r r e n t =%. 4 f A” ,Iavg) 20 Ip_thy=11.56; 21 printf ( ” \ n Peak t h y r i s t o r c u r r e n t =%. 2 f A” , I p_ t hy )
Scilab code Exa 3.8 Calculate the value of C for proper load commutation
1 2 3 4 5 6 7 8 9 10
// 3. 8
clc ; toff=12*1.5*10^-6; f=4000; wt=2*%pi*f*toff; Xl=10; R=2; Xc=R* tan (wt)+Xl; C=1/(2*%pi*f*Xc)*10^6; printf ( ” V al ue o f C f o r p r o p er l o a d c om mu ta ti on = %. 2 f uF ” , C)
54
Scilab code Exa 3.9 Calculate peak value of load current
1 2 3 4 5 6 7 8
// 3. 9
clc ; I1=6.84; I3=0.881; I5=0.32; I7=0.165; Ip=(I1^2+I3^2+I5^2+I7^2)^0.5; printf ( ” Peak v a l u e o f l o a d c u r r e n t=%. 2 f A” , Ip )
Scilab code Exa 3.10 Find the different parameters of 3 phase bridge in-
verter for 120degree conduction mode // 3. 10
1 2 3 4 5
6 7 8 9
10 11
clc ; Ip_load=400/(2*10); Irms_load=(Ip_load^2*2/3)^0.5; printf ( ”RMS v a l u e o f t h e l o a d c u r r e n t = %. 2 f A” , Irms_load) Po=Irms_load^2*10*3; printf ( ” \ n O ut p ut p o w er = % . 2 f W” , Po ) Iavg_thy=Ip_load/3; printf ( ” \ n Av er ag e t h y r i s t o r c u r r e n t = %. 2 f A” , Iavg_thy) Irms_thy=(Ip_load^2/3)^0.5; printf ( ” \nRMS v a l u e t h y r i s t o r c u r r e n t = %. 2 f A” , Irms_thy)
55
Scilab code Exa 3.11 Find the different parameters of 3 phase bridge in-
verter for 180degree conduction mode 1 2 3 4 5 6 7 8
// 3. 11
9 10 11 12 13
14 15
clc ; R=10; RL=R+R/2; i1=400/15; i2=i1; i3=i1; Irms_load=(1/(2*%pi)*(i1^2*2*%pi/3+(i1/2)^2*4*%pi/3) )^0.5; printf ( ”RMS v a l u e o f t h e l o a d c u r r e n t = %. 3 f A” , Irms_load) Po=i1^2*R*3; printf ( ” \ n O ut p ut p o w er = % . 2 f W” , Po ) Iavg_thy=1/(2*%pi)*(i1*%pi/3+(i1/2*2*%pi/3)); printf ( ” \ n Av er ag e t h y r i s t o r c u r r e n t = %. 2 f A” , Iavg_thy) I r m s_ t h y = ( 1 / (2 * % p i ) * ( i 1 ^ 2* % p i / 3 + ( i 1 / 2) ^ 2 * 2 * % p i / 3) ) ^0.5; printf ( ” \nRMS v a l u e t h y r i s t o r c u r r e n t = %. 2 f A” , Irms_thy)
Scilab code Exa 3.12 Find the RMS value of load current and thyristor
current of 3 phase bridge inverter for 180degree conduction mode 1 2 3 4 5 6
// 3. 12
7
clc ; R=10; RL=R+R/2; i1=450/15; Irms_load=(1/(2*%pi)*(i1^2*2*%pi/3+(i1/2)^2*4*%pi/3) )^0.5; printf ( ”RMS v a l u e o f t h e l o a d c u r r e n t = %. 2 f A” ,
56
Irms_load) 8 I r m s_ t h y = ( 1 / (2 * % p i ) * ( i 1 ^ 2* % p i / 3 + ( i 1 / 2) ^ 2 * 2 * % p i / 3) ) ^0.5; 9 printf ( ” \nRMS v a l u e t h y r i s t o r c u r r e n t = %. 0 f A” , Irms_thy)
Scilab code Exa 3.13 Find the parameters of single phase full bridge in-
verter // 3. 13
1 2 3 4 5
6 7 8 9 10
clc ; Vdc=200; VL=Vdc*(5*30/180)^0.5; printf ( ”RMS v a l u e o f t h e o u tp u t v o l t a g e = %. 2 f V” , VL ) Vdc=220; delta=(VL/Vdc)^2*180/5; printf ( ” \ n P ul s e w id th = %. 2 f d e g r e e ” , d el ta ) V=VL/((5*33/180)^0.5); printf ( ” \nMaximum p o s s i b l e i n p u t v o l t a g e = %. 2 f V” , V)
Scilab code Exa 3.14 Calculate the RMS value of the output voltage
1 2 3 4 5 6
// 3. 14
clc ; Vdc=200; delta=120; VL=Vdc*(delta/180)^0.5; printf ( ”RMS v a l u e o f t h e o u tp u t v o l t a g e = %. 1 f V” , VL )
57
Scilab code Exa 3.15 Calculate the RMS value of the output voltage
1 2 3 4 5
// 3. 15 clc ; Vdc=150; VL=Vdc*(20/180+60/180+20/180)^0.5; printf ( ”RMS v a l u e o f t h e o u tp u t v o l t a g e = %. 2 f V” , VL )
58
Chapter 4 Choppers
Scilab code Exa 4.1 Calculate the period of conduction and blocking
1 2 3 4 5 6 7 8 9 10
// 4. 1
clc ; f=1000; T=1/f; Vav=150; V=230; Ton=(Vav/V)*T; printf ( ” P e ri o d o f c o nd u ct i on = %. 6 f s e c ” , Ton ) Toff=T-Ton; printf ( ” \ n Pe ri od o f b l o c k i n g = %. 6 f s e c ” , T of f )
Scilab code Exa 4.2 Calculate the period of conduction and blocking
1 2 3 4 5
// 4. 2 clc ; f=500; T=1/f; Vav=15*(0.06+0.03)+100;
59
6 7 8 9 10
V=200; Ton=(Vav/V)*T; printf ( ” P e ri o d o f c o nd u ct i on = %. 7 f s e c ” , Ton ) Toff=T-Ton; printf ( ” \ n Pe ri od o f b l o c k i n g = %. 7 f s e c ” , T of f )
Scilab code Exa 4.3 Calculate the duty cycle for the rated torque and half
of rated torque 1 2 3 4 5 6 7 8 9 10 11 12
// 4. 3
clc ; Vs=240; emf_800=Vs-20*0.5; emf_600=230*600/800; Vav=emf_600+20*0.5; Duty_cycle=Vav/Vs; printf ( ” Duty c y c l e when m ot or d e v el o p t h e r a t e d t o r q ue = %. 4 f ” , D u ty _ cy c le )
/ /when m otor d e ve l op h a l f o f t he r a t ed t o rq u e Vav=emf_600+10*0.5; Duty_cycle=Vav/Vs; printf ( ” \ nDuty c y c l e when motor d e ve l op h a l f r a t ed t o rq u e = %. 4 f ” , D u t y_ c y cl e )
o f t he
Scilab code Exa 4.4 Find the different parameters of a dc chopper
1 2 3 4 5 6 7
// 4. 4
clc ; Duty_cycle=0.4; Vs=200; Vd=2; Vav=Duty_cycle*(Vs-Vd); printf ( ” A v er ag e o u t pu t v o l t a g e = %. 1 f V” , Vav )
60
8 9 10 11 12 13 14
15 16 17 18
VL=Duty_cycle^0.5*(Vs-Vd); printf ( ” \nRMS o u t p u t v o l t a g e = %. 3 f V” , VL ) R=8; Po=VL^2/R; Pi=Duty_cycle*Vs*(Vs-Vd)/R; Chopper_efficiency=Po/Pi*100; printf ( ” \ n Ch opp er e f f i c i e n c y = %. 0 f p e r c e n t ” , Chopper_efficiency) Rin=R/Duty_cycle; printf ( ” \ n I np u t r e s i s t a n c e = %. 0 f Ohm” , Ri n) V1=126.05/2^0.5; printf ( ” \nRMS v a l u e o f f u n d a m e n ta l c om po ne nt = %. 3 f V” , V1 )
Scilab code Exa 4.5 Find the chopper frequency
1 2 3 4 5 6 7 8 9 10 11 12
// 4. 5
clc ; Duty_cycle=0.25; V=400; Vav=Duty_cycle*V; Vn=V-Vav; L=0.05; di=10; Ton=L*di/Vn; T=Ton/Duty_cycle; f=1/T; printf ( ” \ n Ch op pe r f r e q u e n c y = %. 0 f Hz ” , f)
Scilab code Exa 4.6 Find the different parameters of a chopper feeding a
RL load 1 // 4. 6
61
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20 21
22 23
clc ; V=200; R=4; L=6*10^-3; f=1000; T=1/f; Duty_cycle=0.5; E=0; Imax=V/R*((1- exp (-Duty_cycle*T*R/L))/(1- exp (-T*R/L)) )-E/R; printf ( ” \ n Im ax = % . 2 f A” , I ma x ) Imin=V/R*(( exp (Duty_cycle*T*R/L)-1)/( exp ( T * R / L ) - 1 ) ) E/R; printf ( ” \ n I m in = %. 2 f A” , I mi n ) Maximum_ripple=V/(R*f*L); printf ( ” \nMaximum r i p p l e = % . 2 f A” , M a x i mu m _ r ip p l e ) IL_avg=(Imax+Imin)/2; printf ( ” \ n A ve r ag e Lo ad c u r r e n t = %. 0 f A” , I L_ a vg ) iL=(Imin^2+(Imax-Imin)^2/3+Imin*(Imax-Imin))^0.5; printf ( ” \nRMS v a l u e o f Load c u r r e n t = %. 2 f A” , i L ) Iavg=0.5*IL_avg; printf ( ” \ n Av er ag e v a l u e o f i n p u t c u r r e n t = %. 2 f A” , Iavg) Irms=Duty_cycle^0.5*iL; printf ( ” \nRMS v a l u e o f i n p u t c u r r e n t = %. 3 f A” , I rm s )
Scilab code Exa 4.7 Calculate the load inductance
1 2 3 4 5 6
// 4. 7
clc ; V=300; E=0; R=5; f=250;
62
7 Id=0.2*30; 8 L=V/(4*f*Id); 9 printf ( ” Load i n d u c t a n c e = %. 3 f H” , L)
Scilab code Exa 4.8 Calculate the current
1 2 3 4 5 6 7 8 9 10
// 4. 8
11 12 13
clc ; V=200; E=100; R=0.5; t=2*10^-3; L=16*10^-3; Imin=10; i=(V-E)/R*(1- exp (-R*t/L))+Imin* exp (-R*t/L); printf ( ” C u r r e n t a t t h e i n s t a n t o f t u r n o f f t h y r i s t o r = % . 2 f A” , i) t=5*10^-3; i_5=i* exp (-R*t/L); printf ( ” \ n C u r r e n t a f t e r 5ms o f t u rn o f f t h y r i s t o r = % . 2 f A” , i_5 )
Scilab code Exa 4.9 Find the speed of motor
1 2 3 4 5 6 7 8 9
// 4. 9
clc ; emf=220; duty_cycle=0.6; Vi=220*duty_cycle; Ra=1; I=20; emf_back=Vi-I*Ra; N_no_load=1000;
63
10 N=emf_back*N_no_load/emf; 11 printf ( ” \ n S pe ed o f m ot or = %. 1 f rpm ” , N )
Scilab code Exa 4.10 Calculate average load voltage
1 2 3 4 5 6 7
// 4. 10
clc ; Ton=25*10^-3; Toff=10*10^-3; V=230; VL=V*Ton/(Ton+Toff); printf ( ” \ n Av er ag e v a l u e o f Load v o l t a g e = %. 3 f V” , VL )
Scilab code Exa 4.11 Find maximum minimum and average load current
and load voltage 1 2 3 4 5 6 7 8 9
// 4. 11
10 11 12 13 14
clc ; V=100; R=0.5; L=1*10^-3; T=3*10^-3; Duty_cycle=0.3333; E=0; Imax=V/R*((1- exp (-Duty_cycle*T*R/L))/(1- exp (-T*R/L)) )-E/R; printf ( ” \ n Im ax = % . 2 f A” , I ma x ) Imin=V/R*(( exp (Duty_cycle*T*R/L)-1)/( exp ( T * R / L ) - 1 ) ) E/R; printf ( ” \ n I m in = %. 1 f A” , I mi n ) IL_avg=(Imax+Imin)/2; printf ( ” \ n A ve r ag e Lo ad c u r r e n t = %. 1 f A” , I L_ a vg )
64
15 Vavg=Duty_cycle*V; 16 printf ( ” \ n A ve r ag e Lo ad V o l t a g e = %. 2 f V” , V av g )
Scilab code Exa 4.12 Find maximum minimum and average output volt-
age 1 2 3 4 5 6 7 8 9
// 4. 12
10 11 12 13 14
clc ; V=100; R=0.2; L=0.8*10^-3; T=2.4*10^-3; Duty_cycle=1/2.4; E=0; Imax=V/R*((1- exp (-Duty_cycle*T*R/L))/(1- exp (-T*R/L)) )-E/R; printf ( ” \ n Im ax = % . 2 f A” , I ma x ) Imin=V/R*(( exp (Duty_cycle*T*R/L)-1)/( exp ( T * R / L ) - 1 ) ) E/R; printf ( ” \ n I m in = %. 2 f A” , I mi n ) Vavg=Duty_cycle*V; printf ( ” \ n Av er ag e o u t pu t V o l t a g e = %. 2 f V” , V av g )
Scilab code Exa 4.13 Calculate the series inductance in the circuit
1 2 3 4 5 6 7
// 4. 13
clc ; V=500; f=400; I=10; L=V/(4*f*I); printf ( ” S e r i e s
i n d u c t a nc e = %. 5 f H” , L) 65
Scilab code Exa 4.14 Calculate the motor speed and current swing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// 4. 14
clc ; Motor_output=300*735.5/1000; efficiency=0.9; Motor_input=Motor_output/efficiency; Vdc=800; Rated_current=Motor_input*1000/800; R=0.1; L=100*10^-3; T=1/400; emf=Vdc-Rated_current*0.1; Duty_cycle=0.2; emf_n=Duty_cycle*Vdc-Rated_current*0.1; N=900/(emf/emf_n); printf ( ” \ n S pe ed o f m ot or = %. 2 f rpm ” , N ) dia=(Vdc-Duty_cycle*Vdc)/L*Duty_cycle*T; printf ( ” \ n C u r re n t s w i n g = %. 1 f A” , di a)
Scilab code Exa 4.15 Calculate the value of capacitance and inductance
1 2 3 4 5 6 7 8 9 10
// 4. 15
clc ; Vc=200; Im=60; toff=15*10^-6; C1=toff*Im/Vc; C=5*10^-6*10^6; printf ( ” \ n C a p a c i t a n c e = %. 0 f uF ” , C) Ipc=Im*1.5-Im; L=C/(Ipc/Vc)^2*10^6;
66
11 printf ( ” \ n I n d u c t a n c e = %. 1 f uH” , L )
Scilab code Exa 4.16 Calculate the period of conduction of a step up
chopper 1 2 3 4 5 6 7
// 4. 16
clc ; Vav=250; V=200; Toff=0.6*10^-3; Ton=(Vav/V)*Toff-Toff; printf ( ” P e ri o d o f c o nd u ct i on = %. 5 f s e c ” , Ton )
Scilab code Exa 4.17 Calculate the period of conduction of a step up
chopper 1 2 3 4 5 6 7
// 4. 16
clc ; Vav=250; V=150; Toff=1*10^-3; Ton=(Vav/V)*Toff-Toff; printf ( ” P e ri o d o f c o nd u ct i on = %. 6 f s e c ” , Ton )
67
Chapter 5 AC Regulators
Scilab code Exa 5.1 Calculate the different parameters of AC voltage reg-
ulator using integral cycle control 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// 5. 1
clc ; Vin=150;R=8; duty_cycle=36/(36+64); VL=Vin*duty_cycle^0.5; printf ( ”RMS o u t p u t v o l t a g e =% . 0 f V” , VL ) Po=VL^2/R; printf ( ” \ nPower out put =%.1 f W” , Po )
// s i n c e l o s s e s a re n e g l e c t e d
Pi=Po; printf ( ” \ nPower In put =%.1 f W” , P i ) Irms_load=VL/R; Irms_input=11.25; VA_input=Irms_input*Vin; pf_input=Po/VA_input; printf ( ” \ n I np u t Power f a c t o r =%. 1 f l a g g i n g ” , pf_input) 17 Ip_thy=2^0.5*Vin/R; 18 Iavg_thy=duty_cycle*Ip_thy/%pi; 19 printf ( ” \ n Av er ag e t h y r i s t o r C u rr e n t =%. 3 f A” ,
68
Iavg_thy) 20 Irms_thy=Ip_thy*duty_cycle^0.5/2; 21 printf ( ” \nRMS t h y r i s t o r C u r r en t =%. 3 f A” , I r ms _t h y )
Scilab code Exa 5.2 Calculate the different parameters of single phase half
wave AC regulator 1 2 3 4 5 6 7 8 9
// 5. 2
clc ; Vm=2^0.5*150; alph=60; R=8; Vin=150; Vavg_out=Vm*(cosd(alph)-1)/(2*%pi); printf ( ” A v er ag e o u t pu t v o l t a g e =%. 2 f V” , V a vg _ ou t ) disp ( ’ The a v e ra g e o ut pu t v o l t a g e i s n e g a t i v e o nl y a
p ar t o f p o s i t i v e h a l f c y c l e a pp ea rs a t t h e o u t p u t w he re a s t he w h o l e n e g a t i v e h a l f c y c l e a pp ea rs a t t h e o u tp u t ’ ) 10 VL=Vm*(1/(4*%pi)*(2*%pi-60*%pi/180+sind(120)/2)) ^0.5; 11 printf ( ” \nRMS o u t p u t v o l t a g e =% . 2 f V” , VL ) 12 Po=VL^2/R; 13 printf ( ” \ nPower out put =%.1 f W” , Po ) 14 Iin=VL/R; 15 VA_input=Iin*Vin; 16 pf_input=Po/VA_input; 17 printf ( ” \ n I np u t Power f a c t o r =%. 2 f l a g g i n g ” , pf_input) 18 Iavg_out=Vavg_out/R; 19 Iavg_input=Iavg_out; 20 printf ( ” \ n A ve r ag e i n p u t c u r r e n t =%. 2 f A” , Iavg_input) 21 disp ( ’ The a v e ra g e i n p ut c u r r e n t i s n e g at i v e b ec au se
i np u t c u r r e n t d u ri ng p o s i t i v e h a l f c y c l e i s l e s s 69
t h a n d ur in g n e g a ti v e h a l f c y c l e ’ )
Scilab code Exa 5.3 Calculate the different parameters of single phase full
wave AC regulator // 5. 3
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
clc ; Vin=150; Vm=2^0.5*Vin; alph=60; R=8; Vavg_out=Vm*(cosd(alph)+1)/(%pi); printf ( ” A ver ag e o ut pu t v o l t a g e o v er h a l f c y c l e =%. 2 f V” , V a vg _o u t ) VL=Vm*(1/(2*%pi)*(%pi-60*%pi/180+sind(120)/2))^0.5; printf ( ” \nRMS o u t p u t v o l t a g e =% . 2 f V” , VL ) Po=VL^2/R; printf ( ” \ nPower out put =%.1 f W” , Po ) Iin=VL/R; VA_input=Iin*Vin; pf_input=Po/VA_input; printf ( ” \ n I np u t Power f a c t o r =%. 1 f l a g g i n g ” , pf_input)
17 18 Iavg_thy=Vm*(1+cosd(alph))/(2*%pi*R); 19 printf ( ” \ n Av er ag e t h y r i s t o r C u rr e n t =%. 2 f A” , Iavg_thy) 20 Irms_thy=Vm/(2*R)*(1/(%pi)*(%pi-%pi/3+sind(120)/2)) ^0.5; 21 printf ( ” \nRMS t h y r i s t o r C u r r en t =%. 3 f A” , I r ms _t h y )
Scilab code Exa 5.4 Calculate the different parameters of single phase full
wave AC regulator 70
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 5. 4
clc ; Vin=120; Vm=2^0.5*Vin; alph=90; R=10; VL=Vm*(1/(2*%pi)*(%pi-90*%pi/180+sind(180)/2))^0.5; printf ( ” \nRMS o u t p u t v o l t a g e =% . 2 f V” , VL ) Po=VL^2/R; IL=VL/R; VA_input=IL*Vin; pf_input=Po/VA_input; printf ( ” \ n I np u t Power f a c t o r =%. 3 f l a g g i n g ” , pf_input)
15 16 Iavg_thy=Vm*(1+cosd(alph))/(2*%pi*R); 17 printf ( ” \ n Av er ag e t h y r i s t o r C u rr e n t =%. 2 f A” , Iavg_thy) 18 Irms_thy=IL/2^0.5; 19 printf ( ” \nRMS t h y r i s t o r C u r r en t =%. 3 f A” , I r ms _t h y ) 20 Irms_load=VL/R; 21 printf ( ” \nRMS Load Cur ren t =%.3 f A” , I r ms _ lo a d )
Scilab code Exa 5.5 Find RMS output voltage and average power
1 2 3 4 5 6 7 8 9
// 5. 5
clc ; Vin=110; Vm=2^0.5*Vin; alph=60; R=400; VL=Vm*(1/(2*%pi)*(%pi-60*%pi/180+sind(120)/2))^0.5; printf ( ” \nRMS o u t p u t v o l t a g e =% . 2 f V” , VL ) Po=VL^2/R;
71
10 printf ( ” \ nPower out put =%.2 f W” , Po )
Scilab code Exa 5.6 Find the firing angle
1 2 3 4 5 6 7 8 9 10 11 12
// 5. 6 clc ; disp ( ’ When t h e p ower d e l i v e r e d
i s 80% we h av e ’ ) / / 0 . 8 = 1 / ( % p i ) ∗ (%pi−a l p h +s i n ( 2∗ alp h ) /2 ) / / on s o l v i n g alph=60.5; printf ( ” F i r i n g a n g l e =%. 1 f d e g r e e ” ,alph) disp ( ’ When t h e p ower d e l i v e r e d i s 30% we h av e ’ )
/ / 0 . 3 = 1 / ( % p i ) ∗ (%pi−a l p h +s i n ( 2∗ alp h ) /2 ) / / on s o l v i n g alph=108.6; printf ( ” F i r i n g
a n g l e =%. 1 f d e g r e e ” ,alph)
Scilab code Exa 5.7 Find the conduction angle and RMS output voltage
1 2 3 4 5 6 7 8 9
// 5. 7
10 11 12
clc ; f=50; Vin=150; w=2*%pi*f; L=22*10^-3;R=4; th=atand(w*L/R); Beta=180+th; printf ( ” C o nd uc ti on a n g l e o f t h y r i s t o r =%. 0 f d e g r e e ” , Beta) Vm=2^0.5*Vin; VL=Vm*(1/(2*%pi)*(%pi++sind(120)/2-sind(2*240)/2)) ^0.5; printf ( ” \nRMS out put Vo lt ag e=%.0 f V” , VL )
72
Scilab code Exa 5.8 Calculate the different parameters of single phase full
wave AC regulator 1 2 3 4 5 6 7 8 9
// 5. 8
10 11 12 13 14 15 16 17
clc ; f=50; Vin=230; w=2*%pi*f; L=20*10^-3;R=5; th=atand(R/(w*L)); printf ( ” F i r i n g a n g l e =%. 2 f d e g r e e ” ,th) disp ( ’ T h e re f o re , Range o f f i r i n g a n g l e i s 3 8 . 5 1 d e gr e e t o 18 0 d e g re e ’ ) Beta=180; printf ( ” C o nd uc ti on a n g l e o f t h y r i s t o r =%. 0 f d e g r e e ” , Beta) IL=Vin/((R^2+w^2*L^2))^0.5; printf ( ” \nRMS l o a d c u r r e n t =% . 2 f A” , IL ) Po=IL^2*R; printf ( ” \ nPower Output =%.2 f W” , Po ) pf_input=Po/(Vin*IL); printf ( ” \ n I np u t Power f a c t o r =%. 3 f l a g g i n g ” , pf_input)
Scilab code Exa 5.10 Find the current and voltage rating
1 2 3 4 5
// 5. 10 clc ; V=415; P=20*10^3; disp ( ’ F or T r i a c s ’ )
73
6 I_line=P/(3^0.5*V); 7 Irms=I_line*1.5; 8 printf ( ”RMS c u r r e n t r a t i n g o f e ac h t r i a c =%. 2 f A” , Irms) 9 Vrms=1.5*V; 10 printf ( ” \nRMS V o l t a g e r a t i n g o f e a ch t r i a c =%. 2 f V” , Vrms) 11 disp ( ’ F or r e v e r s e c on ne ct ed t h y r i s t o r s ’ ) 12 Irms_thy=1.5*I_line/2^0.5; 13 printf ( ”RMS c u r r e n t r a t i n g o f e ac h t h y r i s t o r =%. 2 f A” , I r ms _ th y ) 14 Vrms_thy=1.5*V; 15 printf ( ” \nRMS v o l t a g e r a t i n g o f e ac h t h y r i s t o r =%. 2 f V” , V r ms _ th y )
Scilab code Exa 5.11 Calculate the different parameters of 3 phase star
connected resistance load with firing angle 30 degree 1 2 3 4 5
// 5. 11
6 7 8 9 10 11 12 13
clc ; R=15; Vrms_input_phase=415/3^0.5; VL=3^0.5*2^0.5*Vrms_input_phase*(1/(%pi)*(%pi/6-30* %pi/(180*4)+sind(60)/8))^0.5; printf ( ” \nRMS v a l u e o f o u t pu t v o l t a g e p e r p h a se=%. 2 f V” , V L ) Po=3*VL^2/R; printf ( ” \ nPower out put =%.1 f W” , Po ) I_line=VL/R; printf ( ” \ n L i n e C u r r e n t =% . 2 f A” , I _ li ne ) VA_input=3*Vrms_input_phase*I_line; pf_input=Po/VA_input; printf ( ” \ n I n p u t P ower F a c t o r =%. 3 f l a g g i n g ” , pf_input)
74
Scilab code Exa 5.12 Calculate the different parameters of 3 phase star
connected resistance load with firing angle 60 degree 1 2 3 4 5
// 5. 12
6 7 8 9 10 11 12 13
clc ; R=15; Vrms_input_phase=415/3^0.5; VL=3^0.5*2^0.5*Vrms_input_phase*(1/(%pi)*(%pi/6-60* %pi/(180*4)+sind(120)/8))^0.5; printf ( ” \nRMS v a l u e o f o u t pu t v o l t a g e p e r p h a se=%. 2 f V” , V L ) Po=3*VL^2/R; printf ( ” \ nPower out put =%.1 f W” , Po ) I_line=VL/R; printf ( ” \ n L i n e C u r r e n t =% . 2 f A” , I _ li ne ) VA_input=3*Vrms_input_phase*I_line; pf_input=Po/VA_input; printf ( ” \ n I n p u t P ower F a c t o r =%. 3 f l a g g i n g ” , pf_input)
75
Chapter 6 Cycloconverters
Scilab code Exa 6.1 Find the input voltage SCR rating and Input Power
Factor 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 6. 1
clc ; Vo_max=250; Vm=Vo_max*%pi*2^0.5/(3* sin ( % p i / 3 ) ) ; Vrms=Vm/2^0.5; printf ( ”RMS v a l u e o f i n p u t v o l t a g e =%. 1 f V” , V rm s ) I=50; Irms=I*2^0.5/3^0.5; PIV=3^0.5*Vm; Irms_input=(I^2/3)^0.5; Po=Vo_max*I*0.8; Pi_per_phase=1/3*Po; pf_input=Pi_per_phase/(Irms_input*Vrms) printf ( ” \ n I np u t p ow er f a c t o r =%. 3 f l a g g i n g ” , pf_input)
Scilab code Exa 6.2 Find RMS value of output voltage for firing angle 30
and 45 degree 76
1 2 3 4 5 6
// 6. 2
7 8 9
clc ; Vo_max=250; alph=30; Vo=Vo_max*cosd(alph); t p ut ut v o l t a g e f o r f i r i n g a n g l e printf ( ”RMS v a l u e o f o u tp 3 0 d e g r e e =% . 1 f V” , V o ) alph=45; Vo=Vo_max*cosd(alph); t p ut ut v o l t a g e f o r f i r i n g printf ( ” \nRMS v a l u e o f o u tp a n g l e 4 5 d e g r e e =% . 2 f V” , V o )
Scilab code Exa 6.3 Find RMS value of output voltage for firing angle 0
and 30 degree 1 2 3 4 5 6
// 6. 3
7 8 9
clc ; Vrms=230; alph=0; Vo=6*2^0.5*Vrms/(%pi*2^0.5)* s i n (%pi/6)*cosd(alph); t p ut ut v o l t a g e f o r f i r i n g a n g l e printf ( ”RMS v a l u e o f o u tp 0 d e g r e e =% . 2 f V” , V o ) alph=30; Vo=6*2^0.5*Vrms/(%pi*2^0.5)* s i n (%pi/6)*cosd(alph); t p ut ut v o l t a g e f o r f i r i n g printf ( ” \nRMS v a l u e o f o u tp a n g l e 3 0 d e g r e e =% . 1 f V” , V o )
77
Chapter 7 Applications of Thyristors
Scilab code Exa 7.1 Find the value of Voltage which will turn On the
crowbar 1 2 3 4 5 6
// 7. 1
clc ; Vzb=14.8; Vt=0.85; V=Vzb+Vt; Th e v a l ue u e o f V o lt l t ag a g e w h i ch c h w i l l t ur u r n On On t h e printf ( ” Th cro wba r=%.2 f V” , V )
Scilab code Exa 7.2 Find the value of input voltage
1 2 3 4 5 6 7
// 7. 2
clc ; Rth=50*15/(50+15); I=20*10^-3; Vzb=14.8; Vt=0.85; l t ag a g e d ro r o p a c r o s s t he h e t he h e ve v e ni ni n ’ s V=Rth*I; / / V o lt
resistance 78
8 Vi=V+Vzb+Vt; 9 printf ( ” Th Th e v a l u e o f i n p u t v o l t a g e V i= i=% . 3 f V” ,Vi)
Scilab code Exa 7.3 Find the value of R and C
1 2 3 4 5 6 7 8 9 10 11
// 7. 3
clc ; V=200; I=4*10^-3; R=V/I; =% . 0 f ohm ” , R ) printf ( ” R e s i s t a n c e =% Vc=0; RL=V/10; tq=15*10^-6; C = t q /( / ( R L * l o g (2))*10^6; =% . 3 f uF ” , C ) printf ( ” \ n C a p a c i t a n c e =%
Scilab code Exa 7.4 Find Duty cycle and Ratio for different output pow-
ers 1 2 3 4 5 6 7 8 9 10 11 12 13
// 7. 4
clc ; V=230; R=60; Po_max=V^2/R; When p ow o w er er o u t p u t i s 4 0 0 ’ ) disp ( ’ Wh Po=400; Duty_cycle=Po/Po_max; ”Duty c y c l e=%.4 e=%.4 f ” , D u t y_ printf ( ”Duty y _ c y c le le ) Ton=0.4537; T=1; Toff=1-Ton; Ratio=Ton/Toff;
79
14 printf ( ” \ n Ra ti o o f Ton and T o f f when p ower o u tp ut i s 400=%. 4 f ” , R at io ) 15 disp ( ’ When p ow er o u t p u t i s 7 0 0 ’ ) 16 Po=700; 17 Duty_cycle=Po/Po_max; 18 printf ( ”Duty c y c l e=%.4 f ” , D u t y_ c y c le ) 19 Ton=0.794; 20 T=1; 21 Toff=1-Ton; 22 Ratio=Ton/Toff; 23 printf ( ” \ n Ra ti o o f Ton and T o f f when p ower o u tp ut i s 700=%. 4 f ” , R at io )
Scilab code Exa 7.5 Find RMS value of output voltage
1 2 3 4 5 6 7 8 9
// 7 .5
clc ; V=230; Ton=12; Toff=19; Duty_cycle=Ton/(Ton+Toff); printf ( ”Duty c y c l e=%.4 f ” , D u t y_ c y c le ) Vrms_output=V*Duty_cycle^0.5; printf ( ” \nRMS o u t p u t v o l t a g e =% . 1 f V” , V r m s _o u t p ut )
Scilab code Exa 7.6 Find the power supplied to heater for different firing
angles 1 2 3 4 5
// 7. 6 clc ; Vin=230; Vm=2^0.5*Vin; alph=90;
80
6 7 8 9
10 11 12 13 14
R=50; VL=Vm*(1/(2*%pi)*(%pi-90*%pi/180+sind(180)/2))^0.5; Po=VL^2/R; printf ( ” Power s u p p l i e d when f i r i n g a n g l e i s 90 de gr ee =%.2 f W” , Po ) alph=120; R=50; VL=Vm*(1/(2* %pi)*(%pi -120*%pi/180+sind (240)/2))^0.5; Po=VL^2/R; printf ( ” \ nPower s u p p l i e d when f i r i n g a n g l e i s 1 20 de gr ee =%.2 f W” , Po )
Scilab code Exa 7.7 Find the firing angles when different powers are sup-
plied to heater 1 2 3 4 5 6 7 8
// 7. 7
clc ; V=230; R=10; Pmax=V^2/R; P=2645; VL=(P*R)^2;
/ /VL=Vm∗ ( 1 / ( 2 ∗ %pi) ∗ (%pi−a l p h ∗ %pi/180+sind (2∗ al ph ) /2 ) ) ˆ0 .5 ; 9 / / on s o l v i n g 10 alph=90; 11 printf ( ” F i r i n g a n g l e when 2 64 5 W Power i s s u p p l i e d = %. 0 f d e g r e e ” , a lp h ) 12 P=1587; 13 VL=(P*R)^2; 14 / /VL=Vm∗ ( 1 / ( 2 ∗ %pi) ∗ (%pi−a l p h ∗ %pi/180+sind (2∗ al ph ) /2 )
) ˆ0. 5; 15 / / on s o l v i n g 16 alph=108.6; 17 printf ( ” \ n F i r i n g a n g l e when 2 64 5 W Power i s
81
supplied
=%. 1 f d e g r e e ” , a lp h )
Scilab code Exa 7.8 Find the current rating and peak inverse voltage
1 2 3 4 5 6 7 8 9 10
// 7. 8
11
clc ; disp ( ’ F or t r i a c ’ ) P=20000; V=400; I=P/(V*3^0.5); printf ( ” C u rr en t r a t i n g o f t r a i c =%. 2 f A” ,I) PIV=2^0.5*V; printf ( ” \nPIV o f t r a i c =%. 2 f V” ,PIV) disp ( ’ When t wo t h y r i s t o r s a r e c o nn e ct ed i n antiparallel ’) I=I/2^0.5; // s i n c e e a ch t h y r i s t o r w i l l c o nd uc t f o r
h a l f c yc le 12 printf ( ” C u r r en t r a t i n g =%. 2 f A” ,I) 13 PIV=2^0.5*V; 14 printf ( ” \nPIV =%. 2 f V” ,PIV)
Scilab code Exa 7.9 Find firing angle and power factor of converter in the
armature circuit 1 2 3 4 5 6 7 8 9
// 7. 9
clc ; Vm=230*2^0.5; Vf=2*Vm/%pi; Rf=200; If=Vf/Rf; T=50; Kt=0.8; Ia=T/(Kt*If);
82
10 11 12 13 14 15
16 17 18 19 20
w=2*%pi*900/60; Vb=Kt*w*If; Ra=0.3; Va=Vb+Ia*Ra; alph_a=acosd(Va*%pi/Vm-1) printf ( ” F i r i n g a n gl e o f c o n v e r t e r i n t he a rm at u re c i r c u i t =%. 3 f d e g r e e ” ,alph_a) Po_a=Va*Ia; Iin=Ia*((%pi-alph_a*%pi/180)/%pi)^0.5; VA_input=Iin*230; pf=Po_a/VA_input; printf ( ” \ npower f a c t o r o f c o n v e r t e r i n t he a rm a tu re c i r c u i t =%. 3 f l a g g i n g ” ,pf)
Scilab code Exa 7.10 Find the torque developed and motor speed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// 7. 10
clc ; Vm=230*2^0.5; Vf=2*Vm/%pi; alph_a=%pi/4; Va=(2*Vm/%pi)* cos (alph_a); Rf=200; If=Vf/Rf; Kt=1.1; Ia=50; T=Ia*(Kt*If); printf ( ” Torque of motor=%.3 f Nm” , T) Ra=0.25; Vb=Va-Ia*Ra-2; w=Vb/(Kt*If); N=w*60/(2*%pi); printf ( ” \ n S p e e d o f m o t o r=% . 1 f rpm ” , N )
83
Scilab code Exa 7.11 Find armature current and Firing angle of the semi
converter // 7. 11
1 2 3 4 5 6 7 8
9 10 11 12 13 14
clc ; Vm=675*2^0.5; Ia1=30; N1=350; N2=500; Ia2=Ia1*N2/N1; printf ( ” A rma tu re c u r r e n t o f t h e s em i c o n v e r t e r =%. 2 f A” ,Ia2) Va1=(1+ cos (90.5*%pi/180))*Vm/%pi; Eb1=Va1-Ia1*(0.22+0.22); Eb2=Eb1*Ia2*N2/(Ia1*N1); Va2=Eb2+Ia2*(0.22+0.22); alph_a=acosd(Va2*%pi/Vm-1); printf ( ” \ n F i r in g a n g le o f t he s em i c o n v e r t e r=%. 2 f d e g r e e ” ,alph_a)
Scilab code Exa 7.12 Find the firing angle of converter in the armature
circuit and power fed back to the source 1 2 3 4 5 6 7 8
// 7. 12
clc ; Vm=230*2^0.5; Eg=-131.9 Ia=50; Ra=0.25; Va=Eg+Ia*Ra+2; alph_a=acosd(Va*%pi/(2*Vm))
84
9 printf ( ” F i r i n g a n gl e o f c o n v e r t e r i n t he a rm at u re c i r c u i t =%. 2 f d e g r e e ” ,alph_a) 10 Po = abs (Va*Ia); 11 printf ( ” \ n p ow er b a c k t o s o u r c e =% . 3 f W” ,Po)
Scilab code Exa 7.13 Find the firing angle of converter in the armature
circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 7. 13
clc ; Vm=400*2^0.5/(3^0.5); Vf=3*3^0.5*Vm/%pi; Rf=250; If=Vf/Rf; Kt=1.33; Ia=50; w=2*%pi*1200/60; Vb=Kt*w*If; Ra=0.3; Va=Vb+Ia*Ra; alph_a=acosd(Va/Vf); printf ( ” F i r i n g a n gl e o f c o n v e r t e r i n t he a rm at u re c i r c u i t =%. 3 f d e g r e e ” ,alph_a)
Scilab code Exa 7.14 Find the input power speed and torque of separately
excited dc motor 1 2 3 4 5 6
// 7. 14
clc ; V=500; Ia=200; Ra=0.1; Pi=V*Ia*0.5;
85
7 8 9 10 11 12 13 14 15 16
printf ( ” Inp ut power=%.0 f W” , Pi ) Va=0.5*500; Eb=Va-Ia*Ra; If=2; Kt=1.4; w=Eb/(Kt*If) N=w*60/(2*%pi) printf ( ” \ nSp eed=%. 2 f rpm” , N) T=Kt*If*Ia; printf ( ” \ nTor que=%. 0 f N−m” , T )
Scilab code Exa 7.15 Find the average voltage power dissipated and mo-
tor speed of the chopper 1 2 3 4 5 6 7 8 9 10
// 7. 15
11 12 13 14 15 16
clc ; Rb=7.5; Ra=0.1; Kt=1.4; Ia=120; If=1.6; Duty_cycle=0.35; Vavg=Rb*Ia*(1-Duty_cycle); printf ( ” A v er ag e v o l t a g e a c r o s s c h o pp e r=%. 0 f V” , V av g ) Pb=Rb*Ia^2*(1-Duty_cycle); printf ( ” \ nPower d i s s i p a t e d i n b r ea k i ng r e s i s t a n c e =% . 0 f W” , P b ) Eb=Vavg+Ia*Ra; w=Eb/(Kt*If); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N)
86
Scilab code Exa 7.16 Find the speed for different values of torque
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 34 35 36
// 7. 16
clc ; Vm=220*2^0.5; alph=90; Va=3*3^0.5*Vm*(1+cosd(alph))/(2*%pi); Kt=2; Ra=0.72; disp ( ’ F or a rm at ur e c u r r e nt o f 5A ’ ) Ia=5; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra; w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N) disp ( ’ F or a rm at ur e c u r r e nt o f 10A ’ ) Ia=10; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra; w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N) disp ( ’ F or a rm at ur e c u r r e nt o f 20A ’ ) Ia=20; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra; w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N) disp ( ’ F or a rm at ur e c u r r e nt o f 30A ’ ) Ia=30; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra;
87
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N) disp ( ’ F or a rm at ur e c u r r e nt o f 50A ’ ) Ia=50; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra; w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N) disp ( ’ F or a rm at ur e c u r r e nt o f 60A ’ ) Ia=60; T=Ia*Kt; printf ( ” \ nTor que=%. 2 f N−m” , T ) Eb=Va-Ia*Ra; w=Eb/(Kt); N=w*60/(2*%pi); printf ( ” \ nSp eed=%. 2 f rpm” , N)
Scilab code Exa 7.17 Find the speed at no load and firing angle
1 2 3 4 5 6 7 8 9 10 11 12 13
// 7. 17
clc ; Vm=400*2^0.5; alph=30; Vavg=3*3^0.5*Vm/(2*%pi*3^0.5)*(1+cosd(alph)); I=5; R=0.1; Eb=Vavg-I*R; N=Eb/0.3; printf ( ” S p e ed a t n o l o a d =%. 0 f rpm ” ,N) N=1600; Eb=N*0.3; I=50;
88
14 V=Eb+I*R; 15 alph=acosd(3^0.5*2* %pi*V/(Vm*3*3^0.5) -1) 16 printf ( ” \ n F i r i n g a n g l e =%. 2 f d e g r e e ” ,alph)
Scilab code Exa 7.18 Find the motor speed
1 2 3 4 5 6 7 8 9
// 7. 18
clc ; Vdc=2*2^0.5*230/%pi; TL=25; Kt=0.25; Ia=(TL/Kt)^0.5; w=(Vdc -1.5*Ia)/(Kt*Ia); N=w*60/(2*%pi); printf ( ”Motor sp eed=%.2 f rpm” ,N)
Scilab code Exa 7.19 Find the load torque stator applied voltage and ro-
tor current 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 7. 19 ;
clc ; p =4 f=50; ns=2*f*60/p; TL_1300=40*(1300/1440)^2; printf ( ”Load to rq ue=%.2 f Nm” ,TL_1300) n=1300; s=(ns-n)/ns; r2s=0.08*2^2; / / i n b oo k r 2 ’= r 2 s x2s=0.12*2^2; I2s=(TL_1300*2*%pi*s*25/(3*r2s))^0.5; I2=2*I2s; printf ( ” \ n R o to r c u r r e n t =% . 2 f A” ,I2)
89
15 16 17 18 19
r1=0.64; x1=1.1; V1=I2s*((r1+r2s/s)^2+(x1+x2s)^2)^0.5; Vstator=3^0.5*V1; printf ( ” \ n S t a t o r a p p l i e d v o l t a g e =%. 1 f V” ,Vstator)
Scilab code Exa 7.20 Find the load torque stator applied voltage and ro-
tor current // 7. 20
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20 21
22 23 24
clc ; r2s=0.32; r1=0.64; x2s=0.48; x1=1.1; s=r2s/(r1^2+(x1+x2s)^2)^0.5; printf ( ” \ n S l i p =% . 4 f ” ,s) V1=400/3^0.5; Tmax=1.5*V1^2/(2*%pi*25)*(1/(r1+(r1^2+(x1+x2s)^2) ^0.5)) printf ( ” \nMaximum To rq ue=%. 2 f Nm” ,Tmax) n=25*(1-s); N=n*60; printf ( ” \ nSp eed=%. 2 f rpm” ,N ) disp ( ’ a t 2 5 Hz ’ ) x1=0.55; x2s=0.24; s=r2s/(r1^2+(x1+x2s)^2)^0.5; printf ( ” \ n S l i p =% . 4 f ” ,s) V1=0.5*400/3^0.5; Tmax=1.5*V1^2/(2*%pi*12.5)*(1/(r1+(r1^2+(x1+x2s)^2) ^0.5)) printf ( ” \nMaximum To rq ue=%. 2 f Nm” ,Tmax) n=12.5*(1-s); N=n*60;
90
25 printf ( ” \ nSp eed=%. 3 f rpm” ,N )
Scilab code Exa 7.21 Find the starting torques at different frequencies
1 2 3 4 5 6 7 8 9
// 7. 21
clc ; r2s=0.32; r1=0.64; x2s=0.48; x1=1.1;
V1=400/3^0.5; Tstarting=3*V1^2*r2s/(2*%pi*25)*(1/((r1+r2s)^2+(x1+ x2s)^2)) 10 printf ( ” \ n S t a r t i n g T o r qu e=% . 2 f Nm” ,Tstarting) 11 12 disp ( ’ a t 2 5 Hz ’ ) 13 x1=0.55; 14 x2s=0.24; 15 V1=0.5*400/3^0.5; 16 Tstarting=3*V1^2*r2s/(2*%pi*12.5)*(1/((r1+r2s)^2+(x1 +x2s)^2)) 17 printf ( ” \ n S t a r t i n g T o r qu e=% . 2 f Nm” ,Tstarting)
91
Chapter 8 Integrated circuits and operational amplifiers
Scilab code Exa 8.1 Find dc currents and voltages
1 2 3 4 5 6 7 8 9 10 11
// 8. 1
clc ; Vcc=12; Re=3.8*10^3; Rc=4.1*10^3; Ie=(Vcc -0.7)/ Re*10^3; printf ( ” I e=%3f mA” ,Ie) Ic=0.5*Ie; printf ( ” \ n I c=%3f mA” ,Ic) Vo=Vcc-Ic*Rc*10^-3; printf ( ” \nVo=%1f V” ,Vo)
Scilab code Exa 8.2 Calculate the different parameters of differential am-
plifier 1 // 8. 2
92
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
clc ; Vcc=12; Re=1*10^6; Rc=1*10^6; Ie=(Vcc -0.7)/ Re*10^3; re=25*2/Ie; printf ( ” re=%.0 f ohm” ,re) Vgd=Rc/(2*re); printf ( ” \ n V o l t a g e g a i n f o r t h e d i f f e r e n t i a l i n p u t =% . 1 f ” ,Vgd) Vi=2.1*10^-3; Vo_Ac=Vgd*Vi; printf ( ” \nAC o u t p u t v o l t a g e =% . 4 f V” ,Vo_Ac) Beta=75; Zi=2*Beta*re; printf ( ” \ nIn put impeda nce=%.0 f ohm” ,Zi) Rc=1*10^6; RE=10^6; CMG=Rc/(re+2*RE); printf ( ” \nCommon mode g a i n=%. 3 f ” ,CMG) CMRR=Vgd/CMG; printf ( ” \nCommon mode r e j e c t i o n r a t i o =%. 2 f ” ,CMRR)
Scilab code Exa 8.3 Find the closed loop gain output and error voltage
// 8. 3
1 2 3 4 5
6 7 8 9
clc ; open_loop_gain=100000; FF=0.01; Closed_loop_gain=open_loop_gain/(1+open_loop_gain*FF ); printf ( ” C l o s e d l o o p g a i n =%. 1 f ” ,Closed_loop_gain) Vi=2*10^-3; output=Vi*Closed_loop_gain; printf ( ” \ nOut put=%. 4 f V” ,output)
93
10 Error_voltage=output/open_loop_gain*10^6; 11 printf ( ” \ n E r r o r v o l t a g e =% . 3 f uV” ,Error_voltage)
Scilab code Exa 8.4 Find the closed loop gain output and error voltage
// 8. 4
1 2 3 4 5
6 7 8 9 10 11
clc ; open_loop_gain=15000; FF=0.01; Closed_loop_gain=open_loop_gain/(1+open_loop_gain*FF ); printf ( ” C l o s e d l o o p g a i n =%. 3 f ” ,Closed_loop_gain) Vi=2*10^-3; output=Vi*Closed_loop_gain; printf ( ” \ nOut put=%. 4 f V” ,output) Error_voltage=output/open_loop_gain*10^6; printf ( ” \ n E r r o r v o l t a g e =% . 3 f uV” ,Error_voltage)
Scilab code Exa 8.5 Find the input and output impedances
1 2 3 4 5 6 7
// 8. 5
8 9 10
clc ; Av=100000; beta=0.01; Zi=2*10^6; Closed_loop_input_imped=Zi*(1+Av*beta)*10^-6; printf ( ” C l o s e d l o o p i n p u t i m pe d an c e=%. 0 f Mega−ohm” , Closed_loop_input_imped) Zo=75; Closed_loop_output_imped=Zo/(1+Av*beta); printf ( ” \ n C l o s e d l o o p o u t p u t i m p e d a nc e=% . 4 f ohm ” , Closed_loop_output_imped)
94
Scilab code Exa 8.6 Find closed loop gain and desensitivity
1 2 3 4 5 6 7 8
// 8. 6
clc ; Av=100000; beta=0.001; Closed_loop_gain=Av/(1+Av*beta); printf ( ” \ n C l os e d l o o p g a i n=%. 1 f ” ,Closed_loop_gain) Desensitivity=(1+Av*beta); printf ( ” \ n D e s e n s i t i v i t y =%. 0 f ” ,Desensitivity)
Scilab code Exa 8.7 Find the closed loop gain and upper cut off frequency
// 8. 7
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17
clc ; f_unity=10^6; Av=100000; open_loop_upper_cutoff_f=f_unity/Av; printf ( ” o pen l o o p u pp er c u t o f f f r e q u e n cy=%. 0 f Hz” , open_loop_upper_cutoff_f) disp ( ’ w hen b e t a = 0 . 0 0 1 ’ ) beta=0.001; Closed_loop_gain=Av/(1+Av*beta); printf ( ” \ n C l os e d l o o p g a i n=%. 1 f ” ,Closed_loop_gain) upper_cutoff_frequency=f_unity/Closed_loop_gain; printf ( ” \ n Up pe r c u t o f f f r e q u e n c y =%. 0 f Hz ” , upper_cutoff_frequency) disp ( ’ w hen b e t a = 0 . 0 1 ’ ) beta=0.01; Closed_loop_gain=Av/(1+Av*beta); printf ( ” \ n C l os e d l o o p g a i n=%. 1 f ” ,Closed_loop_gain) upper_cutoff_frequency=f_unity/Closed_loop_gain;
95
18 printf ( ” \ n Up pe r c u t o f f f r e q u e n c y =%. 0 f Hz ” , upper_cutoff_frequency) 19 disp ( ’ w hen b e t a = 0 . 1 ’ ) 20 beta=0.1; 21 Closed_loop_gain=Av/(1+Av*beta); 22 printf ( ” \ n C l os e d l o o p g a i n=%. 3 f ” ,Closed_loop_gain) 23 upper_cutoff_frequency=f_unity/Closed_loop_gain; 24 printf ( ” \ n Up pe r c u t o f f f r e q u e n c y =%. 0 f Hz ” , upper_cutoff_frequency)
Scilab code Exa 8.8 Find the slew rate
1 2 3 4 5 6
// 8. 8
clc ; Imax=10*10^-6; C=4000*10^-12; Slew_rate=Imax/C; printf ( ” S l e w r a t e =%. 0 f V/ s ” , S l ew _ ra t e )
Scilab code Exa 8.9 Find the slew rate distortion of the op amp
1 2 3 4 5 6
// 8. 9
7
clc ; f=10*10^3; Vp=6 Initial_slope_of_sine_wa=2*%pi*f*Vp*10^-6; printf ( ” I n i t i a l s l o p e o f s i n e wa ve= %. 5 f V/ u s ” , Initial_slope_of_sine_wa) disp ( ’ S i n ce s le w r a t e o f t he a m p l i f i e r i s 0 . 4V/ us , t h e r e i s no s le w r a t e d i s t o r t i o n ’ )
96
Scilab code Exa 8.10 Find the slew rate distortion of the op amp and
amplitude of the input signal 1 2 3 4 5 6
// 8. 10
7 8 9 10
clc ; f=10*10^3; Vp=10; Initial_slope_of_sine_wa=2*%pi*f*Vp*10^-6; printf ( ” I n i t i a l s l o p e o f s i n e wa ve= %. 3 f V/ u s ” , Initial_slope_of_sine_wa) disp ( ’ S i n ce s le w r a t e o f t he a m p l i f i e r i s 0 . 5V/ us , s o s le w r a t e d i s t o r t i o n w i l l o cc u r ’ ) Sr=0.5*10^6; Vp=Sr/(2*%pi*f); printf ( ” A mp li tu de o f t h e i n p u t s i g n a l =%. 2 f V” ,Vp)
Scilab code Exa 8.11 Find the different parameters of inverting amplifier
1 2 3 4 5 6 7 8 9 10 11 12
// 8. 11
13 14 15
clc ; Rf=100*10^3; R1=1000; Gain=-Rf/R1; printf ( ” C l o s e d l o o p g a i n =%. 0 f ” , G ai n ) Av=100000; Zo=75; f_unity=10^6; beta=R1/(R1+Rf); Z_closed=Zo/(1+Av*beta); printf ( ” \ n C l o s e d l o o p o u t p u t i m p e d a nc e=% . 6 f ohm ” , Z_closed) closed_loop_upper_cut_f=f_unity*beta; l o o p u pp er c u t o f f f r e q u e n cy=%. 0 f printf ( ” \ n Cl o se d Hz ” , c l o s e d_ l o o p _u p p e r _c u t _ f ) closed_loop_input_impe=1000;
97
16 printf ( ” \ n C l o s e d l o o p i n p u t i m p e d an c e=% . 0 f ohm ” , closed_loop_input_impe)
Scilab code Exa 8.12 Find the different parameters of non inverting am-
plifier 1 2 3 4 5 6 7 8 9 10 11 12 13
// 8. 12
clc ; R2=100*10^3; R1=100; Zin=2*10^6; Zo=75; Gain=(R1+R2)/R1; printf ( ” C l o s e d l o o p v o l t a g e Av=100000;
g a i n=%. 0 f ” , G ai n )
beta=R1/(R1+R2); Z_closed=Zin*(1+Av*beta)*10^-6; printf ( ” \ n C l o s e d l o o p i n p u t i m pe d an c e=%. 1 f mega−ohm” , Z _ cl o se d )
14 15 closed_loop_output_impe=Zo/(1+Av*beta); 16 printf ( ” \ n C l o s e d l o o p o u t p u t i m p e d a nc e=% . 3 f ohm ” , closed_loop_output_impe)
Scilab code Exa 8.13 Find the different parameters of ac amplifier
1 2 3 4 5 6
// 8. 13
clc ; R1=1000; R2=100000; Avf=(R1+R2)/R1; printf ( ” C l o s e d l o o p g a i n =%. 0 f ” , Avf )
98
7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22
beta=R1/(R1+R2); f_unity=1000000; f2=f_unity*beta; printf ( ” \ nUp per c u t o f f f r e q u e n c y =%. 0 f Hz ” , f2 ) disp ( ’ C r i t i c a l f r e q u e n c i e s ’ ) C1=10^-6; R3=150*10^3; fc=1/(2*%pi*R3*C1); printf ( ” \ n C r i t i c a l f r e q u e n c y when R i s 1 50 Kohm=%. 3 f Hz” , fc ) R3=15*10^3; fc=1/(2*%pi*R3*C1); printf ( ” \ n C r i t i c a l f r e q u e n c y when R i s 1 5 Kohm=%. 2 f Hz ” , f c ) R3=1*10^3; fc=1/(2*%pi*R3*C1); printf ( ” \ n C r i t i c a l f r e q u e n c y when R i s 1 Kohm=%. 2 f Hz ” , f c ) disp ( ’ The l ow er c u t t o f f f r e qu e n c y i s t h e h i g h e s t o f
t h e a bo ve t h r e e c r i t i c a l f r e q u e n c i e s i . e . 1 5 9 . 1 5 Hz ’ )
Scilab code Exa 8.14 Find the output voltage
1 2 3 4 5 6 7 8 9 10 11
// 8. 14
clc ; Rf=50*10^3; R1=10*10^3; R2=R1; R3=R1; V1=0.5; V2=1.5; V3=0.2; Vo=-Rf*((V1/R1)+(V3/R3)+(V2/R2)); printf ( ” O u tp ut v o l t a g e =% . 0 f V” ,Vo)
99
Scilab code Exa 8.17 Find the output voltage
1 2 3 4 5 6 7 8
// 8. 17
clc ; R1=50*10^3; R=10*10^3; Vs1=4.5; Vs2=5; Vo=R1/R*(Vs2-Vs1); printf ( ” O u tp ut v o l t a g e =% . 1 f V” , V o )
Scilab code Exa 8.18 Find CMRR in dB
1 2 3 4 5 6
// 8. 18
clc ; Vcom=0.5*(2+2); Acom=5*10^-3/Vcom; CMRR=20* log10 (50/Acom); printf ( ”CMRR=%. 2 f dB” ,CMRR)
Scilab code Exa 8.21 Find the different parameters of high pass filter
1 2 3 4 5 6 7
// 8. 21
clc ; R2=5.6*10^3; R1=1*10^3; Avf=1+R2/R1; printf ( ”Mid band Gain=%.2 f ” , Avf ) Vin=1.6;
100
8 9 10 11 12 13 14 15
Vo=Avf*Vin; printf ( ” \ nOutput vo l ta g e=%.3 f mV” , Vo ) R=1000; C=0.001*10^-6; fc=1/(2*%pi*R*C); printf ( ” \ n Cu tt o f f f r e q u e n c y =%. 2 f Hz ” , fc ) Gain=0.707*Avf; printf ( ” \ nGa in=%. 3 f ” , G ai n )
Scilab code Exa 8.22 Find the different parameters of low pass filter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// 8. 22
clc ; R2=5.6*10^3; R1=10*10^3; Avf=1+R2/R1; printf ( ”Mid band Gain=%.2 f ” , Avf ) Vin=1.1; Vo=Avf*Vin; printf ( ” \ nOutput vo l ta g e=%.3 f mV” , Vo ) R=10000; C=0.001*10^-6; fc=1/(2*%pi*R*C); printf ( ” \ n Cu tt o f f f r e q u e n c y =%. 2 f Hz ” , fc ) Vo=0.707*Avf; printf ( ” \ nOutput vo l ta g e=%.3 f mV” , Vo )
101
Chapter 9 Number systems
Scilab code Exa 9.1 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5 6
// 9. 1
clc ; x=10; disp ( ’ The b i n a r y number i s ’ ) a=dec2bin(x); disp ( ’ ’ ,a )
Scilab code Exa 9.2 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5 6
// 9. 2
clc ; x=25; disp ( ’ The b i n a r y number i s ’ ) a=dec2bin(x); disp ( ’ ’ ,a )
102
Scilab code Exa 9.3 Convert binary number into equivalent decimal num-
ber 1 2 3 4 5 6
// 9. 3 clc ; a= ’ 101 110 ’ ; disp ( ’ The d e c im a l no . x=bin2dec(a); disp ( ’ ’ ,x )
is ’)
Scilab code Exa 9.4 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5 6 7 8 9 10
// 9. 4
clc ; x=15; disp ( ’ The b i n a ry number o f d e c im a l 1 5 i s ’ ) a=dec2bin(x); disp ( ’ ’ ,a ) x=31; disp ( ’ The b i n a ry number o f d e c im a l 3 1 i s ’ ) a=dec2bin(x); disp ( ’ ’ ,a )
Scilab code Exa 9.5 Calculate the subtraction of two binary numbers
1 // 9. 5 2 clc ; 3 a= ’ 110 01 ’ ;
103
4 5 6 7 8 9 10
b=bin2dec(a); c= ’ 100 01 ’ ; f=bin2dec(c); d=b-f; s=dec2bin(d); disp ( ’ S u b t r a c t i o n disp (s)
o f two b i n a r y n um be rs= ’ )
Scilab code Exa 9.6 Calculate the subtraction of two binary numbers
1 2 3 4 5 6 7 8 9 10
// 9. 6
clc ; a= ’ 101 0 ’ ; b=bin2dec(a); c= ’ 011 1 ’ ; f=bin2dec(c); d=b-f; s=dec2bin(d); disp ( ’ S u b t r a c t i o n disp (s)
o f two b i n a r y n um be rs= ’ )
Scilab code Exa 9.7 Express the decimals in 16 bit signed binary system
1 2 3 4 5 6
// 9. 7
clc ; a=8; b=dec2bin(a); disp (b) disp ( ’ The 1 6 b i t
s i g n e d b i n a r y number o f +8=0000 0 0 00 0 0 00 1 0 00 ’ ) 7 disp ( ’ The 16 b i t s i g n e d b i na r y number o f −8=1000 0 0 00 0 0 00 1 0 00 ’ ) 8 a=165;
104
9 b=dec2bin(a); 10 disp (b) 11 disp ( ’ The 1 6 b i t
s i g n e d b i n a r y number o f +165=0000 0 0 00 1 0 10 0 1 01 ’ ) 12 disp ( ’ The 16 b i t s i g n e d b i na r y number o f −165=1000 0 0 00 1 0 10 0 1 01 ’ )
Scilab code Exa 9.8 Calculate the twos complement representation
// 9. 8
1 2 3 4 5
clc ; a= ’ 0 0 0 1 1 1 1 1 ’ ; disp (a) disp ( ’ S i n ce t h e MSB i s 0 s o t h i s
6 7 8 9 10
b=bin2dec(a); disp (b) a= ’ 1 1 1 0 0 1 0 1 ’ ; disp (a) disp ( ’ S i n ce t h e MSB i s 1 s o t h i s
11 12 13 14 15 16 17
18 19 20 21
i s a p o s i t iv e number and i t s 2 s co mplement r e p r e s e n t a t i o n i s ’ )
i s a n eg a ti ve number and i t s 2 s co mplement r e p r e s e n t a t i o n i s ’ )
c=bin2dec(a); x c = b it cm p ( c ,8) ; b=xc+1; disp (b) a= ’ 1 1 1 1 0 1 1 1 ’ ; disp (a) disp ( ’ S i n ce t h e MSB i s 1 s o t h i s
i s a n eg a ti ve number and i t s 2 s co mplement r e p r e s e n t a t i o n i s ’ )
c=bin2dec(a); x c = b it cm p ( c ,8) ; b=xc+1; disp (b)
105
Scilab code Exa 9.9 Find the largest positive and negative number for 8
bits 1 // 9. 9 2 clc ; 3 disp ( ’ The l a r g e s t 8 b i t
p o s i t i v e number i s +127 and i s r e p r e se n t e d i n b in ar y a s ’ ) 4 a= ’ 0 1 1 1 1 1 1 1 ’ ; 5 disp (a) 6 disp ( ’ The l a r g e s t 8 b i t n e g a t i ve number i s −128 and i s r e p r e se n t e d i n b in ar y a s ’ ) 7 a= ’ 1 0 0 0 0 0 0 0 ’ ; 8 disp (a)
Scilab code Exa 9.10 Calculate addition and subtraction of the numbers
1 2 3 4 5 6 7 8 9 10
// 9. 10
clc ; c=24; x c = b it cm p ( c ,8) ; A=xc+1; B=16; Ans=A+B; a=dec2bin(Ans) disp (a) disp ( ’ S i n ce t he MSB i s 1 s o t he number i s and e q ua l t o −8 ’ )
11 12 Ans=A-B; 13 a=dec2bin(Ans) 14 disp (a)
106
negative
15 disp ( ’ S i n ce t he MSB i s 1 s o t he number i s and e q ua l t o −40 ’ )
negative
Scilab code Exa 9.11 Calculate addition and subtraction of the numbers
// 9. 11
1 2 3 4 5 6 7 8 9 10 11 12
13 14 15 16
clc ; c=60; x c = b it cm p ( c ,8) ; A=xc+1; d=28; x d = b it cm p ( d ,8) ; B=xd+1; Ans=B+A; a=dec2bin(Ans) disp (a) disp ( ’ S i n ce t he MSB i s 1 s o t he number i s and e q ua l t o −88 ’ ) Ans=B-A; a=dec2bin(Ans,8) disp (a) disp ( ’ S i nc e t he MSB i s 0 s o t he number i s a nd e q u a l t o +32 ’ )
negative
positi ve
Scilab code Exa 9.12 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5
/ / 9 . 12 clc ; q =0; b =0; s =0;
107
6 a = 0 .6 8 75 ;
// a c c ep t i n g t he d ec im a l i n p ut from
user 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
d = modulo ( a ,1) ; a = floor ( a ) ; while ( a >0) x = modulo ( a ,2) ; b = b + (10^ q ) * x ; a = a /2; a = floor ( a ) ; q = q +1; end for i = 1: 10
// f o r f r a c t i o n a l p a r t d = d *2; q = floor ( d ) ; s = s + q /(10^ i ) ; if d >=1 then d =d - 1; end end m=b+s; printf ( ” E q u i v a l e n t b i n a r y n um be r=% . 4 f ” ,m)
Scilab code Exa 9.13 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5 6 7 8 9
/ / 9 . 13
clc ; q =0; b =0; s =0; // a c c e p t in g t he d ec im al i n p ut fro m u s er a = 0 .6 34 ; d = modulo ( a ,1) ; a = floor ( a ) ; while ( a >0)
108
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
x = modulo ( a ,2) ; b = b + (10^ q ) * x ; a = a /2; a = floor ( a ) ; q = q +1; end for i = 1: 10
// f o r f r a c t i o n a l p a r t d = d *2; q = floor ( d ) ; s = s + q /(10^ i ) ; if d >=1 then d =d - 1; end end m=b+s; printf ( ” E q u i v a l e n t b i n a r y n um be r=% . 7 f ” ,m)
Scilab code Exa 9.14 Convert decimal number into equivalent binary num-
ber 1 2 3 4 5 6 7 8 9 10 11 12 13 14
/ / 9 . 14
clc ; clear ; q =0; b =0; s =0; // a c c e p t in g t he d ec im al i n p ut fro m u s er a = 3 9. 12 ; d = modulo ( a ,1) ; a = floor ( a ) ; while ( a >0) x = modulo ( a ,2) ; b = b + (10^ q ) * x ; a = a /2; a = floor ( a ) ;
109
15 16 17 18 19 20 21 22 23 24 25 26 27
q = q +1; end for i = 1: 10
// f o r f r a c t i o n a l p a r t d = d *2; q = floor ( d ) ; s = s + q /(10^ i ) ; if d >=1 then d =d - 1; end end m=b+s; printf ( ” E q u i v a l e n t b i n a r y n um be r=% . 7 f ” ,m)
Scilab code Exa 9.15 Find the addition of binary numbers
1 2 3 4 5 6 7 8 9 10
// 9. 15
clc ; a= ’ 1 0 1 1 0 1 0 1 0 1 ’ ; d=bin2dec(a); c= ’ 1 0 0 0 1 1 0 1 0 ’ ; b=bin2dec(c); e=d+b; f=dec2bin(e); disp ( ’ a d d i t i o n o f b i n a ry nu mbers = ’ ) disp (f)
Scilab code Exa 9.16 Convert binary number into equivalent decimal num-
ber 1 // 9. 16 2 clc ; 3 p =1;
110
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
q =1; z =0; b =0; w =0; f =0; b i n = 1 1 0 01 . 0 0 1 01 1 ; // b i na r y i n pu t d = modulo ( bin ,1) ; d = d * 10 ^1 0; a = floor ( bin ) ; while ( a >0) r = modulo ( a ,10) ; b (1 ,q) = r ; a = a /1 0; a = floor ( a ) ; q = q +1; end for m =1: q -1 c = m -1; f = f +b (1 , m ) * ( 2^ c ) ; end while ( d >0) e = modulo ( d ,2) w (1 , p ) = e d = d / 10; d = floor ( d ) p = p +1; end for n =1: p -1 z = z + w ( 1 , n ) *(0.5) ^(11 - n ) ; end z = z *1 000 0; z = round ( z ) ; z = z /1 000 0; x=f+z; printf ( ” E q u i v a l e n t d e c i m a l n um be r=% . 6 f ” ,x )
111
Scilab code Exa 9.17 Convert hexadecimal number into equivalent deci-
mal number 1 2 3 4 5 6
// 9. 17 clc ; a= ’ 8A3 ’ ; disp ( ’ The d e c im a l no . x= hex2dec (a); disp ( ’ ’ ,x )
is ’)
Scilab code Exa 9.18 Convert decimal number into equivalent hexadeci-
mal number 1 2 3 4 5 6
// 9. 18 clc ; a=268; disp ( ’ The h ex a d e c im a l no . x= dec2hex (a); disp ( ’ ’ ,x )
is ’)
Scilab code Exa 9.19 Convert decimal number into equivalent hexadeci-
mal number 1 2 3 4 5 6
// 9. 19 clc ; a=5741; disp ( ’ The h ex a d e c im a l no . x= dec2hex (a); disp ( ’ ’ ,x )
is ’)
112