Professional Documents
Culture Documents
Matlab Demo 3
Model Description
This Matlab Demo follows the solution to one of the case studies in Lecture 4, i.e., heating
(mixing) tank where a hot and cold stream are mixed. The complete discussion on how to
obtain the model including the required assumptions can be found in the Lecture 4 – Problem
1 and Solution for Matlab Demo 3. The heating/mixing tank model is given by
( dTdt )=F C (T −T )+ F C (T −T )
{
MCp 1 p 1 2 p 2
d F1 1
= ( F 1, spec −F1 )
dt τv
dTs 1
= ( T −T s )
dt τ Ts
The notations appearing in the model above can be found in the Lecture 4 – Problem 1 and
Solution for Matlab Demo 3. For the specifications on inputs are as: F́ 1=5 kg /s, F́ 2=5 kg /s,
T́ 1=25o C, T́ 2=75o C, the corresponding steady-state values of the outputs are:
x 0=[ T́ , T́ s , F́ 1 ]= [ 50 , 50,5 ]
Objectives
To build a Matlab Simulink Simulator for the heating/mixing tank described in
Lecture 4 Problem 1.
To explore the dynamics of the heating/mixing tank when the inputs are changed.
Demo Instructions
1. Write a m-file corresponding to the ordinary differential equations (model) given above.
A sample m-file for this purpose is given below. Edit the given sample m-file to suit for
your heating tank model.
1
2. Write a s-function m-file to link the m-file describing the dynamic model to the Simulink.
Edit (see the spaces marked with ??) the sample s-function m-file given to suit the heating
tank model.
2
4. Explore the effects of changing:
a. F 1, spec from 5 kg /s to 7.5 kg / s while keeping other inputs at their constant
baseline values.
b. F 2 from 5 kg /s to 7.5 kg / s while keeping other inputs at constant baseline values.
c. T 1 from 25 ❑oC to 40 ❑oC while keeping other inputs at constant baseline values.
d. T 2 from 75 ❑oC to 90 ❑oC while keeping other inputs at constant baseline values.
Give comments on the impacts of the input changes on the observed outputs. Which input has
the strongest effect on T and which one has the weakest effect on T?