simulink tutorial

Upload: nrl-nbl-rmln

Post on 15-Oct-2015

6 views

Category:

Documents


0 download

DESCRIPTION

tutorial matlab

TRANSCRIPT

MATLAB

MATLAB

Tutorial 1

1. Write a program to calculate

a. Area of a circle

b. Reynold number

where,

D = 2 in. , v = 10 ft/s , ( = 62.4 lb/ft3 , ( = 0.3 lb/(hr(ft)

c. Heat capacity

Cp = 6.945 + 10.01 x 10-3 T 3.794 x 10-6 T2

when T = 400 K. Cp has the unit of cal/(g mol(K).

2. Prepare an innovative program to calculate the following heat capacity problem using function block (Fcn).

Cp = 6.9 + 0.02884 x 10-2 T + 0.02429 x 10-5 T 2 -0.08052 x 10-9 T 3Tutorial 2Introduction Familiarization with Simulink blocks

Sources: Constants, Step, Ramp.

Sinks: Display, Scope

Operations: Sum, Product, Add, Divide, Math functions, Special functions.

Signal processing blocks: Mux and Demux.

Data saving blocks: To Workspace.

Data saving at Matlab command window.

Mathematical operations involving blocks for sources, sinks, operations and data saving blocks and data saving at Matlab command window.

Tutorial 31. Prepare and run simulink block for the following:

Result

2. Prepare and run simulink block for the following:

3. Prepare simulink block for the following:

i) Set simulation parameters to 600.

ii) Run the simulation.

iii) Plot PV vs time in command windows.

>> plot(time,PV)

Tutorial 4

Familiarization with Simulink blocks

Sources: Constants, Step, Ramp, Digital clock.

Sinks: Display, Scope

Operations: Sum, Product, Add, Divide, Math functions, Special functions.

Signal processing blocks: Mux and Demux.

Data saving blocks: To Workspace.

Data saving & plot at Matlab command window.

Mathematical operations involving blocks for sources, sinks, operations and signal splitting.1.Compare y = x2 and y = x3 graphically. Copy the plot to MSWORD.

2. Prepare and run simulink block for the following:

3.Set To Workspace, To Workspace1 data saving format to Array and variable name to y and x respectively.

4.Run the program for Fcn u[1]^2 first.

5.At Matlab command window type >> plot(x,y)

6.Run the program for Fcn u[1]^37. At Matlab command window type >> figure(2), plot(x,y)

8.Copy line plot from Figure 2 to Figure.

9.At Figure, click Edit ( Copy Figure

10.Open MSWORD and paste.

11.

12.Get your self acquainted with all command in Figure (File, Edit, View, etc.) esp. Property Editor to label x, y axes and Text Arrow to label line plots.

Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)

_1308491376.unknown

_1308491436.unknown