Matlab
Matlab
EE-506
MATLAB
S.NO. Name of Experiment Page
No.
1 Basics of MATLAB
1.1 Arithmetic operation
1.2 Handling of complex number
1.3 Creation of array and its operation
1.4 Various operation of matrix
1.5 Operation of different logical operator
2 Plot the curve y=sin(x) for t=0 to t=0.04 sec, where x= ωt (f=50hz).
3 Plot a curve of equation y = x˄3, for 0≤x≤10. Label the axes and gives a
suitable title.
4 Plot the voltage (v = 5sinωt) and current [i = 2sin(ωt-ϕ)] flowing through
a circuit on the common axis.
5 Use the hold command to obtain a multiple plot. Use the gtext command
to add the text v1 and v2 to the plots.
6 Use the line command to obtain a multiple plot. Use the gtext command
to add the text v1 and v2 to the plots.
7 Determine the current flowing through each branch in the resistive circuit
as shown in the figure. Using mesh analysis find i1,i2,i3,i4,i5.
8 Determine the node voltages and current flowing through resistance R4 in
the circuit shown in the figure Where, E1 =100V, E2 =50V, R1 =1.5k ,
R2 =1.2k , R3 =2.2k , R4 =1.5k , I =100mA.
9 Find the current I flowing through the circuit shown in the figure to
verify superposition theorem where V1 =5v, V2 =10v, R1 =20 , R2 =10 ,
R3 =10
10 A voltage of 100 V, 50 Hz is impressed across a 10ohm resistance. Write
the time equation for the voltage and resulting current.
11 Simulation model of single phase half wave controlled rectifier with R
load.
12 Simulation model of single phase full wave controlled rectifier with R
load.
13 Simulation model of three phase half controlled rectifier with RL load.
14 Simulation model of three phase fully controlled rectifier with RLE load.
15 Simulation model of step down chopper with RL Load.
INDEX
SIGNATURE
S.NO. NAME OF OF FACULTY/ GRADE
EXPERIMENT DATE OF
EVALUATION
EXPERIMENT NO. 01
AIM: Basics of MATLAB
1.1 Arithmetic operation
1.2 Handling of complex number
1.3 Creation of array and its operation
1.4 Various operation of matrix
1.5 Operation of different logical operator
Arithmetic operation:
Addition, subtraction, multiplication, division,
power, rounding. Arithmetic functions include operators for simple
operations like addition and multiplication, as well as functions for
common calculations like summation, moving sums, modulo operations,
and rounding.
Addition
+ Addition or append strings
Subtraction
- Subtraction
Multiplication
.* Multiplication
* Matrix multiplication
Division
./ Right array division
Powers
.^ Element-wise power
^ Matrix power
Functions
abs Absolute value and complex magnitude
angle Phase angle
complex Create complex array
conj Complex conjugate
cplxpair Sort complex numbers into complex conjugate pairs
i Imaginary unit
imag Imaginary part of complex number
isreal Determine whether array uses complex storage
j Imaginary unit
real Real part of complex number
sign Sign function (signum function)
unwrap Shift phase angles
1 2 3 4
1 2 3
4 5 6
7 8 10
Another way to create a matrix is to use a function, such as ones, zeros, or rand. For example, create a 5-
by-1 column vector of zeros.
z = zeros(5,1)
z = 5×1
0
0
0
0
0
6
7
You can also select the elements in the mth through nth columns, for this we write −
a(:,m:n)
Let us create a smaller matrix taking the elements from the second and third columns −
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8];
a(:, 2:3)
MATLAB will execute the above statement and return the following result −
ans =
2 3
3 4
4 5
5 6
In the same way, you can create a sub-matrix taking a sub-part of a matrix.
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8];
a(:, 2:3)
MATLAB will execute the above statement and return the following result −
ans =
2 3
3 4
4 5
5 6
In the same way, you can create a sub-matrix taking a sub-part of a matrix.
For example, let us create a sub-matrix sa taking the inner subpart of a −
3 4 5
4 5 6
To do this, write −
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8];
sa = a(2:3,2:4)
MATLAB will execute the above statement and return the following result −
sa =
3 4 5
4 5 6
(CREATING MATRIX)
1 4 7
2 5 8
3 6 9
10 3 12
1 14 13
2 11 14
>> ZR=zeros(3,4)
(ZERO MATRIX)
ZR =
0 0 0 0
0 0 0 0
0 0 0 0
>> O=ones(4,3)
(ONES MATRIX)
O=
1 1 1
1 1 1
1 1 1
1 1 1
>> P=eye(5)
(IDENTITY MATRIX)
P=
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
>>C=A+B
(ADDITION OF MATRIX)
C=
11 7 19
3 19 21
5 17 23
>>D=A-B
(SUBTRACTION OF MATRIX)
D=
-9 1 -5
1 -9 -5
1 -5 -5
>>E=A*B
(MULTIPLICATION OF MATRIX)
E=
28 136 162
41 164 201
54 192 240
>>F=A/B
(DIVISION OF MATRIX)
F=
>> G=A.*B
G = 10 12 84
2 70 104
6 66 126
>> H=A./B
H=
>>J=A^2
(POWER OF MATRIX)
J=
30 66 102
36 81 126
42 96 150
>>L=det(A)
>> A=[0 0 1 1]
A=
0 0 1 1
>> B=[0 1 0 1]
B=
0 1 0 1
>>C=A&B
C=
0 0 0 1
>> C=and(A,B) C
0 0 0 1 >>D=A|B
0 1 1 1
>> D=or(A,B) D
0111
>>E=xor(A,B)
E=0 1 1 0
>>F=~A
(NOT OPERATION)
F=1 1 0 0
>>G=~B
(NOT OPERATION)
G=1 0 1 0
EXPERIMENT NO. 02
AIM:
Plot the curve y=sin(x) for t=0 to t=0.04 sec, where x= ωt (f=50hz).
Theory:- The following statements produce a graph similar to the one shown in fig.
with red color (r) dashed line (- -) of width 2.5 having square marker (s) on it. The
markers have black edge (k) of size 8 with green fill color.
PROGRAMM
%defining frequency and other variable parameters
f=50;
w=2*pi*f;
t=0:1e-3:0.04;
x=w*t;
%defining the functions
y=sin(x);
%plot the curve
plot(t,y,'r-- s','linewidth',2.5,’MarkerEdgeColor’,’k’)
PLOTINNG
EXPERIMENT NO. 03
AIM: Plot a curve of equation y = x˄3, for 0≤x≤10. Label the axes and gives a
suitable title.
PROGRAMM
>> x=[0:1:10]
x=
0 1 2 3 4 5 6 7 8 9 10
>> y=x.^3
y=
Columns 1 through 10
0 1 8 27 64 125 216 343 512
729
Column 11
1000
>> plote(x,y);
Plotinng
EXPERIMENT NO. 04
AIM: Plot the voltage (v = 5sinωt) and current [i = 2sin(ωt-ϕ)] flowing through a
circuit on the common axis.
Program
t=0:1e-3:0.04;
f=50;
w=2*pi*f;
phi=pi/3;
v=5*sin(w*t);
i=2*sin((w*t)-phi);
plot(t,v,t,i);
xlabel('Time(sec)');
grid;
Output:-
EXPERIMENT NO. 05
AIM: Use the hold command to obtain a multiple plot. Use the gtext command to
add the text v1 and v2 to the plots.
Program
t=0:1e-3:0.04;
f=50;
w=2*pi*f;
phi=pi/3;
v1=sin(w*t);
plot(t,v1);
hold on;
gtext('v1 = sin(wt)');
v2 = cos (w*t);
plot(t,v2);
hold off;
gtext('v2 = cos(wt)');
xlabel('Time(sec)');
grid;
Program Window
Output
EXPERIMENT NO. 06
AIM: Use the line command to obtain a multiple plot. Use the gtext command to
add the text v1 and v2 to the plots.
Program
t=0:1e-3:0.04;
f=50;
w=2*pi*f;
phi=pi/3;
v1=sin(w*t);
v2 = cos (w*t);
plot(t,v1, '--');
gtext('v1');
line(t,v2);
gtext('v2');
xlabel('Time(sec)');
grid;
Program Window
Output
EXPERIMENT NO. 11
AIM: Simulation model of single phase half wave controlled rectifier with R load.
Circuit Diagram
OUTPUT
DEVICE
EXPERIMENT NO. 12
AIM: Simulation model of single phase full wave controlled rectifier with R
Load.
Introduction
Rectifier circuit, especially single phase bridge controlled rectifier circuit, is the
most important circuit in power electronics technology, and it is also the most
widely applicable circuit, the circuit is not only used in the general industry, but it
is widely used in other fields, including transportation, power system,
communication system, energy system etc. It has practical significance to do
comparative study on single phase bridge controlled rectifier circuit parameters,
because it is not only a critical link in power electronic circuits theory learning, but
has the predicting and guiding effect in the actual application of engineering
practice.[1][2] The visual simulation tool provided Matlab, Simulink, can establish
the circuit simulation model directly, and it can change the parameters of the
simulation at will, and the simulation result could be got immediately, and it has
the feature of strong visuality, further eliminating the steps of programming. [3-5]
。As a new kind of high performance language, Matlab provides an ideal tool for
the research and application of power electronic technology.
PROCEDURE
The circuit consist of four thyristors T1, T2, T3 and T4, a
voltage source Vs and a R
Load.
During the positive half cycle of the input voltage, the thyristors T1 & T2 is
forward
biased but it does not conduct until a gate signal is applied to it.
When a gate pulse is given to the thyristors T1 & T2 at ωt = α, it gets turned ON
and
begins to conduct.
When the T1 & T2 is ON, the input voltage is applied to the load through the
path Vs-
T1-Load-T2-Vs.
During the negative half cycle, T3 & T4 is forward biased, the thyristor T1 & T2
gets
MATLAB Simulation
Model The simulation model of single phase full wave rectifier circuit with
resistive load of Simulink simulation module based on MATKAB7.0 is shown in
Figure.
The simulation model of single phase full wave rectifier circuit with resistive load The modules
and extraction paths that are used in the simulation model are shown in Table 1. The parameter
setting of Module T in the simulation model is shown in the Figure
In the MATLAB command window , when entering the following command, the
output voltage of the rectifier circuit can be calculated.
DEVICE
Conclusion
The MATLAB command operation results are consistent with the one
of theoretical analysis. The theory and simulation results of single phase
full wave rectifier circuit with resistive load have been analyzed with the
application of Matlab visual simulation tool Simulink. The output
voltage waveform that is obtained has been compared, and the paper
further verifies the correctness of the simulation results. The paper
validates the correctness of the model that has been built in this paper
with the simulation analysis. Based on MATLAB/Simulink, single phase
bridge rectifier circuit simulation analysis has been conducted in this
paper, this method avoids the tedious drawing and calculation process in
the conventional analysis methods, getting an intuitive and quick
analysis method of rectifier circuit. The application of Matlab/ Simulink
simulation can flexibly change the simulation parameters in the
simulation process, and it can directly observe the simulation results that
vary with parameters. The simulation research of rectifier circuit with
application of Matlab lays the foundation of the analysis of single-phase
bridge rectifier circuit and it is a powerful simulation software, which is
worth popularizing and applying. It is also a good assistant tool for the
experiment of power electronics technology.
EXPERIMENT NO. 13
AIM: Simulation model of three phase half controlled rectifier with RL load.
Apparatus Required:-
Matlab Simulink
1. Current Measurement
2. Pulse generator
3. Scope
4. Powergui
5. Synchronized 6-Pulse Generator
6. Universal Bridge
7. Three-Phase Programmable Voltage Source
8. Three-Phase V-I Measurement
Software Used:
Matlab – Simulink
Circuit Diagram:
Theory:
The three phase Half bridge converter works as three phase AC-
DC converter for firing angle delay 0<α≤90 and as three phase line commutated.
inverter for 90
numbering scheme is adopted here as it agrees with the sequence of gating of six
thyristors in
a 3-phase full converter. Here each SCR is conduct for 120
At any time two SCRs, one from
positive group and other from negative group must conduct together and this
combination
must conduct for 60
0
Simulink Models:
Graphs
GATE CURRENT
OUTPUT
Procedure :
Operation Path Icon
Opening Simulink 1. Click on the Simulink icon
on Matlab taskbar
2. Type Simulink on Matlab
Command Window
RESULT:
Three phase fully controlled and half controlled bridge rectifier is
simulated and graphs are obtained.
EXPERIMENT NO. 14
AIM: Simulation model of three phase fully controlled rectifier with RLE load.
INTRODUCTION –
Power electronics concerns the application of electronic
principles into situations that are rated at power levels rather than signal level. The
development of new power semiconductor devices, new circuit topologies with
their improved performance and their fall in prices have opened up wide field for
For any current to flow in the load at least one device from the top group (T1, T3,
T5) and one from the bottom group (T2, T4, T6) must conduct. Then from symmetry
consideration it can be argued that each thyristor conducts for 120° of the input
cycle. Now the thyristors are fired in the sequence T1 → T2 → T3 → T4 → T5 → T6
→ T1 with 60° interval between each firing. Therefore thyristors on the same phase
leg are fired at an interval of 180° and hence cannot conduct simultaneously. This
leaves only six possible conduction mode for the converter in the continuous
conduction mode of operation. These are T1T2, T2T3, T3T4, T4T5, T5T6, T6T1. Each
conduction mode is of 60° duration and appears in the sequence mentioned.
Table.1 shows the firing sequence of SCRs
SIMULATION- The PSIM simulation model and waveforms of three phase full controlled
converter is shown if fig.5, fig.6 and
Fig.7.
OUTPUT
SIMULATION RESULT
In this paper various waveforms are obtaining to verify the working of three phase
full wave controlled rectifier for different firing angle at a specified time duration.
Figure 8 shows the input waveform for three phase controlled rectifier and from
Figures to 11 shows the waveforms for firing angles at 0, 30 and 45 degree.
Figure 12 shows the output waveform of a three phase full wave rectifier for
different firing angles at a given time period. It is clear from Figure 12 that form
ωt= 0-0.0167 (converter)rectifier works for 0 deg firing angle
ωt = 0.0167-0.033 for 30deg firing angle And for ωt=0.033-0.05 for 45deg firing
angle.
EXPERIMENT NO. 15
46 | P a g e MATLAB (Vth SEM EE)
Department of Electrical Engineering, IGEC, Sagar (M.P.)
THEORY:
Figure below shows the circuit diagram of step down DC-DC
converter, commonly known as buck converter. When switch S is ON, diode D is
reverse biased and voltage across inductor will be Vs-Vo. So inductor current
increases and attains peak. When switch S is OFF, diode D is forward biased and
voltage across inductor will be -Vo. So, inductor current decreases. Hence inductor
with diode ensures an uninterrupted current flow and hence a constant output
voltage with capacitor for removing voltage ripples.
Output voltage is given by
PROCEDURE:
1. Make the connections as shown in the figures by using MATLAB Simulink.
2. Set the parameters in PWM generator for firing the switches, set the values
for load and input voltage.
3. Check the scope wave forms in each circuit
EXPECTED GRAPH :
RESULT: