Week 2 Matlab solutions
Common mistakes to watch out for and hints to get good working code:
1. Incorrect initial conditions: Must be of form y0=[y10, y20, y30, y40]; Also when you
change to using concentrations as the state variables you need to update t

MATLAB week 12 Solutions
Parts 1 to 3
Driver:
%Driver File for LPG bullet problem
clear all
close all
%Parameters needed in driver:
roel = 507;
%kg/m3 - density of liquid propane
Dt = 4.5;
%m
Lt = 45;
%m
Patm = 1.013; 'ar
%Set Initial Condition
fill_frac

Week2: Liquid-Liquid Extractor- Part1
This weeks MATLAB tutorial will introduce a system that we will work through in several of the
tutorials through this semester. Make sure that you keep your working codes from this week as they
will form the basis of

Matlab Week 9 Solutions: Extra info
For those who want to know more
On a number of occasions in the codes we have written this semester we have had to use global to
pass extra information into the function called by the ode solver. This is because the sp

Week 0 Tutorial solutions
Exercise 1
These can all be found by using help in matlab.
Exercise 2
> s=0.5; log(s^2-2*s*cos(pi/5)+1)
ans =
-0.8187
> s=0.95; log(s^2-2*s*cos(pi/5)+1)
ans =
-1.0069
> s=1; log(s^2-2*s*sin(pi/5)+1)
ans =
-0.1931
Exercise 3
A' is

Week 1 Tutorial solutions
Exercise 1
0river for exercise one
y0=10;
tspan=[0,2];
[t,y] = ode45(@exerciseOne,tspan,y0);
plot(t,y)
%plot results
hold on;
%hold the current plot window
c=10;
ets the constant for the analytical solution
k=5;
plot(t,c*exp(-k*t

MATLAB Week 11 Parameter Estimation
and data handling
Part 1 Single output linear parameter estimation
In earlier MATLAB sessions this semester we have been considering a liquid-liquid extractor.
The rate of mass transfer of A from the liquid (wastewat

Week 7 Distributed Parameter System
The Liquid-liquid extractor system previously considered in this course is now to be implemented as
a packed bed extractor with separator on the outlet. We will simplify the system for this tutorial and
only consider a

Week 6: Liquid-Liquid extractor- Part 2
In this tutorial we will further examine the Liquid-liquid extractor system we introduced in week 2. In
particular we will:
Learn how to evaluate the stiffness of a model in MATLAB and see its effect on the solutio

Week 1: Solving ODEs
This week we will take a further look at functions in MATLAB, and will begin to evaluate ODEs. This is
an important skill that will be needed for the project work later in the course.
As you work through the exercises make sure that

CHEE 3007: Week 10 Parameter
Estimation, Validation and Sensitivity
Analysis
This tutorial is an important one as it give you a framework to complete the modelling of
your experimental system.
Consider the isothermal liquid-liquid extractor system we h

Matlab Week 4 Melting Ice
In this tutorial we will implement the model of the ice melting that you developed in an earlier paper
tutorial.
Problem definition
An Ice cube is dropped in to a glass of water at room temperature and then stirred. The
mathemat

CHEE3007 Matlab exam 2014
Your task is to write a Matlab program to model the following system. Specific tasks to
be accomplished are listed on the final page.
The problem
A gas-liquid contactor is used to remove CO2 from the flue gas stream (a mixture of

CHEE 3007: MATLAB Week 10 Solutions
Exercise 1:
klaA = 0.000675 (CI: 0.000618 - 0.000731)
klaB = 0.000585 (CI: 0.000522 - 0.000649)
If the initial values are changed by small amounts then the same results are obtained. If
however a wildly inaccurate init

Week 6 MATLAB solutions
Exercise 1:
Execution time = 0.203 seconds
Number of steps taken = 65
System eigenvalue = -0.00158
System eigenvalue = -0.00129
System eigenvalue = -0.00038
System eigenvalue = -0.00038
Condition number = 4.191
This implies that t

Week 4 Status Update
By now, you should be able to construct, for any model, a reasonable:
o
o
o
o
o
o
o
Problem Definition (I/O/S/D, LPS/DPS, goal, range, desired accuracy)
Key Controlling Factors (key underlying chem/phys mechanisms)
List of Assumptions

Solvent Spill
Model Description
Consider the modelling of a contained spill of ethanol as shown in Figure 1. The spill occurs from a
major storage facility, where the storage temperature of the ethanol is 20oC. Develop a dynamic
model capable of predictin

Liquid-liquid extractor
Non-isothermal (intensive solutions)
Model Description
An aqueous waste stream with flow rate F3 contains two organic pollutants (A, B) that will be partially
extracted by using a non-miscible solvent (S) at flow rate F1. The liqui

Linearization Questions
Linearize the Arrhenius reaction rate term given by
E
k=k0e_T2T_ Lmomze at the pomt To.
k 3 h + ik (T 'To)
T olT To Lef \ = k]; k'T
- EIRTD ~E KT 0
, hoe + koe / 0(51 (TTo) 15 T,T
RTo
_ _ A
\2A = E0 e WU" (E. )T
an,"
Linearize the

CHEE3007/3205 Process Modelling and Dynamics
In-semester Examination
Part 2: Application (40% of total)
NAME:
STUDENT No.
Time allowed: 1.5 hours maximum
You must hand in this paper on completion of the examination
Total marks in this part: 100
_
Your ta

MATLAB Week 9: More MATLAB practice
This tutorial will give you more practice at writing MATLAB code, this time from scratch; no
outline will be given.
It will also introduce the idea of running the solver from within a function which will be
needed late

Week4Tutorialsolutionsextrainfo
Exercise 4:
Some people found a second way of doing this:
% Driver to run ice melting problem
%input target time
target=input('target melt time=');
et initial conditions - run simulation to target time
y0=[.02,.25,20]; %

Week 4 Tutorial solutions
Exercises 1-3:
Un-stirred case
Ice is melted by 488 seconds
The final temperature of the water is 17.93
Stirred case
Ice is melted by 345 seconds
The final temperature of the water is 17.93
Total energy lost by the system is 0, s

CHEE 3007: MATLAB Week 11 Solutions
extra information
There are many ways of doing things in MATLAB. Here are some further suggestions as to
how this weeks problem could have been attacked.
Avoiding globals and code replication
As was commented in the

Basic illustra on of the interac on between driver, ode45 and your func on.
Driver
tstart,tend,yi,0
ode45
t,yi
Setini alvaluesofstatevariables
Time=tstart
Currentvaluesofstatevariables=ini alvalues
(yi=yi,0)
Set merange
Calculatederiva ves
Calculatederiva