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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 5: Inverters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.12_1: EX5_12_1.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Example 5.12.1: rms output voltage,output power, average and peak currents,peak reverse blocking voltage,THD,DF,harmonic factor and distortion factor of the lowest order harmonic\n",
"clc;\n",
"clear;\n",
"close;\n",
"disp('part (a)')\n",
"format('v',5)\n",
"v=24;//in volts\n",
"V=v;//\n",
"r=3;//in ohms\n",
"v1rms=(2*v)/(sqrt(2)*%pi);//in volts\n",
"disp(v1rms,'rms output voltage at fundamental frequency in volts is')\n",
"disp('part (b)')\n",
"po=((v/2)^2)/r;//in watts\n",
"disp(po,'output power in Watt is')\n",
"disp('part (c)')\n",
"itav=(v/(4*r));//in amperes\n",
"itp=((v/2)/r);//in amperes\n",
"disp(itav,'average transistor current in amperes is')\n",
"disp(itp,'transistor peak current in amperes is')\n",
"disp('part (d)')\n",
"vbr=2*(v/2);//in volts\n",
"disp(vbr,'peak reverse bloacking voltage in volts is')\n",
"disp('part (e)')\n",
"vo=v/2;//\n",
"THD1=((vo)^2-(v1rms)^2)^(1/2);//in volts\n",
"THD=THD1/v1rms;//\n",
"disp(THD*100,'Total Hramonic distortion in percentage is')\n",
"disp('part (f)')\n",
"n=[0;0;(1/3);0;(1/5);0;(1/7);0;(1/9);0;(1/11);0;(1/13)];//\n",
"for i=[3;5;7;9;11;13]\n",
" v(i)=(2*V)*((n(i)))/(%pi*sqrt(2));//\n",
"end\n",
"x=sqrt((((v(3))/(3^2))^2)+(((v(5))/(5^2))^2)+(((v(7))/(7^2))^2)+(((v(9))/(9^2))^2)+(((v(11))/(11^2))^2)+(((v(13))/(13^2))^2));//\n",
"DF=x/v1rms;//\n",
"disp(DF*100,'distortion factor in percentage is')\n",
"//distortion factor is calculated wrong in the textbook\n",
"disp('part (g)')\n",
"HF3=v(3)/v1rms;//\n",
"DF3=((v(3))/(3^2))/v1rms\n",
"disp(HF3*100,'HF for the third harmonic in percentage is')\n",
"disp(DF3*100,'DF the third harmonic in percentage is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.12_2: EX5_12_2.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Example 5.12.2: rms output voltage,output power,average and peak currents,peak reverse blocking voltage,THD,DF,harmonic factor and distortion factor of the lowest order harmonic\n",
"clc;\n",
"clear;\n",
"close;\n",
"format('v',5)\n",
"v=48;//in volts\n",
"V=v;//\n",
"r=2.4;//in ohms\n",
"v1rms=(4*v)/(sqrt(2)*%pi);//in volts\n",
"disp('part (a)')\n",
"disp(v1rms,'rms output voltage at fundamental frequency in volts is')\n",
"disp('part (b)')\n",
"po=((v)^2)/r;//in watts\n",
"disp(po,'output power in Watt is')\n",
"disp('part (c)')\n",
"itav=(v/(r));//in amperes\n",
"itp=((v/2)/r);//in amperes\n",
"disp(itp,'average transistor current in amperes is')\n",
"disp(itav,'transistor peak current in amperes is')\n",
"disp('part (d)')\n",
"vbr=2*(v/2);//in volts\n",
"disp(vbr,'peak reverse bloacking voltage in volts is')\n",
"disp('part (e)')\n",
"vo=v;//\n",
"THD1=((vo)^2-(v1rms)^2)^(1/2);//in volts\n",
"THD=THD1/v1rms;//\n",
"disp(THD*100,'Total Hramonic distortion in percentage is')\n",
"disp('part (f)')\n",
"n=[0;0;(1/3);0;(1/5);0;(1/7);0;(1/9);0;(1/11);0;(1/13)];//\n",
"for i=[3;5;7;9;11;13]\n",
" v(i)=(2*V)*((n(i)))/(%pi*sqrt(2));//\n",
"end\n",
"x=sqrt((((v(3))/(3^2))^2)+(((v(5))/(5^2))^2)+(((v(7))/(7^2))^2)+(((v(9))/(9^2))^2)+(((v(11))/(11^2))^2)+(((v(13))/(13^2))^2));//\n",
"vorms=0.9\n",
"DF=x/vorms;//\n",
"disp(DF*100,'distor factor in percentage is')\n",
"//distortion factor is calculated wrong in the textbook\n",
"disp('part (g)')\n",
"HF3=2*v(3)/v1rms;//\n",
"DF3=2*((v(3))/(3^2))/v1rms\n",
"disp(HF3*100,'HF for the third harmonic in percentage is')\n",
"disp(DF3*100,'DF the third harmonic in percentage is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.12_3: amplitude_of_the_first_three_lower_order_harmonics.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Example 5.12.3: amplitude of the first three lower order harmonis\n",
"clc;\n",
"clear;\n",
"close;\n",
"//given data :\n",
"v=200;//in volts\n",
"n=[(1/3);(1/5);(1/7)];//\n",
"for i=1:3\n",
" vn(i)=((4*v*n(i))/(sqrt(2)*%pi));//\n",
"end\n",
"disp(round(vn(1)),'Rms value of third harmonic component of output voltage in volts is')\n",
"disp(round(vn(2)),'Rms value of fifth harmonic component of output voltage in volts is')\n",
"disp((vn(3)),'Rms value of seventh harmonic component of output voltage in volts is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.12_4: compare_performance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Example 5.12.4: amplitude of the first three lower order harmonis\n",
"clc;\n",
"clear;\n",
"close;\n",
"//given data :\n",
"v=200;//in volts\n",
"n=[(1/3);(1/5);(1/7)];//\n",
"vo1rms=(2*v)/(sqrt(2)*%pi);//in volts\n",
"for i=1:3\n",
" vn(i)=((2*v*n(i))/(sqrt(2)*%pi));//\n",
"end\n",
"disp(round(vo1rms),'Vo1rms for half bridge circuit in volts is')\n",
"disp(round(vn(1)),'Rms value of third harmonic component for half bridge circuit in volts is')\n",
"disp(round(vn(2)),'Rms value of fifth harmonic component for half bridge circuit in volts is')\n",
"disp((vn(3)),'Rms value of seventh harmonic component for half bridge circuite in volts is')\n",
"disp('for bridge inverter')\n",
"vo1rms1=(4*v)/(sqrt(2)*%pi);//in volts\n",
"for i=1:3\n",
" vn1(i)=((4*v*n(i))/(sqrt(2)*%pi));//\n",
"end\n",
"disp(round(vo1rms1),'Vo1rms for half bridge circuit in volts is')\n",
"disp(round(vn1(1)),'Rms value of third harmonic component for bridge inverter circuit in volts is')\n",
"disp(round(vn1(2)),'Rms value of fifth harmonic component for half bridge inverter circuit in volts is')\n",
"disp((vn1(3)),'Rms value of seventh harmonic component for half bridge inverter circuite in volts is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.3_1: frequency.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Example 5.3.1: Maximum frequency\n",
"clc;\n",
"clear;\n",
"close;\n",
"//given data :\n",
"T_off=100;// in micro-sec\n",
"L=40;// in micro-H\n",
"C=5;// in micro-farad\n",
"R=4;//in ohm\n",
"Tr=((2*%pi)/sqrt((1/(C*10^-6*L*10^-6))-(R^2/(4*(L*10^-6)^2))))*10^6;\n",
"f=(1/(Tr+T_off))*10^3;\n",
"disp(f,'maximum frequency,f(kHz) = ')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|