Sie sind auf Seite 1von 58

EE 4073

Computer Aided Design and Simulation


SECTION II - LECTURE 2

SYSTEMS MODELING AND


SIMULATIONS
By
Dr. Buddhika Jayasekara

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

Assessment criteria of the module: 70% from the final


exam + 30% from the assignments
2

SECTION II - LECTURE 2
Basic simulations simulink

Data capturing- from simulink models


State-space models

S-domain analysis basics


Power System Simulations
Introduction to Simpower systems

MATLAB SIMULINK

Simulink
Environment

Different components under


each toolbox or block set
Can go to those sub-classes
and you will handle
individual components under
that particular model

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

You can save data from the scope to


the workspace using the Parameters,
Data History tab

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.

You can change the default


comments under the blocks by
double clicking and editing the
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.

A summer block can be found in


the commonly used blocks
library, and in the math library.
To change the shape of the
summer to rectangular, or to add
additional inputs or change the
sign, double click on the summer.
You can flip a block over by right clicking
and looking under Format, or by selecting
it and typing CTRL-i
14

MATLAB SIMULINK:
Signal Routing

Under the signal routing library,


the MUX block can be used to
bundle a group of signals
together into a single line.

The DEMUX block does the


reverse.

15

MATLAB SIMULINK:
Transfer Functions

You set the transfer function numerator and


denominator polynomials by double-clicking
on the transfer function block.

16

MATLAB SIMULINK:
Transfer Functions

17

MATLAB SIMULINK:
Integrators and Derivatives

Integrators and derivatives are available in


the continuous library

18

MATLAB SIMULINK:
Closed Loop Control System

19

MATLAB SIMULINK:
Subsystems

20

MATLAB SIMULINK:
Setting Up Systems- A Nonlinear System

If you have a nonlinear equation system, you cant describe it


with a transfer function. One option is to put all of the
21
operations in as individual blocks

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.

Double click the Scope


Go to the Parameters
Move to Data History
Select the Save data to workspace
Give a name to the variable (in this example
A) and change the Format to Array
6. Go to the Matlab command window
7. Copy data to a matrix

>> 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

STATE SPACE MODELS


model a dynamic system
State Space Modeling in the Model Development Environment

y(n) = Cx(n) + Du(n)


x(n+1) = Ax(n) + Bu(n)

Step

Discrete State-Space

Scope

27

STATE SPACE MODELS


The block accepts one input and generates one output.
The number of columns in the B and D matrices determines
the input vector width.
The numbers of rows in the C and D matrices determine the
output vector width
n

D
28

STATE SPACE MODELS


E.g.

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

STATE SPACE MODELS


0
1
x1 0
x
0
0
2 0
x 3 0.5 0.5 0.5

0
x 4 0.5 0.5

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]

Note: here that you have to set the values,


selecting data history and clicking on save
data in the scope parameters to workspace
33

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

ANALYSIS IN THE S-DOMAIN


E.g. 1 - bring S-domain blocks from the continuous block-set

600
2

s3+14s +39s+70

Transfer Fcn

Scope

Step

transfer function

600
S 3 14S 2 39S 70

37

ANALYSIS IN THE S-DOMAIN


600
S 3 14S 2 39S 70

Assigning a variable name


and changing the Format
field to array, you can
import the data to the
command window
>> plot(A(:,1),A(:,2),'k',A(:,1),A(:,3));
>> grid on
>> xlabel('\fontsize{16} Time [s]');
>> ylabel('\fontsize{16} Amplitude');
38

ANALYSIS IN THE S-DOMAIN


Output of the System
1.6

1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

10

Time [s]

39

ANALYSIS IN THE S-DOMAIN


E.g. 2

Modified System Having a Feedback Loop

200
s3+14s2+59s+70
Step

Transfer Fcn

Scope

1
s+1
Transfer Fcn1

40

ANALYSIS IN THE S-DOMAIN


Output of the System
1.8
1.6

Amplitude

1.4
1.2
1
0.8
0.6
0.4
0.2
0

10

Time [s]
41

ANALYSIS IN THE S-DOMAIN


E.g. 3

Modified System Having a Feedback Loop Gain at 1/(20S+7)

80
s3+14s2+59s+70
Step

Transfer Fcn

Scope

1
20s+7
Transfer Fcn1

42

ANALYSIS IN THE S-DOMAIN

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

Include models of electrical power components, including


three-phase machines, electric drives, and components for
applications such as flexible AC transmission systems
(FACTS) and renewable energy systems
Harmonic analysis, calculation of total harmonic distortion
(THD), load flow, and other key electrical power system
analyses are automated

can be used to develop control systems and test system-level


performance
44

MATLAB SIMULINK:
SimPowerSystems
Electrical elements: Linear and saturable transformers;
arrestors and breakers; and transmission line models

Electric machinery: Models of synchronous, permanent


magnet synchronous, and DC machines; excitation systems; and
models of hydraulic and steam turbine-governor systems
Power electronics: Diodes, simplified and complex thyristors,
GTOs, switches, IGBT models, and universal bridges that allow
selection of standard bridge topologies
Control and measurement: Voltage, current, and impedance
measurements; RMS measurements; active and reactive power
calculations; timers, multimeters, and Fourier analysis; HVDC
control; total harmonic distortion; and abc-to-dq0 and dq0-to45
abc transformations

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

SimPowerSystems provides the following specialized


application libraries: Flexible AC Transmission Systems
(FACTS): Phasor models of flexible AC transmission systems
Distributed Resources: Phasor models of wind turbines
Electric Drives: Editable models of electric drives that
include detailed descriptions of the motor, converter, and
controller for each drive

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

Ex 1: simple electronic model

54

Ex 2: Simulating a Simple Power Circuit


The circuit below represents an equivalent power system feeding a 300 km
transmission line. The line is compensated by a shunt inductor at its receiving
end. A circuit breaker allows energizing and deenergizing of the line. In order
to simplify matters, only one of the three phases is represented. The parameters
shown in the figure are typical of a 735 kV power system.

Ref: http://www.itu.dk/stud/speciale/segmentering/Matlab6p5/help/toolbox/powersys/tut_ch12.html#5518
55

Ex 2: Simulating a Simple Power Circuit

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

Das könnte Ihnen auch gefallen