MECH610-lec13- simulink
-
Upload
andersone5 -
Category
Documents
-
view
22 -
download
2
description
Transcript of MECH610-lec13- simulink
Exam 2 for chapter 3
There will be the second exam on 03/06/2014 during our normal lecture hours. •It will cover the chapter 3 and the Simulink.•It is open note exam.
– Concept questions (30 points)– Calculation question (50 points)– Simulink question (20 points)
MECH610-Mechanical Vibration, spring 2014
Lecture #14: Introduction to Simulink
Dr. Xiaobin Le, P. EngDepartment of Electronics & Mechanical
Wentworth Institute of TechnologyOffice: Kingman hall 209
Email: [email protected]: 989-4223
ContentsA.What is Simulink?B.The Simulink interfacesC.Applications of the Simulink (1) The simple models
– Add two signals– A simple integration problem
(2) Mass-spring models– Mass-spring system with initial condition – Mass-spring system with initial condition and external
force (harmonic force and step force)(3) The mass-spring model with transfer functions
– Mass-spring system by using transfer functionD. Summary Hw# 9
Interactive Simulink Tutorial http://www.mathworks.com/academia/student_center/tutorials/sltutorial_launchpad.html
A: What is Simulink?Simulink, developed by MathWorks, is a data flow graphical programming language tool for modeling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries.•Simulink is a graphical, “drag and drop” environment for building simple and complex signal and system dynamic simulations.•It allows users to concentrate on the structure of the problem, rather than having to worry (too much) about a programming language.•The parameters of each signal and system block is configured by the user (right click on block)•Signals and systems are simulated over a particular time.
ttty 2sinsin2)( Example: Task:
The Simulink program
The results:
Features of the Simulink(1) Simulink is very similar to the Labview. In Simulink, every graphical block represents a mathematic model or one element with a specified functions. There are a huge collections of these graphical blocks (Library) Examples:
Features of the Simulink(2) There are a huge collections of these graphical blocks (Library), such as “Continuous”; “math Operations”; “Sinks”; “Sources”, “signal Routing”
Features of the Simulink(3) The graphical block must be linked logically according to the specified task or the physical problem .
B: Simulink interfacesB1: Access to the Simulink(1)You must launch the MATLAB first. After the “MATLAB” is open, clink the icon “Simulink Library” to open the Simulink Library Browser for entering the Simulink interface.
(2) After the “Simulink Library” is clicked, the “Simulink Library browser” appears. This is the Simulink interface, through which we can drag and drop the graphical blocks from different library to our Simulink program.
We will use following typical Simulink Libraries:Continuous: This library includes some typical signal analysis tools, such as “Integrator”, “Transfer Function”
We will use following typical Simulink Libraries:Math Operations: This library includes some typical mathematic operation tools, such as “Add”, “Gain” ; “Product”
We will use following typical Simulink Libraries:Signal Routing: This library includes some typical signal channel tools, such as “Mux”, “Switch”
We will use following typical Simulink Libraries:Sink: This library includes some typical signal display tools, such as “Scope”, “XY Graph”
We will use following typical Simulink Libraries:Sources: This library includes some typical signal generating tools, such as “Sine wave, “Signal generator”
(3) In the Simulink Library Browser”, you can “File”-> “open” to open a new or existing Simulink program, or click the icon “new model” to enter the Simulink program.
(4) After you enter the Simulink program interface, you can save it. Then you can drop the graphical blocks from different libraries into the program. Then you can logically link them according to the required task or functions to build a Simulation model.
B2: Model configuration parametersThe Simulink is actually a simulation program in which there are sets of model configuration parameters. There are lots of settings. We can change the stop time and the maximum time step. The general rule is there are at least 5 point for each cycle.
C: Applications of the Simulink
Simulink can be used to numerically simulate any physical models if the governing equations can be built and be expressed by a set of equations. These are just getting started with the Simulink. We will only show some simple examples and use the Simulink for mechanical vibration.
(1)The simple models– Add two signals– A simple integration problem
ttty 2sinsin2)( Example 1: Task:
The Simulink program
The results:
Example 2: Task:
The Simulink program
The results:
2)0(10)(5.)(020)()(2
xtxtxtxtx
:condition Initial
2)0(10)(5.)(020)()(2
xtxtxtxtx
:condition Initial
C: Applications of the Simulink (2) Mass-spring models
– Mass-spring system with initial condition – Mass-spring system with initial condition and
external force (harmonic force and step force)
force excitation externalconstant Spring
constant damping system theof mass
)(tFkcm
F(t)kx(t)(t)xc(t)xm :is motion of equation The
Four steps for building the differential equations
Step 1: Solve for the highest order deviation term
Step 2:add “integrator” blocks into the program. The number of “integrator” is equal to the highest order of the differential equation
)(1)( tFkxxcm
xtFkxxcxm
Four steps for building the differential equationsStep 3: construct the right-hand side of the equation according to the logical relations. Then add the display and the signal source of the external excitation force.
Step 4: Set the initial conditionsAdjust the range of simulation time and the time step when it is necessary.
00 )0(;)0( xxxx
Example 3: 0,1;0)(,200,2,1
)(1)(
00
xxtFkcm
tFkxxcm
xtFkxxcxm
Example 4:
5.1,0);100sin(5.1)(,200,4,1
)(1)(
00
xxttFkcm
tFkxxcm
xtFkxxcxm
C: Applications of the Simulink (3) The mass-spring model with transfer functions
– Mass-spring system by using transfer function
kcsmssFsXsT
tftkxtxctxm
i
i
2
1)()()(
)()()()(:is funtiontransfer The
:ismotion ofequation The
Example 5:
1 1t0
force Step
ttf
sssFsXsTtfxxx
i
ii
1000
)(
1001
)()()()(100 2
:is funtiontransfer The :is motion of equation The
Example 6:
ttfsssF
sXsTtfxxx
i
ii
3sin2)(100
1)()()()(100 2
:is funtiontransfer The :is motion of equation The
D: Summary 1)The Simulink is a graphical program, in which the basic elements of the language are different graphical blocks. Each block represents different functions and can be linked logically to represent any physical models. If the physical models can be represented by sets of governing equations, they can be simulated in the Simulink. 2)It is easy to start the Simulink, But you need to take long time to become a master of the Simulink.