You are on page 1of 41

CHEN3002 Process Modelling and Simulation

Semester 1 2016

Assignment 2
Group 2
Name
Wong Chiew Wee
Lim Mingjing
Syarifah Nurliza Wan Drahman

Lecturer

: Mr. Freddie Panau

Program

: Bachelor of Chemical Engineering

Date Due

: 13th May 2016

Date Submitted

: 13th May 2016

Student ID
7E2B1284/16530807
7E2B1207/16529177
7E3B2651/18022940

We hereby declare that this assignment is solely our own work and has not previously been
submitted for assessment. This work complies with Curtin University of Technology rules
concerning plagiarism.

Question 1: Analysis of a Small Scale Reactor Model


(a) Model Variables Classifications
i) States

: NA, NB, NC, ND, T, TS, S, w

ii) Constants : -Hr1, -Hr2, -E1f, -E1b, -E2, k01f, k01b, k02, R, , CP, Astm, Bstm, Cstm, Mstm, stm
iii) Parameters : Tmin, Tmax, S, a, Ga, BC, KC, a, CV, U, V, A, pstmi
iv) Algebraics : F, CAi, CBi, Ti, TSP, TSP, CA, CB, CC, CD, OC, r1f, r1b, r2, Tt, , Q, Fstm, stm, pstm,
stm, Tstm

(b) Degrees of Freedom Analysis


Number of variables, Nvar = 59
Number of constants, Nconst = 16
Number of parameters, Nparam = 13
Number of equations, Neqn = 25
Degree of freedom, NDOF = Nvar - Neqn
=59 25
=34
Number of specifications, Nspec = NDOF (Nconst + Nparam)
= 34 (16 + 13)
=5
Specified: F, CAi, CBi, Ti, TSP. These five variables are mentioned in the question which are
the main dynamic input variables for the reactor model.

(c) Incidence Matrix


Number of algebraics, Nalgebraic = 22
Number of unknown, Nunknown = Nalgebraic Nspec
= 22 5
= 17
The unknowns are TSP, CA, CB, CC, CD, OC, r1f, r1b, r2, Tt, , Q, Fstm, stm, pstm, stm and Tstm.

9
10
11
12
13
14
15
18
20
21
22
28
29
30
31
32
33

TSP CA CB CC CD OC r1f r1b r2 Tt Q Fstm stm pstm stm Tstm


X
X
X
X
X X
X
X
X
X X
X
X
X
X
X X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X

Based on the performed incidence matrix above, it can be seen that the assignment is fine as
there is only one circled variable in each row and column in which the rows represent the
algorithm equations while the columns represent the unknown algorithm variables. Moreover,
the DAE index for this assignment is equals to 1 since this assignment can be solved. Therefore,
it can be deduced that this assignment is not a high index problem and it can be solved by using
the Matlabs DAE solver. As for precaution, if the value of the DAE index is higher than 1, it
is essential to recheck whether the number of variables, constants, parameters, and algebraic
equations are correct or not.

(d) Sargent-Westerberg Algorithm


The initial digraph is constructed:

The nodes g(28), g(30), g(31), g(32) and g(33) are a loop and therefore the nodes are merged.

The nodes g(29) and g(28, 30, 31, 32, 33) are a loop and therefore the nodes are merged.

The nodes g(12), g(13), g(14), g(15), g(22) and g(28, 29, 30, 31, 32, 33) have no output. The
nodes are added to the list and deleted from the digraph.
List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33)

The nodes g(9), g(10), g(11) and g(21) have no output. The nodes are added to the list and
deleted from the digraph.
List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33), g(9), g(10), g(11), g(21)

The nodes g(18) and g(20) have no output. The nodes are added to the list and deleted from the
digraph.
3

List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33), g(9), g(10), g(11), g(21), g(18),
g(20)
There are no more nodes and therefore the algorithm is finished.
Based on the performed S-W algorithm, the order of solving the equations is g(20), g(18),
g(21), g(11), g(10), g(9), g(28, 29, 30, 31, 32, 33), g(22), g(15), g(14), g(13), g(12)

(e) Outcome Interpretation


Table 1 Outcome of Sargent-Westerberg Algorithm
Solution Order
1st
2nd
3rd
4th
5th
6th
7th
8th
9th
10th
11th
12th

Equation(s) Used
20
18
21
11
10
9
28, 29, 30, 31, 32, 33
22
15
14
13
12

Variable(s) Calculated
Tt
TSP

CC
CB
CA
Tstm, Fstm, pstm, stm, stm, Q
OC
r2
r1b
r1f
CD

The equations of 28, 29, 30, 31, 32 and 33 are the only six equations that needed to be solved
simultaneously. Then, the remaining equations are solved accordingly.

(f) Practicalities of Implementing the Model Solution


Based on the results of the S-W algorithm, there are total of five alternative ways to solve this
assignment. Despite that, the algebraic equation ordering obtained is unique because all the
alternative ways will eventually lead to the same equation ordering solution. In addition, there
is only one circled variable in each row and column and the DAE index for this assignment is
equals to 1 since this assignment can be solved. Therefore, this assignment is ok and the
interpreted solution steps are feasible. An example of the alternative ways is shown below.

9
10
11
12
13
14
15
18
20
21
22
28
29
30
31
32
33

TSP CA CB CC CD OC r1f r1b r2 Tt Q Fstm stm pstm stm Tstm


X
X
X
X
X X
X
X
X
X X
X
X
X
X
X X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X

The initial digraph is constructed:

The nodes g(29), g(30), g(31) and g(32) are a loop and therefore the nodes are merged.

The nodes g(28), g(29, 30, 31, 32) and g(33) are a loop and therefore the nodes are merged.

The nodes g(12), g(13), g(14), g(15), g(22) and g(28, 29, 30, 31, 32, 33) have no output. The
nodes are added to the list and deleted from the digraph.
List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33)

The nodes g(9), g(10), g(11) and g(21) have no output. The nodes are added to the list and
deleted from the digraph.
List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33), g(9), g(10), g(11), g(21)

The nodes g(18) and g(20) have no output. The nodes are added to the list and deleted from the
digraph.
List: g(12), g(13), g(14), g(15), g(22), g(28, 29, 30, 31, 32, 33), g(9), g(10), g(11), g(21), g(18),
g(20)
There are no more nodes and therefore the algorithm is finished.
Based on the performed SW algorithm, the order of solving the equations is g(20), g(18), g(21),
g(11), g(10), g(9), g(28, 29, 30, 31, 32, 33), g(22), g(15), g(14), g(13), g(12)

Based on the S-W algorithm shown above, it is proven that all the alternative ways to solve
this assignment will result in the same equation ordering solution. Moreover, although there
are six algebraic equations that are needed to be solved simultaneously, there are only six
unknown variables in the six algebraic equations which mean the DOF of the equations is zero.
In other word, the unknown variables are solvable. Therefore, it can be deduced that the
solution steps can be interpreted in terms of coding in Matlab software in order to calculate the
unknown variables. Besides, the equation ordering solution makes sense because the unknown
variables can be solved step by step according to the equation ordering without encountering

any difficulties. The detailed calculation steps of the algebraic equation ordering are shown in
Table 2 below.
Table 2 Detailed Calculation Steps of the Algebraic Equation Ordering
Equations

Algebraic Equations

Variables

20
18
21
11
10
9

Tt = (Ts Tmin )/(Tmax Tmin)


Tsp = (Tsp Tmin )/(Tmax Tmin)
=
NC = CC . V
NB = CB . V
NA = CA . V
Q = U. A. (Tstm T)
Fstm = CV . S. [pstmi pstm /stm ]1/2
log10 (pstm ) = Astm Bstm /(Cstm + Tstm )
stm = pstm Mstm /(RTstm )
stm = stm Fstm
stm = Q/stm
OC = BC + K C .
r2 = k 02 . exp[E2 /(R. T)]. . 2
r1b = k 01b . exp[E1b /(R. T)].
r1f = k 01f . exp[E1f /(R. T)]. .
ND = CD . V

Tt
TSP

CC
CB
CA

28, 29, 30,


31, 32, 33

22
15
14
13
12

Variables
Calculated
Tt
TSP

CC
CB
CA

Tstm, Fstm,
pstm, stm,
stm, Q

Tstm, Fstm, pstm,


stm, stm, Q

OC
r2
r1b
r1f
CD

OC
r2
r1b
r1f
CD

Based on the table above, it can be seen that the values of Tt and Tsp are first calculated in
Equation 20 and Equation 18 respectively. The variables that are already calculated are bold
in the following equations for the ease of interpretation. Following that, is the only unknown
variable in Equation 21 and hence, the value can then be easily calculated. Nevertheless, the
solution is not optimal as there are six equations that are needed to be solved simultaneously.
Furthermore, there is better equation ordering solution for this assignment. The detailed of the
improved ordering solution is discussed as presented below:
1) Since the value of can only be calculated after calculating the Tt and Tsp, the ordering
solution remained unchanged as g(20), g(18) and g(21). After obtaining the value of , the
value of OC can then be calculated. Thus, the ordering solution becomes g(20), g(18), g(21)
and g(22).
2) For g(11), g(10), g(9) and g(12), the values of CC, CB, CA and CD can be calculated entirely.
There is no need to calculate them sequentially as there is the values are independent of each
other.
3) For g(15), g(14) and g(13), the values of r2, r1b and r1f are calculated entirely after obtaining
the values CC, CB, CA. Thus, the equations are located after the g(11), g(10), g(9) and g(12).

4) Lastly, the six simultaneous equations are rearranged as the last equations to be solved as
mistakes often arisen from the substitution process. It is advantageous to locate them as the last
part of the algebraic equations because if there is any wrong substitution or calculation in the
equations, we only have to recheck the last part of the entire algebraic equations. This will
result in less time consuming and high efficiency. Hence, the better equation ordering solution
is g(20), g(18), g(21), g(22), g(11), g(10), g(9), g(12), g(15), g(14), g(13), g(28, 29, 30, 31, 32,
33).

By referring to Tutorial 6, there are four methods that are applicable in Matlab to solve DAE
problem. The first method is substituting all the algebraic equations into the ordinary
differential equations (ODEs) to form a pure ODE system and followed by solving it using the
ODE solver. This often will result in high probability of making mistakes during the
substitution process. The second method is solving the algebraic equations numerically. The
algebraic equations are solved simultaneously and followed by evaluating the derivatives.
Then, solve it using the ODE solver. As for third method, the algebraic equations are rearranged
in order. After that, the derivatives are evaluated and followed by solving it using the ODE
solver. This method allowed the algebraic equations to be solved sequentially. The fourth
method is writing all the algebraic equations in mass matrix DAE form so that it can be solved
using the DAE solver. Among all the methods, the third method is the most optimal method
because it allows easy recognition of error in Matlab coding as the algebraic equations are
typed out individually. Besides, this method also lowers the possibility of making mistakes as
the algebraic equations are not required to be substituted into the ODEs. However, an additional
work is needed to prepare the algebraic model equations for solutions. The model variables
have to be first classified into states, constants, parameters and algebraics, and followed by
identifying the values for constants and parameters. Sequentially, DOF analysis, incidence
matrix and S-W algorithm have to be performed in order to identify the solution order. Lastly,
the algebraic equations are rearranged according to the solution in order to solve it sequentially
as there is impossible to solve all the algebraic equations entirely.

Question 2: Numerical Solution of a Solubilisation Tank Model


Before inserting the algebraic equations into the Matlab coding, all the model variables are
classified into states, constants, parameters, specified algebraic and unknown algebraic. Next,
the DOF and number of specifications are calculated and followed by performing the incidence
matrix and S-W algorithm in order to identify the solution order of the algebraic equations.
Model Variables Classifications
i) States

: MW, MB, hS, w, S

ii) Constants

: , , H1, H2, L

iii) Parameters

: CV, P, BC, KC, s, Ga, a, a

iv) Specified Algebraics

: BSi, QLi, CBLi, hSP

v) Specified Algebraics

: WLi, WLo, BLi, BLo, Li, Lo, xBLi, xBLo, xWLo, MT, QLo,
VT, Li, Lo, Vbot, Vtop, h, ht, hsp, , Oc

Degrees of Freedom Analysis


Number of variables, Nvar = 43
Number of constants, Nconst = 5
Number of parameters, Nparam = 8
Number of equations, Neqn = 26
Degree of freedom, NDOF = Nvar - Neqn
= 43 26
= 17
Number of specifications, Nspec = NDOF (Nconst + Nparam)
= 17 (5 + 8)
=4
Incidence Matrix
Number of algebraics, Nalgebraic = 25
Number of unknown, Nunknown = Nalgebraic Nspec
= 25 4
= 21

WLi
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
26

WLo

BLi
X

BLo

Li

Lo

X
X

Lo

xBLi

xBLo

xWLo

MT

QLo

VT

Vbot

Vtop

X
X

ht

hsp

Oc

X
X

X
X

Li

X
X

X
X

X
X

X
X

X
X

X
X
X
X
X

X
X

X
X
X

X
X

X
X

X
X
X

X
X

10

Sargent-Westerberg Algorithm
The initial digraph is constructed:

The nodes g(4), g(5) and g(6) are a loop and therefore the nodes are merged.

The nodes g(7), g(8), g(9), g(18) and g(23) have no output. The nodes are added to the list and
deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23)

The merged node g(4, 5, 6), nodes g(12), g(13), g(17) and g(22) have no output. The nodes are
added to the list and deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23), g(4, 5, 6), g(12), g(13), g(17), g(22)

11

The nodes g(3), g(15), g(16), g(20), g(21) and g(26) have no output. The nodes are added to the
list and deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23), g(4, 5, 6), g(12), g(13), g(17), g(22), g(3), g(15), g(16), g(20),
g(21), g(26)

The node g(10) has no output. The node is added to the list and deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23), g(4, 5, 6), g(12), g(13), g(17), g(22), g(3), g(15), g(16), g(20),
g(21), g(26), g(10)

The node g(11) has no output. The node is added to the list and deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23), g(4, 5, 6), g(12), g(13), g(17), g(22), g(3), g(15), g(16), g(20),
g(21), g(26), g(10), g(11)

The node g(14) has no output. The node is added to the list and deleted from the digraph.
List: g(7), g(8), g(9), g(18), g(23), g(4, 5, 6), g(12), g(13), g(17), g(22), g(3), g(15), g(16), g(20),
g(21), g(26), g(10), g(11), g(14)
There are no more nodes and therefore the algorithm is finished.

12

Based on the performed S-W algorithm, the order of solving the equations is g(14), g(11), g(10),
g(26), g(21), g(20), g(16), g(15), g(3), g(22), g(17), g(13), g(12), g(4, 5, 6), g(23), g(18), g(9), g(8),
g(7)

a) Printout of m-files
Based on the Sargent-Westerberg algorithm performed, the sequence of the equations can be
developed. Hence, the DAE model system can be solved by using method 3. For this case, the
model seems to be a non-stiff system as the execution time is in matter of seconds, thus ode45
solver is suitable to solve the model. Three Matlab script m-file were developed to solve the model,
which named as bogctrl.m, bogfunc.m and bogsim.m respectively. After running the simulation
file (bogsim.m), the data is printed out which as shown as below.

The maximum value:


MW = 16774.98 kg
MB = 7150.00 kg
hs = 2.50 m
w = 0.0105
S = 0.8969
MT = 23907.89 kg
xBLo = 0.299163
xWLo = 0.763515
h = 2.50 m

The minimum value:


MW = 13381.38 kg
MB = 4512.87 kg
hs = 2.10 m
w = -0.0076
S = 0.3500
MT = 19048.69 kg
xBLo = 0.236485
xWLo = 0.700837
h = 2.09 m

13

The coding for the script m-files are shown as following.


bogctrl.m script file:
function [QLi,CBLi,mdotBSi,hSP] = bogctrl(t)
% BOGCTRL: Dynamic inlet conditions and level setpoint for solubilisation
% tank model
%
% Input variable:
%
t
Current time (s)
% Output variables:
%
QLi
Inlet liquor volumetric flowrate (m^3/s)
%
CBLi
Inlet boganite concentration in liquor (kg/m^3)
%
mdotBSi Inlet mass flowrate of solid boganite (kg/s)
%
hSP
Level control set-point (m)

% Inlet liquor conditions remain fixed for the duration of the simulation
QLi = 0.0565;
CBLi = 43;
% Introduce step change in level set-point at t = 5 minutes
if t < 300
hSP = 2.5;
else
hSP = 2.2;
end
% Introduce step change in solids stream feed rate at t = 20 minutes
if t < 1200
mdotBSi = 21.5;
else
mdotBSi = 21.5*0.7;
end

14

bogfunc.m script file:


function dydt = bogfunc(t,y,p)
%BOGFUNC: Derivative function file for a structured solution approach to
%the solubilisation tank model
% Map y to local state variables
MW = y(1);
MB = y(2);
hs = y(3);
w = y(4);
S = y(5);
% Unpack parameters
[alpha,beta,H1,H2,L,CV,deltaP,Bc,Kc,taus,Ga,taua,xia] = p{:};
% Get the current values for boganite mass
[QLi,CBLi,mdotBSi,hSP] = bogctrl(t);
% Solve algebraic equations in sequence using the structured approach
MT = MW+MB;
% Equation 14
xBLo = MB/MT;
% Equation 11
rhoLo = alpha+beta*xBLo;
% Equation 10
QLo = CV*S*(deltaP/rhoLo)^(0.5); % Equation 26
hSPprime = hSP/H1;
% Equation 21
htprime = hs/H1;
% Equation 20
Vbot = 0.5*(H1-H2)*L^2;
% Equation 16
VT = MT/rhoLo;
% Equation 15
mdotBLi = QLi*CBLi;
% Equation 3
err = hSPprime-htprime;
% Equation 22
Vtop = VT-Vbot;
% Equation 17
mdotLo = rhoLo*QLo;
% Equation 13
xWLo = 1-xBLo;
% Equation 12
% Original Equation 4,5 and 6
% mdotLi = rhoLi*QLi;
Equation 4
% rhoLi = alpha+beta*xBLi; Equation 5
% xBLi = mdotBLi/mdotLi;
Equation 6
% Change it to simultaneous equation, where the Equation 5 and 6 are
% substituted into Equation 4 which product a quadratic equation.
% The quadratic equation is rearranged in the form of ax^2+bx+c=0,
% then solve by using x = (-b+sqrt(b^2-4ac))/2a or (-b-sqrt(b^2-4ac))/2a.
mdotLi1 = (alpha*QLi+sqrt(((alpha*QLi)^2)+4*beta*QLi*mdotBLi))/2;
mdotLi2 = (alpha*QLi-sqrt(((alpha*QLi)^2)+4*beta*QLi*mdotBLi))/2;
if mdotLi1 > mdotBSi
mdotLi = mdotLi1;
else
mdotLi = mdotLi2;
end
Oc = Bc+Kc*err;
h = H1-H2+(Vtop/L^2);
mdotBLo = xBLo*mdotLo;
mdotWLo = xWLo*mdotLo;

%
%
%
%

Equation
Equation
Equation
Equation

23
18
9
8

15

mdotWLi = mdotLi - mdotBLi;

% Equation 7

% Evaluate derivatives
dMWdt = mdotWLi-mdotWLo;
dMBdt = mdotBLi+mdotBSi-mdotBLo;
dhsdt = (h-hs)/taus;
dwdt = ((Ga*Oc-S)/taua^2)-2*(xia/taua)*w;
dSdt = w;

%
%
%
%
%

Equation
Equation
Equation
Equation
Equation

1
2
19
24
25

% Pack derivatives into dydt vectors


dydt = [dMWdt dMBdt dhsdt dwdt dSdt]';

16

bogsim.m script file:


% BOGSIM: Simulation of the solubilisation tank model by using sequential
% solution of the algebraic variables (Method 3) and display the solutions
% by plotting individually
% Model constants
alpha = 1000;
%
beta = 1100;
%
H1 = 3;
%
H2 = 2;
%
L = 3;
%

Solution density correlation parameter (kg/m^3)


Solution density correlation parameter (kg/m^3)
Total tank height (m)
Height of top zone of tank (m)
Tank width (and length) (m)

% Model parameters
CV = 0.256;
% Outlet valve coefficient ((m^3/s)/(kPa/(kg/m^3))^0.5)
deltaP = 300;
% Pressure drop over control valve (kPa)
Bc = 0.5;
% Controller bias (-);
Kc = -5;
% Controller gain (-)
taus = 10;
% Level sensor time constant (s)
Ga = 1;
% Actuator gain (-)
taua = 20;
% Actuator time constant (s)
xia = 0.8;
% Actuator damping factor (-)
% Simulation time
tf = 2400;
% Final simulation time (s)
% Specify initial
MW0 = 16750;
%
MB0 = 7150;
%
hs0 = 2.5;
%
w0 = 0;
%
S0 = 0.5;
%

conditions
Initial mass of water in tank (kg)
Initial mass of boganite in tank (kg)
Initial level sensor reading (m)
Initial scaled valve stem velocity (1/s)
Initial dimensionless valve position (-)

% Pack up parameters and initial conditions


p = {alpha,beta,H1,H2,L,CV,deltaP,Bc,Kc,taus,Ga,taua,xia};
y0 = [MW0 MB0 hs0 w0 S0]';
% Solve the model
[t,y] = ode45(@(t,y) bogfunc(t,y,p),[0 tf],y0);
% Unpack solution
MW = y(:,1);
MB = y(:,2);
hs = y(:,3);
w = y(:,4);
S = y(:,5);
% Unit conversion of time into minutes
t = t./60;
% Calculation of the model objectives (MT,xBLo,xWLo and h over time)
MT = MW+MB;
xBLo = MB./(MW+MB);
xWLo = 1-xBLo;
rhoLo = alpha+beta*xBLo;
VT = MT./rhoLo;

17

Vbot = (1/2)*(H1-H2)*L^2;
Vtop = VT-Vbot;
h = H1-H2+(Vtop/L^2);
% Print out the maximum and minimum values
fprintf('\nThe maximum value:\n');
fprintf(' MW = %.2f kg\n MB = %.2f kg\n hs = %.2f m\n w = %.4f\n S =
%.4f\n',max(MW),max(MB),max(hs),max(w),max(S));
fprintf(' MT = %.2f kg\n xBLo = %.6f\n xWLo = %.6f\n h = %.2f
m\n',max(MT),max(xBLo),max(xWLo),max(h));
fprintf('\nThe minimum value:\n');
fprintf(' MW = %.2f kg\n MB = %.2f kg\n hs = %.2f m\n w = %.4f\n S =
%.4f\n',min(MW),min(MB),min(hs),min(w),min(S));
fprintf(' MT = %.2f kg\n xBLo = %.6f\n xWLo = %.6f\n h = %.2f
m\n',min(MT),min(xBLo),min(xWLo),min(h));
% Display the results and the maximum & minimum values in graph
% Figure 1
figure (1)
plot(t,MW);
title(['Solubilisation tank simulation: Mass of water (kg) vs Time
(min)\newline ']);
xlabel('Time (min)');
ylabel('MW (kg)');
legend('MW (kg)');
grid on;
indexmin = find(min(MW) == MW);
tmin = t(indexmin);
MWmin = MW(indexmin);
indexmax = find(max(MW) == MW);
tmax = t(indexmax);
MWmax = MW(indexmax);
strmin = ['Minimum = ',num2str(MWmin)];
text(tmin,MWmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(MWmax)];
text(tmax,MWmax,strmax,'HorizontalAlignment','left');
% Figure 2
figure (2)
plot(t,MB)
title(['Solubilisation tank simulation: Mass of boganite (kg) vs Time
(min)\newline '])
xlabel('Time (min)');
ylabel('MB (kg)');
legend('MB (kg)');
grid on;
indexmin = find(min(MB) == MB);
tmin = t(indexmin);
MBmin = MB(indexmin);
indexmax = find(max(MB) == MB);
tmax = t(indexmax);
MBmax = MB(indexmax);
strmin = ['Minimum = ',num2str(MBmin)];
text(tmin,MBmin,strmin,'HorizontalAlignment','right');
strmax = ['Maximum = ',num2str(MBmax)];
text(tmax,MBmax,strmax,'HorizontalAlignment','left');

18

% Figure 3
figure (3)
plot(t,hs);
title(['Solubilisation tank simulation: hs (m) vs Time (min)\newline ']);
xlabel('Time (min)');
ylabel('hs (m)');
legend('hs (m)');
grid on;
indexmin = find(min(hs) == hs);
tmin = t(indexmin);
hsmin = hs(indexmin);
indexmax = find(max(hs) == hs);
tmax = t(indexmax);
hsmax = hs(indexmax);
strmin = ['Minimum = ',num2str(hsmin)];
text(tmin,hsmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(hsmax)];
text(tmax,hsmax,strmax,'HorizontalAlignment','left');
% Figure 4
figure (4)
plot(t,w);
title(['Solubilisation tank simulation: w (1/s) vs Time (min)\newline ']);
xlabel('Time (min)');
ylabel('w (1/s)');
legend('w (1/s)');
grid on;
indexmin = find(min(w) == w);
tmin = t(indexmin);
wmin = w(indexmin);
indexmax = find(max(w) == w);
tmax = t(indexmax);
wmax = w(indexmax);
strmin = ['Minimum = ',num2str(wmin)];
text(tmin,wmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(wmax)];
text(tmax,wmax,strmax,'HorizontalAlignment','left');
% Figure 5
figure (5)
plot(t,S);
title(['Solubilisation tank simulation: S vs Time (min)\newline ']);
xlabel('Time (min)');
ylabel('S');
legend('S');
grid on;
indexmin = find(min(S) == S);
tmin = t(indexmin);
Smin = S(indexmin);
indexmax = find(max(S) == S);
tmax = t(indexmax);
Smax = S(indexmax);
strmin = ['Minimum = ',num2str(Smin)];
text(tmin,Smin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(Smax)];
text(tmax,Smax,strmax,'HorizontalAlignment','left');

19

% Figure 6
figure (6)
plot(t,MT);
title(['Solubilisation tank simulation: Total mass (kg) vs Time (min)\newline
']);
xlabel('Time (min)');
ylabel('MT (kg)');
legend('MT (kg)');
grid on;
indexmin = find(min(MT) == MT);
tmin = t(indexmin);
MTmin = MT(indexmin);
indexmax = find(max(MT) == MT);
tmax = t(indexmax);
MTmax = MT(indexmax);
strmin = ['Minimum = ',num2str(MTmin)];
text(tmin,MTmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(MTmax)];
text(tmax,MTmax,strmax,'HorizontalAlignment','left');
% Figure 7
figure (7)
plot(t,xBLo,t,xWLo);
title(['Solubilisation tank simulation: xBLo & xWLo vs Time (min)\newline
']);
xlabel('Time (min)');
ylabel('xLo');
legend('xBLo','xWLo');
grid on;
indexmin = find(min(xBLo) == xBLo);
tmin = t(indexmin);
xBLomin = xBLo(indexmin);
indexmax = find(max(xBLo) == xBLo);
tmax = t(indexmax);
xBLomax = xBLo(indexmax);
strmin = ['Minimum = ',num2str(xBLomin)];
text(tmin,xBLomin,strmin,'HorizontalAlignment','right');
strmax = ['Maximum = ',num2str(xBLomax)];
text(tmax,xBLomax,strmax,'HorizontalAlignment','left');
indexmin = find(min(xWLo) == xWLo);
tmin = t(indexmin);
xWLomin = xWLo(indexmin);
indexmax = find(max(xWLo) == xWLo);
tmax = t(indexmax);
xWLomax = xWLo(indexmax);
strmin = ['Minimum = ',num2str(xWLomin)];
text(tmin,xWLomin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(xWLomax)];
text(tmax,xWLomax,strmax,'HorizontalAlignment','right');
% Figure 8
figure (8)
plot(t,h);
title(['Solubilisation tank simulation: h (m) vs Time (min)\newline ']);
xlabel('Time (min)');
ylabel('h (m)');
legend('h (m)');

20

grid on;
indexmin = find(min(h) == h);
tmin = t(indexmin);
hmin = h(indexmin);
indexmax = find(max(h) == h);
tmax = t(indexmax);
hmax = h(indexmax);
strmin = ['Minimum = ',num2str(hmin)];
text(tmin,hmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(hmax)];
text(tmax,hmax,strmax,'HorizontalAlignment','left');

21

b) Matlab plots
By running the script m-file, the DAE model system can be solved and the solutions are plotted as
shown below. There are total of eight graphs will be plotted, which are the mass of water in tank
(MW), mass of boganite in tank (MB), total mass in tank (MT), mass fraction of the species in tank
(xBLo and xWLo), actual tank level (h), sensed tank level (hs), outlet control valve position (S), and
scaled valve stem velocity (w) over a period of 40 minutes.

Figure 1 Mass of Water in Tank (kg) against Time (min)

Figure 2 Mass of Boganite in Tank (kg) against Time (min)


22

Figure 3 Total Mass in Tank (kg) against Time (min)

Figure 4 Mass Fractions of Boganite Liquid Outlet and Water Outlet against Time (min)

23

Figure 5 Actual Tank Level (m) against Time (min)

Figure 6 Sensed Tank Level (m) against Time (min)

24

Figure 7 Outlet Control Valve Position against Time (min)

Figure 8 Scaled Valve Stem Velocity (1/s) against Time (min)

25

c) Verification Practices
1) First Verification Practice Error Checking for Programming Mistakes
The Matlab code was evaluated through the line by line inspection method in order to check for
programming mistakes that may have occurred. Programming mistakes occur when the equations
entered in Matlab are incorrect. While this error may not be detected by the program, a slight
difference in the equations would affect the whole result. In this method, the codes would be
checked line by line by each member of the group in order to detect any mistake that may have
been overlooked. The equations entered in the code were compared with the given equations in
the assignment sheet.
The algebraic equations were entered according to the equations ordering solution which is g(14),
g(11), g(10), g(26), g(21), g(20), g(16), g(15), g(3), g(22), g(17), g(13), g(12), g(4, 5, 6), g(23),
g(18), g(9), g(8), g(7) as shown below.
MT = MW+MB;
xBLo = MB/MT;
rhoLo = alpha+beta*xBLo;
QLo = CV*S*(deltaP/rhoLo)^(0.5);
hSPprime = hSP/H1;
htprime = hs/H1;
Vbot = 0.5*(H1-H2)*L^2;
VT = MT/rhoLo;
mdotBLi = QLi*CBLi;
err = hSPprime-htprime;
Vtop = VT-Vbot;
mdotLo = rhoLo*QLo;
xWLo = 1-xBLo;

%
%
%
%
%
%
%
%
%
%
%
%
%

Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation
Equation

14
11
10
26
21
20
16
15
3
22
17
13
12

% Original Equation 4,5 and 6


% mdotLi = rhoLi*QLi;
Equation 4
% rhoLi = alpha+beta*xBLi; Equation 5
% xBLi = mdotBLi/mdotLi;
Equation 6
% Change it to simultaneous equation, where the Equation 5 and 6 are
% substituted into Equation 4 which product a quadratic equation.
% The quadratic equation is rearranged in the form of ax^2+bx+c=0,
% then solve by using x = (-b+sqrt(b^2-4ac))/2a or (-b-sqrt(b^2-4ac))/2a.
mdotLi1 = (alpha*QLi+sqrt(((alpha*QLi)^2)+4*beta*QLi*mdotBLi))/2;
mdotLi2 = (alpha*QLi-sqrt(((alpha*QLi)^2)+4*beta*QLi*mdotBLi))/2;
if mdotLi1 > mdotBSi
mdotLi = mdotLi1;
else
mdotLi = mdotLi2;
end
Oc = Bc+Kc*err;
h = H1-H2+(Vtop/L^2);
mdotBLo = xBLo*mdotLo;
mdotWLo = xWLo*mdotLo;
mdotWLi = mdotLi - mdotBLi;

%
%
%
%
%

Equation
Equation
Equation
Equation
Equation

23
18
9
8
7

26

The differential equations entered are as follows:


%Evaluate derivatives
dMWdt = mdotWLi-mdotWLo;
dMBdt = mdotBLi+mdotBSi-mdotBLo;
dhsdt = (h-hs)/taus;
dwdt = ((Ga*Oc-S)/taua^2)-2*(xia/taua)*w;
dSdt = w;

%
%
%
%
%

Equation
Equation
Equation
Equation
Equation

1
2
19
24
25

The equations given in the assignment sheet is shown in Table 3 below.


Table 3 Equations given in the Assignment Sheet
Equation 1

dMW/dt = WLi WLo

Equation 2

dMB/dt = BLi + BSi BLo

Equation 3

BLi = QLi.CBLi

Equation 4

Li.QLi = Li

Equation 5

Li = + .xBLi

Equation 6

xBLi = BLi / Li

Equation 7

Li = WLi + BLi

Equation 8

WLo = xWLo.Lo

Equation 9

BLo = xBLo.Lo

Equation 10

Lo = + .xBLo

Equation 11

xBLo = MB / MT

Equation 12

xWLo = 1 xBLo

Equation 13

Lo = Lo.QLo

Equation 14

MT = M W + MB

Equation 15

VT = MT / Lo

Equation 16

Vbot = (H1 H2)L2

Equation 17

Vtop = VT Vbot

Equation 18

h = H1 H2 + Vtop / L2

Equation 19

dhs/dt = (h hs) / s

Equation 20

ht = hs / H1

Equation 21

hSP = hSP / H1

Equation 22

= hSP ht
27

Equation 23

Oc = Bc + Kc.

Equation 24

dw/dt = (Ga.Oc S)/a2 2.(a/a).w

Equation 25

dS/dt = w

Equation 26

QLo = Cv.S.[p / Lo]1/2

The simultaneous equation for Equation 4, 5 and 6 is shown below.


QLi (QLi )2 + 4. QLi . mBLi
mLi =
2

Furthermore, the Matlab script is checked for array operations. Array variables were identified for
the solution calculated from the solver as they are packed with a set of data. Hence, array operator
are required in order to define the equation correctly. An example is taken from the Matlab
simulation file (bogsim.m) as shown as below. Since MB and MW are both in array form, an array
operator (. /) should be used.

xBLo = MB/(MW+MB);

(This script is wrong as no array operator is used in the equation)

xBLo = MB./(MW+MB);

(Array operator is used, hence it is correct)

From these, it can be seen that the equations that were entered in the code are correct. Hence, the
model developed in Matlab is verified.

28

2) Second Verification Practice Execution Time and Number of Steps Taken of Other Ode
Solver
The behavior of the system is being inspected to determine whether the system is a non-stiff or
stiff model. The inspection is performed by recording the execution time and the number of time
steps taken for the Matlab to complete the calculation. The model is tested by using two ODE
solver available in Matlab, which are ode45 that suitable for non-stiff system, and ode15s that
suitable for stiff system. Additional Matlab script is written into the script m-file to perform the
inspection. The Matlab script added is written as shown as below.
% Solve the model
tic

% Start stopwatch timer

[t,y] = ode45(@(t,y) bogfunc(t,y,p),[0 tf],y0,opts);% ode45 or ode15s


exectime = toc;
nsteps = length(t);

% Stop timer and store result


% Count number of time steps taken by the solver

After the calculation, additional Matlab script is written as shown as below to display the results.
% Report the solver performance results
disp(' ')
disp(['Number of time steps taken : ' num2str(nsteps)])
disp(['Execution time
: ' num2str(exectime) ' seconds'])
disp(' ')

In order to improve the data computed from the Matlab, 3 runs on the simulation are performed.
The execution time is averaged and compared between the ode45 and ode15s solver. The results
of the inspection are shown in Table 4.
Table 4 Comparison between ODE Solvers
ODE solver
Simulation run
Execution time (s)
Average execution time
(s)
Number of time steps
taken

st

1 run
0.26172

ode45
2nd run
0.25610

rd

st

3 run
1 run
0.27135 0.36726

ode15s
2nd run
0.38596

0.26306

0.38455

289

163

3rd run
0.40042

As shown in Table 4, the execution time for the case of using ode45 solver is much faster.
However, by observing the time taken, the model for both of the cases are able to be solved in
matter of deciseconds. Despite that, the number of time steps taken for the calculation by using
ode45 solver is larger, which should compute a more accurate result. Therefore, ode45 is a more
suitable ODE solver for this model.
29

3) Third Verification Practice Tolerance


The verification on the model developed is also performed by checking the tolerance for the solver
since the tolerance will affect the accuracy of the result. In Matlab, the default tolerance for the
ode solver is 10-3. Thus, the solver tolerance is decreased by a factor of 10 for each case, and three
additional cases will be run for the checking. In order to perform the checking, an amendment on
the Matlab script is required. The script is rewritten as shown as below.
% Ask for and set the desired solution tolerance
rtol = input('Give the desired relative solution tolerance: ');
opts = odeset('RelTol',rtol);
% Solve the model
[t,y] = ode45(@(t,y) bogfunc(t,y,p),[0 tf],y0,opts);

To display the results, the following Matlab script is added.


% Display the final model objectives (t=40min)
fprintf('At t=40min,\n MW = %.2f kg\n MB = %.2f kg\n hs = %.2f m\n w = %.4f\n
S = %.4f\n',MW(end),MB(end),hs(end),w(end),S(end));
fprintf(' MT = %.2f kg\n xBLo = %.6f\n xWLo = %.6f\n h = %.2f
m\n\n',MT(end),xBLo(end),xWLo(end),h(end));

Hence, for the three additional cases, the tolerances are set to be 10-4, 10-5, and 10-6 respectively.
Then, the comparisons are done by using the final values for the model objectives, which occurs
at 40 minutes. The results for the checking of the tolerance is shown in Table 5 below.
Table 5 Comparison among Different Tolerances Inserted
Tolerance
MW (kg)
MB (kg)
hs (m)
w
S
MT (kg)
xBLo
xWLo
h (kg)

10-3
14570.30
4512.76
2.18
0.0000
0.4711
19083.06
0.236480
0.763520
2.18

10-4
14570.27
4512.87
2.18
0.0000
0.4711
19083.14
0.236485
0.763515
2.18

10-5
14570.29
4512.78
2.18
0.0000
0.4711
19083.07
0.236481
0.763519
2.18

10-6
14570.29
4512.80
2.18
0.0000
0.4711
19083.08
0.236481
0.763519
2.18

From the checking result as shown in Table 5 above, it is apparently that the errors among the
cases with different tolerance are very insignificant. Hence, the default tolerance (10-3) is sufficient
to have an accurate result.

30

4) Fourth Verification Practice Manual Calculation Checking for Numerical Errors


The verification also done by performing manual calculation. In this case, the mass fraction of
boganite in liquor at outlet (xBLo) is chosen to be calculated manually. The result from the manual
calculation is then cross-check with the result calculated from Matlab. The calculation procedure
is shown as following.

Equations given:
dMB
= mBLi + mBSi mBLo
dt

Equation (2)

mBLi = QLi CBLi

Equation (3)

mBLo = xBLo mLo

Equation (9)

Lo = + xBLo

Equation (10)

QLo

P 1/2
= CV S ( )
Lo

mLo = Lo QLo

Equation (26)
Equation (13)

Substitute Equation (26) into Equation (13),


mLo

P 1/2
= Lo CV S ( )
Lo

= CV S(P)1/2 (Lo )1/2

Then, substitute Equation (10) into mLo expression above,


mLo = CV S(P)1/2 ( + xBLo )1/2

Since at the initial and final condition, there are no changes on the level set point and influent
composition, the system should be in steady state, where dMB/dt equals to zero.
mBLi + mBSi mBLo = 0

31

Substitute Equation (3) and Equation (9),


QLi CBLi + mBSi xBLo mLo = 0
QLi CBLi + mBSi CV S(P)1/2 (xBLo 2 + xBLo 3 )1/2 = 0

Given the information,


CV = 0.256(m3 /s)/(kPa/(kg/m3 ))1/2
S = 0.5

QLi = 0.0565 m3 /s

P = 300kPa

CBLi = 43kg/m3

= 1000kg/m3

At initial condition, mBSi = 21.5kg/s

= 1100kg/m3

At final condition, mBSi = 15.05kg/s

Thus, xBLo can be calculated,


At initial condition,
(0.0565)(43) + 21.5 (0.256)(0.5)(300)1/2 (1000xBLo 2 + 1100xBLo 3 )1/2 = 0
1100xBLo 3 + 1000xBLo 2 116.5 = 0
xBLo = 0.6801

xBLo = 0.5253

xBLo = 0.2964

xBLo > 0
xBLo = 0.2964

At final condition, assume S is remained unchanged,


(0.0565)(43) + 15.05 (0.256)(0.5)(300)1/2 (1000xBLo 2 + 1100xBLo 3 )1/2 = 0
1100xBLo 3 + 1000xBLo 2 62.2 = 0
xBLo = 0.8263

xBLo = 0.3063

xBLo = 0.2234

32

xBLo > 0
xBLo = 0.2234

Table 6 Comparison of between the Manual Calculation and Matlab Result


At initial condition
At final condition

Manual Calculation
0.2964
0.2234

Matlab Result
0.2992
0.2365

Percentage error
0.94%
5.86%

A comparison is made between the manual calculation and Matlab result for x BLo as shown in
Table 6 above. As calculated, the percentage error at the initial condition and final condition,
is very small. Hence, the model developed in Matlab is verified.

33

Question 3: Reflection on the Assignment


Name: Lim Mingjing
Part A: Reflection on a Technical Aspect of the Assignment
In this project, I found that performing Sargent-Westerberg (S-W) algorithm is very important
as it is applicable to both of the questions in this assignment. By performing S-W algorithm,
the sequence of the equations can be determined, then the model can be solved sequentially. SW algorithm helps to simplify the procedure and yet ensure that is no any equation miss out
for the calculation. The outcomes of the S-W algorithm are good and able to solve the model
correctly. As what have done in Question 2, S-W algorithm helps out a lot in the arrangement
of the sequence of the equations. As the equations become more, the S-W algorithm is more
suggested to use in order to simplify the procedure. However, the outcome of the S-W
algorithm may not be the optimal sequence of the equations. Thus, further analysis is required
after performing the S-W algorithm.
When doing the assignment, doubts arise on the working procedure of the S-W algorithm.
However, after some research, S-W algorithm are now understandable and able to perform in
the future. In addition, after some practices on S-W algorithm in this assignment, in the future,
the algorithm can be performing in such a way that more accurate and faster.

34

Part B: Reflection on the use of a Professional Skill or Attribute


In my opinion, the most appealing attributes that can be found in this assignment is the
creativity. Creativity is required especially solving the model by using Matlab. For the same
model, the way of solving it can be varying, thus, creativity has to be brought to the table in
order to develop an alternative ways or a better way to solve the model. Matlab programming
is always challenging as a small mistake can lead to the failure of the whole model.
Furthermore, the creativity of the coder can be helpful when there is an example solution for
similar model. Amendment on the previous model has been proved that is much easier and
effective way to solve the model when using Matlab as most of the time the Matlab coding is
very long and develop a new one can be time-wasting. In addition, when developing a model,
there will be many errors arise during the development.
Sometimes, a previous model might not exist, hence creativity is much more important in
solving the model. Seeking out for new solution based on the fundamental knowledge is the
basis for an engineer. As a model can never be perfect, an engineer has to be creative enough
to minimize the error of the model. Creativity also comes with the experience, hence by doing
more practices, the better it will be. This assignment has given the chances for the future
engineer to practice, so in the future, when the same problem arises, the engineer is capable
solve the problem.

35

Name: Wong Chiew Wee


Part A: Reflection on a Technical Aspect of the Assignment
In my opinion, one of the most important tasks is categorizing the variables as it is the first step
in solving the model equations. The variables have to be categorized correctly and clearly into
the states, constants, parameters and algebraics before proceeds to create the incidence matrix
and do the assignment, and perform the S-W algorithm. It is because if the variables are
categorized inaccurately, it will eventually lead to the wrong solution. Initially, I tried to list
out all the variables and followed by categorizing them into the states, constants, parameters
and algebraics. After that, I calculated the DOF and number of specifications based on the
categorized variables. As a result, I realized that my categorization of the variables was wrong
because the number of specifications that I calculated was 6 but there was only 5 specified
variables in question 1. Thus, I redo the categorization of the variables and finally obtained the
same number of specifications with the number of specified variables given in the question.
Then, I created the incidence matrix to do the assignment. However, the assignment cannot be
done because there was one variable that cannot be circled in its row and column. Hence, I
repeated the procedures by checking back the categorized variables and identified the
appropriateness of each variable that it was located. Consequently, I swapped the variables of
Pstmi and stm between the algebraic and parameters, and this has resulted in helping me to solve
the assignment. Next, the S-W algorithm was performed in order to obtain the equation
ordering solution. Nevertheless, when it comes to the practicalities of implementing the S-W
solution, I found out that the ordering solution was not optimal. Therefore, I manually
rearranged the ordering of the algebraic equations in order to optimize it. Throughout the
process of categorizing the variables, it has enhanced my skill in differentiating the variables
into states, constants, parameters and algebraics and followed by developing the possible
solutions to resolve the problems. Besides, I learnt to be attentive to the programming problems
that arisen in the questions given as error often occurs during the coding process. Hence, it is
necessary to pay extra attention when writing the code or debug the error. For example, when
there was an error of coding detected in question 2, I learnt to identify the error that occurred
line by line in order to minimize the possibility of omitting the error and able to amend the
coding immediately. With this, my problem solving skill has been greatly strengthened.
Moreover, this assignment has also helped me in improving my critical thinking skill. The
questions given in this assignment are very tricky thus, critical thinking skill is necessary to
solve this problem. For example, the simultaneous equations given in question 2 cannot be
directly typed into the Matlab as it will produce error. Therefore, it is necessary to substitute
the variables into the equations manually before typing the substituted equations into Matlab.
Additionally, time management plays a very important role in this assignment as we have to
handle other units assignments, projects and tests. It is crucial to plan and allocate sufficient
time for this assignment to be completed on time. In the future, if I faced this situation again, I
will do research on the process principle of the reactor model given and incorporate the findings
into my work in order to further enhance and improve my solution. Next, I will do extra work
in developing all the other possible solutions so that I could compare all the solutions and
choose the most convincing answer.
36

Part B: Reflection on the use of a Professional Skill or Attribute


As for professional skill or attribute, I have strengthened oral and written communication skill
throughout this assignment. In my opinion, this skill is extremely important to an engineer in
a project management because engineers often have to work with people that are from different
backgrounds and cultures when they are exposed to the real workplace. By mastering the oral
communication skill, the engineers from different disciplines can build up good relationship
between each other and share new ideas that benefit the team which will then result in achieving
the goals of the project with higher efficiency. Besides, effective oral communication skill can
also help in avoiding unnecessary misunderstanding and conflict among the team members. In
addition, engineers also need to have good writing skill as they often have to deal with lots of
engineering documents. This skill can enable them to produce a formal report with proper
explanations and justifications in an understandable way. Through this, other team members
can easily understand the report and thus, help in preventing them from making any severe
mistake. In this assignment, I took the initiative to first create a Facebook group for all my
group members in order for us to have a good communication tool to communicate with each
other. This act is necessary as one of my group members is my junior which indicates that she
has other different units with mine. Hence, the created Facebook group has been fully utilized
in which we use it to discuss the availability of time slot for the meeting, conduct short
discussion during night time and exchange files. As a result, the progress of our work has been
greatly accelerated. There were few lessons that I have learnt in this assignment. Firstly, I have
learnt that it is important to have an effective oral communication among the group members
when doing a group project. It is because though communication, our ideas can be shared,
different perspective in analyzing the question can be exchanged among each other. This will
not only increase the productivity in completing this assignment but also letting us to have a
chance to learn from each other. For example, when me and my group mate, Mingjing solving
the coding error, we learnt the creativity in writing the code from each other. Secondly, I have
also learnt that good writing skill is essential in accomplishing this assignment. The workload
in this assignment is distributed among us which indicates that each of us has to produce part
of the report. Therefore, it is crucial for all of us to write and present the report in an
understandable way so that when the one who compile this assignment can easily understand
and do the cross check of the report. Thirdly, I learnt to accept other group members opinion.
When they discuss with me and gave their opinions, I will first think of the opinions given and
try to apply it to identify its applicability. For example, when Mingjing advised me to change
some part of the code, I tried to apply the changes and run the code to see whether it works or
not. In the future, if I was required to do an assignment with the people which I do not know
them. I will first try to understand each other personality, strength and weakness so as to
understand each other more and improve the outcome. Lastly, I will further improve my oral
and written communication skill so that whenever I have a similar situation, I am able to deliver
more useful information to my group members and improve the quality of the technical report.
By doing so, the assignment or project can sooner be completed.

37

Name: Syarifah Nurliza Wan Drahman


Part A: Reflection on a Technical Aspect of the Assignment
In this assignment, one technical aspect that I think is really important is the whole process to
perform the S-W Algorithm, from categorizing the variables, creating the incidence matrix and
doing the assignment to actually performing the S-W algorithm. The S-W algorithm has an
integral part in both of the questions in this assignment where without it or with any mistake in
it, we would not be able to get the correct solution. In Question 2, we did not have to perform
the S-W algorithm, but we agreed that it would make the process of determining what equations
to use and what is the correct order for the equations simpler and it would reduce the possibility
of making mistakes despite the rather long process. While it took some time to complete the
algorithm, in the end we managed to get the correct order of equations without making too
many mistakes along the way since the S-W algorithm provides us with the proper steps to
obtain the results and it is very flexible since it can be applied for different kinds of equations.
However, it is a time consuming task and it can get confusing at times, especially during the
categorizing the variables and performing the S-W algorithm. In order to obtain the optimal
solution, the S-W algorithm was performed multiple times in different ways. Through this
method, we also understood the process better and with each practice, less time was needed to
perform the algorithm. Throughout the process, I learned that it is good to be as meticulous as
possible and taking things slow is alright. Even when limited time is available, some things
should be rushed since it may lead to carelessness. I also learned that being confident with your
solution is good but double checking with your friends is even better. In a group, each person
has their own thought process and everyone will have their own way of doing things. It is good
to discuss the solution together so that the other members will be able to point out any mistake
that may have been overlooked. I believe that with my understanding and practice, performing
the algorithm would be easier in the future.

38

Part B: Reflection on the use of a Professional Skill or Attribute


In this assignment, one professional skill that I think was greatly used was teamwork. The
group has good dynamics and this makes the assignment a lot easier since everyone was doing
their own parts and we working well with each other. I believe that this skill is important in
any group work because with teamwork, the assignment would have been a lot harder since
not everyone will be doing their parts and in the end, progress would have been delayed. We
managed to finish the assignment ahead of time and I believe that this is due to the good
teamwork that we have and because everyone was doing their work. When I had trouble doing
my part of the work, my teammates were very supportive and they were a huge help throughout
the process. From what I can observe, all of us were aware of each others strengths and
weaknesses and we worked around that. Some might be better in terms of technical knowledge
or compiling or editing or cross-checking. All that matters was that we were all aware and we
used that to our advantage. Through this assignment, I realized the importance of good team
dynamics in a group. Without good dynamics, the team may not be able to work well together
and this would spell out trouble for the future. I believe that in a group work in the future, I
need to be more aware of my team dynamics and if that is lacking, I would need to do a bit of
intervention.

39

ASSIGNMENT 2 RESPONSIBILITIES
Lim Mingjing

Syarifah Nurliza
Wan Drahman
O D R F
+
+

Person

Wong Chiew Wee

Problem 1
Part (a) Variable classification
Part (b) DOF & specification
Part (c) Incidence &
assignment
Part (d) Sargent-Westerberg
Part (e) Outcome of S-W
Part (f) S-W practicalities
Problem 2
Part (a) Matlab coding, printout
Part (b) Matlab plots
Part (c) Solution verification

O
*
*

D
*
*

R
*
*

F
*
*

*
*
*
O
*
*

*
*
*
D
*
*

*
*
*
R
*
*
*

*
*
*
F
*
*
*

*
+

O
+
+
+

D
+
+
+

R
+
+
+

F
+
+
+

O
+

40

You might also like