32
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-lec13- simulink

Embed Size (px)

DESCRIPTION

awesome

Citation preview

Page 1: 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)

Page 2: MECH610-lec13- simulink

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

Page 3: MECH610-lec13- simulink

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

Page 4: MECH610-lec13- simulink

Interactive Simulink Tutorial http://www.mathworks.com/academia/student_center/tutorials/sltutorial_launchpad.html

Page 5: MECH610-lec13- simulink

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.

Page 6: MECH610-lec13- simulink

ttty 2sinsin2)( Example: Task:

The Simulink program

The results:

Page 7: MECH610-lec13- simulink

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:

Page 8: MECH610-lec13- simulink

Features of the Simulink(2) There are a huge collections of these graphical blocks (Library), such as “Continuous”; “math Operations”; “Sinks”; “Sources”, “signal Routing”

Page 9: MECH610-lec13- simulink

Features of the Simulink(3) The graphical block must be linked logically according to the specified task or the physical problem .

Page 10: MECH610-lec13- simulink

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.

Page 11: MECH610-lec13- simulink

(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.

Page 12: MECH610-lec13- simulink

We will use following typical Simulink Libraries:Continuous: This library includes some typical signal analysis tools, such as “Integrator”, “Transfer Function”

Page 13: MECH610-lec13- simulink

We will use following typical Simulink Libraries:Math Operations: This library includes some typical mathematic operation tools, such as “Add”, “Gain” ; “Product”

Page 14: MECH610-lec13- simulink

We will use following typical Simulink Libraries:Signal Routing: This library includes some typical signal channel tools, such as “Mux”, “Switch”

Page 15: MECH610-lec13- simulink

We will use following typical Simulink Libraries:Sink: This library includes some typical signal display tools, such as “Scope”, “XY Graph”

Page 16: MECH610-lec13- simulink

We will use following typical Simulink Libraries:Sources: This library includes some typical signal generating tools, such as “Sine wave, “Signal generator”

Page 17: MECH610-lec13- simulink

(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.

Page 18: MECH610-lec13- simulink

(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.

Page 19: MECH610-lec13- simulink

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.

Page 20: MECH610-lec13- simulink

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

Page 21: MECH610-lec13- simulink

ttty 2sinsin2)( Example 1: Task:

The Simulink program

The results:

Page 22: MECH610-lec13- simulink

Example 2: Task:

The Simulink program

The results:

2)0(10)(5.)(020)()(2

xtxtxtxtx

:condition Initial

Page 23: MECH610-lec13- simulink

2)0(10)(5.)(020)()(2

xtxtxtxtx

:condition Initial

Page 24: MECH610-lec13- simulink

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

Page 25: MECH610-lec13- simulink

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

Page 26: MECH610-lec13- simulink

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

Page 27: MECH610-lec13- simulink

Example 3: 0,1;0)(,200,2,1

)(1)(

00

xxtFkcm

tFkxxcm

xtFkxxcxm

Page 28: MECH610-lec13- simulink

Example 4:

5.1,0);100sin(5.1)(,200,4,1

)(1)(

00

xxttFkcm

tFkxxcm

xtFkxxcxm

Page 29: MECH610-lec13- simulink

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

Page 30: MECH610-lec13- simulink

Example 5:

1 1t0

force Step

ttf

sssFsXsTtfxxx

i

ii

1000

)(

1001

)()()()(100 2

:is funtiontransfer The :is motion of equation The

Page 31: MECH610-lec13- simulink

Example 6:

ttfsssF

sXsTtfxxx

i

ii

3sin2)(100

1)()()()(100 2

:is funtiontransfer The :is motion of equation The

Page 32: MECH610-lec13- simulink

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.