Lab02 Simulink Tutorial
Lab02 Simulink Tutorial
An introductory tutorial
ES205 Analysis and Design of Engineering Systems Rose-Hulman Institute of Technology
R. Layton 2001
Before we start
You should have network access to software through Application Explorer on your desktop. If not, contact the Technical Services Center (TSC):
Help Desk at 877-8989 Dial 6000 and say "Help Desk" Visit the TSC in Crapo Hall, Room G-139 E-mail to helpdesk@rose-hulman.edu
Launch Matlab
Application explorer (ZENworks) [All] Matlab 5.3
Launch Simulink
In the MATLAB command window, at the >> prompt, type simulink and press Enter
Your workspace
Library of elements Model is created in this window
Simulation diagram
Input is the forcing function 3sin(2t) Output is the solution of the differential x(0) = 1 equation x(t)
x &
1 s integrator
3sin(2t) (input)
x( t ) (output)
Simulation results
To verify that this plot represents the solution to the problem, solve the equation analytically. The analytical result,
3 x(t ) = 1 2 2 cos(2t )
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
(continue)
First, solve for the term with highestorder derivative m& x & = f (t ) cx & kx Make the left-hand side of this equation the output of a summing block
m& x &
summing block
(continue)
Add a gain (multiplier) block to eliminate the coefficient and produce the highest-derivative alone
m& x &
1 m
x & &
summing block
(continue)
Add integrators to obtain the desired output variable
m& x &
1 m
x & &
1 s
x &
1 s
summing block
Add a scope from the Sinks library. Connect output ports to input ports. Label the signals by double-clicking on the leader line.
(continue)
Connect to the integrated signals with gain blocks to create the terms on the right-hand side of the EOM
m& x &
1 m
1 s
c
x &
1 s
summing block
kx
c=0.5 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.
k=1.0
m& x & 1 m
1 s
c
x & x &
k
1 s
x(t) output
Double-click on Step block to set parameters. For a step input of magnitude 3, set Final value to 3
Results
Paper-and-pencil analysis based on the equations of motion Standard form Natl freq. Damping ratio Static gain
x & & k m c 1 + x + x = f (t ) & k k
k n = = 2.0 m c = = 0.5 n k K= 1 =1 k 2
Static gain is 1.
Expect output magnitude to equal input magnitude. Input has magnitude 3, so does output.
End of tutorial