How To Use Simulink For Lab 6
How To Use Simulink For Lab 6
Page | 1
3- Go to Simulink Library
4- A simulink library browser as shown below will pop out. Here, in simulink library browser, tools
and component (s) to be used in simulation can be picked.
Page | 2
5- Next to implement below type of system in simulink.
1
6- First, we will find transfer function as shown in above system. Go to simulink library
s + 2s + 3
2
browser, search for “Transfer fcn”. Drag the block to the simulink model (at right side of the
window)
Page | 3
7- Change value of the”Transfer fcn” block by double clicking at it. Insert new value(s) so that it
follow the denominator of your transfer function.
1
8- In the system “ ” refer to integrator, search for integrator inside simulink library browser.
S
Page | 4
9- Continuously add other elements for the block diagram.
a. Summing junction = add
• You may change to add or to subtract (+ve or –ve), by double clicking it.
b. Step input = Step
c. Workspace = data container after you run the simulation
• Make sure you save format in “array ” form by double clicking at it.
d. clock = Clock block outputs the current simulation time at each simulation step. This
block is useful for other blocks that need the simulation time.
e. Gain = Gain block multiplies the input by a constant value (gain)
Page | 5
10- Connect all the related element so that it will resemble the original system.
11- Change block name to “t_out” for time output & “simout” for simulation output so that this will
help you to understand during data extraction and graph interpolation.
Page | 6
12- After completing the connection, run the simulation by pressing start simulation button on top
of the toolbar.
13- You can generate step response graph using the data stored in your workspace by executing
below command in matlab or in the m-file.
Page | 7
Output that you will get as below :
2.5
Amplitude
1.5
0.5
0
0 1 2 3 4 5 6 7 8 9 10
Time
Page | 8