Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
An introductory tutorial
Engineering Software Lab 2013
Launch Matlab
Launch Simulink
In the MATLAB command window,
at the >> prompt, type simulink and press Enter
Your workspace
Library of elements
x 3sin 2t
Simulation diagram
Input is the forcing function 3sin(2t)
Output is the solution of the differential
x(0) 1
equation x(t)
3sin(2t)
(input)
1
s
x(t)
(output)
integrator
Simulation results
To verify that this plot
represents the solution to the
problem, solve the equation
analytically.
The analytical result,
x(t ) 12 32 cos2t
Example 2
Build a Simulink model that solves the
following differential equation
2nd-order mass-spring-damper system
zero ICs
input f(t) is a step with magnitude 3
parameters: m = 0.25, c = 0.5, k = 1
mx cx kx f (t )
mx cx kx f (t )
(continue)
First, solve for the term with highest-order
derivative
mx f (t ) cx kx
Make the left-hand side of this equation
the output of a summing block
mx
summing
block
(continue)
Add a gain (multiplier) block to eliminate
the coefficient and produce the highestderivative alone
mx
summing
block
1
m
(continue)
Add integrators to obtain the desired
output variable
mx
summing
block
1
m
1
s
1
s
(continue)
Connect to the integrated signals with gain blocks
to create the terms on the right-hand side of the
EOM
mx
summing
block
1
m
cx
1
s
kx
1
s
c=0.5
k=1.0
mx 1
m
cx
kx
1
s
1
s
c
k
x(t)
output
Results
Underdamped response.
Overshoot of 0.5.
Final value of 3.
Is this expected?
Paper-and-pencil analysis
based on the equations of motion
Standard form
x
k
Natl freq.
Damping ratio
Static gain
c
1
x x f (t )
k
k
k
n
2.0
m
2
0.5
n k
K
1
1
k
Static gain is 1.
Expect output magnitude to equal input magnitude.
Input has magnitude 3, so does output.