Lab - Introduction To Simulink
Lab - Introduction To Simulink
INTRODUCTION TO SIMULINK
• Simulink is an extension to MATLAB, used for
modeling, simulation and analysis of
multidomain dynamic systems.
– block-diagram notation;
– build model of systems;
– visual simulation for understanding of systems
behavior;
• Program codes -> arrange blocks in Simulink
• Includes continuous, discrete, non-linear components.
• It is suitable for industrial applications.
• Simulink blocks:
= +
• Block diagram model for the pulse function.
• Basic blocks for linear continuous systems:
1. Gain block
output input
ykx
e.g. linear spring
2. Sum block
output input input
c a b
3. Derivative block
dx
y Y ( s) s X ( s)
dt
4. Integrator block
t
y (t ) x( ) d y (t0 ) 1
Y ( s) X ( s)
t0 s
2
• Example: d x
m 2 B
dx
Kx 0
dt dt
mx Bx Kx 0
B K
x x x
m m
• m = 3 kg - mass
• B = 1 Ns/m - damping coefficient 1 2
• K = 2 N/m – spring constant x x x
• Initial condition x(0) = 4 m. 3 3
1 2
x x x
3 3
Don’t forget to include the initial condition for the second integrator: x(0) = 4 m.
• Example: system with the same parameters as
in the previous example, and with an external
force added.
2
d x dx
m 2 B Kx F
dt dt
mx Bx Kx F
B K 1
x x x F
m m m
• F=2N
1 2 1
x x x F
3 3 3
1 2 1
x x x F
3 3 3
• Example: The previous problem can be solved
by using the transfer function block (initial
conditions are zeros).
ms X (s) BsX ( s) KX ( s) F ( s)
2
Bs K X (s) F (s)
ms 2
1 1
X ( s) m 3
G( s)
F ( s) s 2 B s K 1
s s
2 2
m m 3 3
Thank you.
Questions?