Académique Documents
Professionnel Documents
Culture Documents
Tutorial 1
CPE562
Week 1
Introduction to Simulink
Familiarization with Simulink blocks
Sources: Constants
Sinks: Display
Operations: Sum, Product, Add, Divide.
Mathematical operations involving blocks for sources, sinks and operations.
Operations
Sources
Sinks
Constant
sum
Display
1
Constant1
Divide
1
Constant2
Tutorial
1. Prepare and run simulink block for the following:
a.
1 + 2 =
b.
2/3 + 4/5 =
c.
d.
4/(9-5/6) + 3/(8/5-2) =
Homework
2. Prepare and run simulink block for the following problems.
a.
Reynold number
Dv
where,
N=
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
b.
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 molK).
c.
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
Simulink
Tutorial 2
CPE562
Week 2
Sources
Operations
Sinks
1
Constant
Ramp
0
sum
Divide
Scope
e
Step
Display
Math
Function
f(u)
Fcn
Tutorial
1. Prepare and run simulink block for the following:
a.
b.
c.
d.
e.
f.
g.
h.
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
Homework
1. Study the effect of D , v , , and to Reynold number, N.
Reynold number is given by
Dv
Starting data:
N=
Study the effect V to p when the value of V is doubled until V = 1.1648 m/s.
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
Simulink
Tutorial 2
CPE562
Week 3
Operation
Sink
f(u)
Ramp
Fcn
Mux
Scope
Demux
Tutorial
1. Prepare and run simulink block for the following:
slope = 1
Ramp1
slope = -1
Scope
Mux
Ramp2
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
Result
Ramp1
Scope1
slope = -1
Mux
Ramp2
Demux
Scope2
After running, observe Scope1 and Scope2. What can you conclude?
Homework
1. Prepare an innovative simulink program to calculate the following heat capacity problem.
Observe the effect of Cp when T is doubled and tripled. You may need other blocks that
you had learned last week in order to solve this problem.
The following problem is taken from Himmelblau p.533 (1982, 6th Ed.).
For air Cp is in Btu/(lbmol-F) where T is in F.
Cp = 6.9 + 0.02884 x 10-2 T + 0.02429 x 10-5 T 2 -0.08052 x 10-9 T 3
For these compounds Cp is in J/(gmol-C) and T is in C.
SO2: Cp = 38.91 + 3.904 x 10-2 T - 3.104 x 10-5 T 2 + 8.606 x 10-9 T 3
SO3: Cp = 48.50 + 9.188 x 10-2 T - 8.540 x 10-5 T 2 + 32.40 x 10-9 T 3
O2: Cp = 29.10 + 1.158 x 10-2 T - 0.6076 x 10-5 T 2 + 1.311 x 10-9 T 3
N2: Cp = 29.00 + 0.2199 x 10-2 T - 0.5723 x 10-5 T 2 - 2.871 x 10-9 T
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
2. Observe the effect of changing power index from 0.5 to 1.5 for every 0.5 increment of the
following relationship:
y = x0.5
.......... (1)
y = x1.0
.......... (2)
y = x1.5
.......... (3)
Sample of solution.
u(1)^0.5
Ramp
Fcn
Scope
u(1)^1
Fcn1
u(1)^1.5
Fcn2
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
Simulink
Tutorial 4
CPE562
Week 6
Tutorial
1. Compare y = x2 and y = x3 graphically. Copy the plot to MSWORD.
2. Prepare and run simulink block for the following:
Source
Operation
Sink
x
To Workspace1
u[1]^3
Clock
Fcn
Scope
y
To Workspace
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]^3
7. 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.
Abdul Aziz Ishak, Faculty of Chemical Engineering, Universiti Teknologi MARA Malaysia (2009)
11.
1000
900
800
700
600
Y
y = x3
500
400
300
y = x2
200
100
0
5
X
10
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)