Simulink Tutorial
Simulink Tutorial
2nd order mass-spring-damper 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
m x cx kx f (t )
The simulation diagram for solving the ODE is created step p by y step. p After each step, elements are added to the Simulink model. model
m x cx kx f (t )
(continue)
First, solve for the term with highestorder derivative m x f (t ) cx kx Make the left-hand side of this equation the h output of f a summing i block bl k
m x
summing block
(continue)
Add a gain (multiplier) block to eliminate the coefficient and produce g alone the highest-derivative
m x
summing i block
1 m
(continue)
1 m
1 s
1 s
Add a scope from the Sinks library. Connect output ports to input ports. Label the signals by double-clicking on the leader line line.
(continue)
Connect to the integrated signals with gain bl k to blocks t create t th the t terms on th the right-hand i ht h d side of the EOM
m x
summing bl k block
1 m
x cx
kx
1 s
c
1 s
Double-click Double click on gain blocks to set parameters Connect from the gain block input backwards up to the branch point. Re-title the gain blocks.
c=0.5
k=1.0
Bring all the signals and inputs to the summing i block. bl k Check signs on the summer.
+ -
f(t) input
m x 1 m
x cx kx
1 s
c
x x k
1 s
x(t) output
Double-click on Step block to set parameters. For a step t i input t of f magnitude it d 3 3, set Final value to 3
Results
x m
1 c x x f (t ) k k
k n 2.0 m c 0.5 n k K
1 1 k 2
Expect the system to be underdamped. Expect p to see overshoot. Expect output magnitude to equal input magnitude. Input has magnitude 3, 3 so does output. output
Static gain is 1.
End of tutorial