Simulink Basics
Simulink Basics
Simulink is a graphical tool used in MATLAB for modeling and simulation of control systems.
You can simulate a control system with different inputs and obtain the respective outputs. You can
simulate linear control systems as well as non-linear control systems. In addition, you may apply
for systems where initial conditions are non-zero where we assumed them to be zero in many cases.
To use Simulink, you can do the following steps.
1. Start MATLAB.
2. Press “New” in the “Home” menu and click Simulink Model as shown in Fig 1.
3. Then, a blank window will appear as shown in Fig 2.0. Save it as “block1”.
1
4. Press Simulink Library and a new window will appear. (Refer Fig. 1.)
5. In the Simulink Library Browser, select “Sources” in the new window. (Refer Fig. 1.)
6. From “Sources”, you can select the input. For this work, you can select a step input.
(Refer Fig. 3.)
2
8. Drag the “step” icon into the block1 window.
9. In the Simulink Library Browser, select “Continuous” in the new window. By selecting
“Continuous”, you can select a continuous function in the s-domain. For this work, you
can select “Transfer Fcn” icon. (Refer Fig. 4.)
10. The default transfer function in this case is 1/(𝑠 + 1).
11. Drag the “Transfer Fcn” icon into the block1 window. You can change the default
parameters by double clicking “Transfer Fcn” icon. In this case, let’s keep the default
function.
3
18. To see the output result, you can double click the scope.
19. For the “Test No” 01 given in table 01, you will get the output view that can adjusted by
clicking the “Autoscale” button (Refer Fig. 8(a) and Fig. 8(b).
20. You can get the same results by replacing the source block “Step” by the “Constant” block
in the Simulink library since time required to change the step is given as 0 (Refer Fig. 9).
“Constant” block can give only a constant value as an input, but cannot change the value
as a step change as in “Step” block during run time.
4
Fig. 8(a): view before auto scaling Fig. 8(b): view after auto scaling
21. You can give different inputs by changing the settings values of “Step” block. Try using
the values given in Table 01 and simulate the results.
22. To change the transfer function, you can edit the “Transfer Fcn” block. When you double
click it, you can see the current view. For the numerator the default value is [1] which refers
to “1” and for the denominator is [1 1] which refers to “s+1”. This is similar to giving
polynomial’s coefficients in the command prompt in MATLAB.
5
23. For example, if you want to give the transfer function
𝑠+2
𝑇(𝑠) =
2𝑠 + 3𝑠 + 5
You can give the coefficients by editing the “Transfer Fcn” block as shown in Fig. 10.
24. When you change the values and return the block, it will appear in the window as shown
in Fig.11.
6
25. Close the “Scope” block and run Simulink. When you open the “Scope” block with auto
scale, it will appear as shown in Fig. 12.
30. Now run the Simulink and it should appear as shown in Fig. 15. Compare your output
results using “Scope” and “XY Graph”. In using “Scope”, X axis is always the time axis,
but using “XY Graph”, you can plot the graph of the outputs of any two blocks.
7
Fig 14: Setting XY parameters to suit the output result