10 Simulink
10 Simulink
What is Simulink?
• Simulink is a tool for modeling, simulating and
analyzing dynamic systems.
• Its primary interface is a graphical block
diagramming tool and a customizable set of block
libraries.
• It supports linear and nonlinear systems, modeled
in continuous time, discrete time, or a hybrid of
both.
• It easily integrates with the rest of the MATLAB
environment.
• Simulink is widely used in control theory and
digital signal processing for simulation and
model-based design.
Copyright © Dr. Mohammed Hawa Electrical Engineering Department, University of Jordan 2
1
3/30/2015
Starting Simulink
• To build a
Simulink model,
choose File | New
| Model.
• To see the
Simulink library
of blocks click on
the Simulink icon
in MATLAB.
2
3/30/2015
3
3/30/2015
Scope Results
• Double click on the
scope block to see the
results of the
simulation.
• To view/edit the
parameters of a block,
double click on the
block to see the Block
Parameters window.
• Try changing the initial
condition of the
Integrator from 0 to -1.
4
3/30/2015
Exercise: Modulation
Blocks:
• Sources: Repeating
Sequence
• Sources: Since Wave
• Math Operation: Product
• Math Operation: Gain • Sine Wave:
• Sinks: Scope • Frequency: 50 rad/s
Edit the following properties: • Sample time: 0.01
• Repeating Sequence: • Gain: 2
– Time Values: [0 1 2 3 4 5 6] • Simulation Stop Time:
– Output Values: [0 1 1 0 -1 -1 0] • 12 seconds
Results
5
3/30/2015
Specify the Save format as Array. Use the default values for
the other parameters (these should be inf, 1, and -1 for
Maximum number of rows, Decimation, and Sample time,
respectively). Click on OK.
Copyright © Dr. Mohammed Hawa Electrical Engineering Department, University of Jordan
6
3/30/2015
Result
20
18
16
14
12
10
0
0 2 4 6 8 10 12 14
7
3/30/2015
= dy/dt
dy/dt
8
3/30/2015
Result
Homework
• Solve as many problems from Chapter 10
as you can
• Suggested problems:
• Solve: 10.1, 10.3, 10.4.