1. Trang chủ
  2. » Công Nghệ Thông Tin

getting started with simulink

36 325 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 36
Dung lượng 732 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Select an input blockDrag a Sine Wave block from the Sources library to the model window... Select an operator blockDrag an Integrator block from the Continuous library to the model wind

Trang 1

Getting started with Simulink

An introductory tutorial

ES205 Analysis and Design of Engineering Systems

Rose-Hulman Institute of Technology

© R Layton 2001

Trang 2

 Dial 6000 and say "Help Desk"

 Visit the TSC in Crapo Hall, Room G-139

 E-mail to helpdesk@rose-hulman.edu

Trang 3

Launch Matlab

Application explorer (ZENworks)

 [All]  Matlab 5.3

Trang 4

Launch Simulink

In the MATLAB command window,

at the >> prompt, type simulink

and press  Enter

Trang 5

Create a new model

 Click the new-model

icon in the upper left

corner to start a new

Trang 6

Your workspace

Library of elements Model is created in this window

Trang 7

Save your model

 You might create a new folder, like the one shown below, called simulink_files

 Use the mdl suffix when saving

Trang 8

Example 1: a simple model

 Build a Simulink model that solves the differential equation

0 ( = −

x

Trang 9

Simulation diagram

Input is the forcing function 3sin(2t)

 Output is the solution of the differential

0 ( = −

x

integrator

Trang 10

Select an input block

Drag a Sine Wave block from the Sources library

to the model window

Trang 11

Select an operator block

Drag an Integrator block from the Continuous library

to the model window

Trang 12

Select an output block

Drag a Scope block from the

Sinks library to the model window

Trang 13

Connect blocks with signals

 Place your cursor on

the output port (>) of

the Sine Wave block

 Drag from the Sine

Wave output to the

Integrator input

 Drag from the

Integrator output to

the Scope input Arrows indicate the

direction of the signal flow.

Trang 14

Select simulation parameters

Trang 15

Select simulation parameters

Trang 16

Select simulation parameters

Double-click on

the Scope to view

the simulation

results

Trang 17

Run the simulation

Trang 18

Simulation results

To verify that this

plot represents the

solution to the

problem, solve the

equation analytically

The analytical result,

matches the plot

( )t t

x( ) 23 cos 2

2

=

Trang 19

x c x

m  +  + =

Trang 20

Create the simulation diagram

 On the following slides:

 The simulation diagram for solving the ODE

is created step by step

 After each step, elements are added to the Simulink model

 Optional exercise: first, sketch the

complete diagram (5 min.)

= +

+

Trang 21

c t

f x

m  = ( ) −  −

x

m 

Trang 22

Drag a Sum block from the Math library

Double-click to change the

block parameters to

Trang 23

 Add a gain (multiplier) block to

eliminate the coefficient and produce the highest-derivative alone

Trang 24

Drag a Gain block from the Math library

Double-click to change the

block parameters.

The gain is 4 since 1/m=4.

Trang 26

Drag Integrator blocks from the Continuous library

Add a scope from the Sinks library.

Connect output ports to input ports.

ICs on the integrators are zero.

Trang 27

 Connect to the integrated signals with gain blocks to create the terms on the right-hand side of the EOM

kx

Trang 28

Drag new Gain blocks from the Math library

 Double-click on gain blocks to

set parameters

 Connect from the gain block

input backwards up to the

Trang 29

Complete the model

 Bring all the signals and inputs to the

Trang 30

Double-click on Step block

to set parameters For a step input of magnitude 3, set Final value to 3

Trang 31

Final Simulink model

Trang 32

Run the simulation

Trang 33

Underdamped response Overshoot of 0.5.

Final value of 3.

Is this expected?

Trang 34

t

f k

x

x k

c m

k

x

= +



5 0

Trang 35

Check simulation results

 Damping ratio of 0.5 is less than 1

 Expect the system to be underdamped.

 Expect to see overshoot.

 Static gain is 1

 Expect output magnitude to equal input

magnitude.

 Input has magnitude 3, so does output.

 Simulation results conform to expectations

Trang 36

End of tutorial

Ngày đăng: 24/10/2014, 23:41

TỪ KHÓA LIÊN QUAN