SECTION II - LECTURE 2
Introduce and discuss the how a system model can be
developed and simulate using simulink
Simpowersystems
Students should develop the given examples and familiarize
with the available tools in simulink and simpowersystems
Lab class and an assignment to cover the advanced contents
and applications
SECTION II - LECTURE 2
Basic simulations simulink
MATLAB SIMULINK
Simulink
Environment
MATLAB SIMULINK
create a new model
create a new model selecting Model in the New submenu from
the Simulink library browsers File menu
MATLAB SIMULINK:
Simulink Help
MATLAB SIMULINK:
Sources
Select sources from the library. Drag any block you want to use into the model.
7
MATLAB SIMULINK:
Sinks
Select sinks from the library. Drag any block you want to use into the model.
8
MATLAB SIMULINK:
Simulation
Simulation model
MATLAB SIMULINK:
Simulation
Simulation parameters
Set start and
stop time for the
simulation here
10
MATLAB SIMULINK:
Simulation
11
MATLAB SIMULINK:
Modifying Block Properties
Double click on any
block to bring up a
properties box
12
MATLAB SIMULINK:
Adding Comments
You can add text comments
anywhere in the block diagram
by double clicking and typing in
some text.
13
MATLAB SIMULINK:
Signal Routing
You can create a branch point in
a signal line by holding down the
CTRL key, and clicking on the
line.
MATLAB SIMULINK:
Signal Routing
15
MATLAB SIMULINK:
Transfer Functions
16
MATLAB SIMULINK:
Transfer Functions
17
MATLAB SIMULINK:
Integrators and Derivatives
18
MATLAB SIMULINK:
Closed Loop Control System
19
MATLAB SIMULINK:
Subsystems
20
MATLAB SIMULINK:
Setting Up Systems- A Nonlinear System
MATLAB SIMULINK:
User Defined Functions
22
MATLAB SIMULINK:
Communicating with the Workspace
23
DATA CAPTURING
necessary to save your data after the simulation
For an example, can automatically save the data collected by
the Scope at the end of the simulation by selecting the Save
data to workspace check box
E.g.
Look-Up
Sine Wave
Table
Scope
24
DATA CAPTURING
If you select data history and click on save data to workspace, the
Variable name and Format fields become active
1.
2.
3.
4.
5.
>> plot(A(:,1),A(:,2))
>> grid on;
25
DATA CAPTURING
Look-Up
Sine Wave
Scope
Table
1
0.8
0.6
>> plot(A(:,1),A(:,2))
>> grid on;
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
10
26
Step
Discrete State-Space
Scope
27
D
28
dynamic equations
x1 0
x 0
2
x 3 k / m1
x 4 k / m 2
0
0
k / m1
k / m2
select
1
0
D / m1
0
0 x1 0
1 x 2 0
u (t )
0 x3
0
0 x 4 1 / m 2
k D 0.5, m1 m2 1
29
0 x1 0
1 x 2 0
u (t )
0 x 3 0
0 x 4 1
0
1
0
0
0
0
A
0.5 0.5 0.5
0
0.5 0.5
0
0
B
1
0
C 1 0 0 0
D 1
30
0
1
0
MATLAB SIMULINK:
STATE SPACE MODELS
31
MATLAB SIMULINK:
STATE SPACE MODELS
Block Parameters for State
Space Matrices
32
MATLAB SIMULINK:
STATE SPACE MODELS
run the simulation on the development environment, following
code will generate the output
>> plot(A(:,1),A(:,2));
>> grid on
>> xlabel('\fontsize{16} Time [s]');
>> ylabel('\fontsize{16} Variable x_1 ');
Variable x1
1.5
0.5
10
20
30
40
50
60
70
80
90
100
Time [s]
MATLAB SIMULINK:
Quantization
The Quantizer block passes its input signal through a stair-step
function so that many neighboring points on the input axis are
mapped to one point on the output axis.
The effect is to quantize a smooth signal into a stair-step
output.
Quantizer
Sine Wave
Scope
34
MATLAB SIMULINK:
Quantization
35
MATLAB SIMULINK:
Quantization
Output
36
600
2
s3+14s +39s+70
Transfer Fcn
Scope
Step
transfer function
600
S 3 14S 2 39S 70
37
1.4
1.2
Amplitude
0.8
0.6
0.4
0.2
10
Time [s]
39
200
s3+14s2+59s+70
Step
Transfer Fcn
Scope
1
s+1
Transfer Fcn1
40
Amplitude
1.4
1.2
1
0.8
0.6
0.4
0.2
0
10
Time [s]
41
80
s3+14s2+59s+70
Step
Transfer Fcn
Scope
1
20s+7
Transfer Fcn1
42
1.4
1.2
Amplitude
0.8
0.6
0.4
0.2
10
20
30
40
50
60
70
Time [s]
43
MATLAB SIMULINK:
SimPowerSystems
Component libraries and analysis tools for modeling and
simulating electrical power systems
MATLAB SIMULINK:
SimPowerSystems
Electrical elements: Linear and saturable transformers;
arrestors and breakers; and transmission line models
MATLAB SIMULINK:
SimPowerSystems
Three-phase components: RLC loads and branches; breakers
and faults; pi-section lines; voltage sources; transformers;
synchronous and asynchronous generators; and motors,
analyzers, and measurements
Electric Drives and Other Application Libraries
46
MATLAB SIMULINK:
SimPowerSystems
47
MATLAB SIMULINK:
SimPowerSystems
48
MATLAB SIMULINK:
SimPowerSystems
49
MATLAB SIMULINK:
SimPowerSystems
50
MATLAB SIMULINK:
SimPowerSystems
51
MATLAB SIMULINK:
SimPowerSystems
52
MATLAB SIMULINK:
SimPowerSystems
53
54
Ref: http://www.itu.dk/stud/speciale/segmentering/Matlab6p5/help/toolbox/powersys/tut_ch12.html#5518
55
Ref: http://www.itu.dk/stud/speciale/segmentering/Matlab6p5/help/toolbox/powersys/tut_ch13.html
56
Additional References
http://www.mathworks.in/products/simpower/
http://www.mathworks.in/products/simpower/examples.html
SimPowersystems Tutorial:
http://www.itu.dk/stud/speciale/segmentering/Matlab6p5/help/toolbox/power
sys/tut_ch1.html
57
Thank you
58