0% found this document useful (0 votes)
7 views

CHGFile

This report analyzes eight chemical engineering problems using numerical methods and simulation tools like MATLAB, Excel, and DWSIM, focusing on real-world applications such as material balances and dynamic modeling. The results demonstrate the effectiveness of these methods, with consistent outcomes across various approaches, confirming their reliability in solving complex engineering challenges. The integration of DWSIM further enhances the understanding and optimization of chemical processes, showcasing the importance of mathematical modeling in chemical engineering.

Uploaded by

jacobdanis52
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

CHGFile

This report analyzes eight chemical engineering problems using numerical methods and simulation tools like MATLAB, Excel, and DWSIM, focusing on real-world applications such as material balances and dynamic modeling. The results demonstrate the effectiveness of these methods, with consistent outcomes across various approaches, confirming their reliability in solving complex engineering challenges. The integration of DWSIM further enhances the understanding and optimization of chemical processes, showcasing the importance of mathematical modeling in chemical engineering.

Uploaded by

jacobdanis52
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

TITLE: SOLUTION TO SOME CHEMICAL ENGINEERING

PROBLEMS USING MATHEMATICAL METHODS, MATHLAB


MICROSOFT EXCEL, AND DWSIMS

COURSE: CHEMICAL ENGINEERING ANALYSIS

COURSE CODE: CHG 433

COURSE LECTURER: DR A.O WILLIAMS

DATE SUBMITTED: 02-04-2025

GROUP NUMBER: GROUP FIVE

GROUP MEMBERS:

Jacob Daniel Ndatusung

190401025

Balogun Khalid
190401002

Olaosun Zion Timileyin


190401049

Soyinka Zion OluwaTimileyin


190401509
Executive Summary
This report presents an in-depth analysis of eight distinct chemical engineering problems, applying various
numerical methods and simulation tools, including MATLAB, Excel, and DWSIM. The primary objective
was to reinforce the application of chemical engineering principles through the use of these methods to
solve real-world engineering challenges, such as material balances, nonlinear equations, dynamic modeling,
and parameter fitting.

Problem 1 involved a chemical engineering process with three reactors operating at steady state, under the
assumption that there was neither generation nor consumption of a particular species. Material balance
equations were formulated for each reactor to determine the concentration of the species. The system of
linear equations generated was solved manually using Cramer's rule, matrix inversion, and Gaussian
elimination, as well as programmatically using Excel and MATLAB. The results obtained from all methods
were consistent, with no significant differences observed, confirming the validity of these numerical
methods.

Problem 2 focused on solving nonlinear equations. In the first part, the root of a given equation was found
using both the Newton-Raphson and interval bisection methods. The Newton-Raphson method proved more
efficient, converging within four iterations, while the interval bisection method required 26 iterations to
reach the same accuracy. In the second part, the volume of nitrogen gas was determined using the van der
Waals equation of state with MATLAB’s fsolve function. The results from both approaches were
consistent, demonstrating the efficacy of MATLAB in solving nonlinear equations.

Problem 3 involved modeling a liquid storage tank system with reasonable assumptions, such as perfect
mixing, constant liquid density, and constant cross-sectional area. A mechanistic model was derived for the
height of the liquid, and its dynamic response was determined through linear analysis. Numerical solutions
using Euler’s explicit method and the Runge-Kutta method in MATLAB were compared. As the step size
increased, Euler’s method showed less stability than the Runge-Kutta method, especially for larger flow
coefficients, highlighting the latter's advantages for stability in dynamic systems.

Problem 4 required fitting a function to rate coefficient and temperature data for a reaction using the least
squares method. The system of equations was solved manually and programmatically. While minor
discrepancies were observed between the manual and programmatic results, these were attributed to
rounding errors. Despite these differences, both approaches fitted the data well, confirming the effectiveness
of the least squares method.

Problem 5 used DWSIM to simulate a multi-component stream separation process via flash distillation.
Initially, no separation occurred due to high temperature and pressure. However, by adjusting the
temperature, successful separation was achieved, demonstrating the utility of DWSIM in simulating and
optimizing separation processes.

Problem 6 involved the separation of a five-component stream into pure fractions using DWSIM. Since a
fractional distillation column was unavailable in the software, a sequence of four distillation columns was
employed instead. The simulation successfully separated the components, and the results provided valuable
insights into the separation process.
Problem 7 simulated natural gas absorption using dodecane in a 30-stage tower in DWSIM. The component
fractions in the lean gas were determined, and the simulation effectively modeled the absorption process,
providing insight into the design and optimization of gas absorption systems.

Problem 8 focused on the production of ethyl chloride via a multi-step process in DWSIM. The process
included recycle streams and a purge stream, with an overall material balance evaluation. The simulation
results offered a comprehensive understanding of the process and its optimization, demonstrating DWSIM’s
capability in modeling complex chemical processes with recycle streams.

Throughout this assignment, the differences in results across the methods were generally less than 0.05,
which in practical applications, would be considered negligible. The graph of pressure versus volume in
Problem 2 validated Boyle’s Law, confirming the expected inverse relationship between pressure and
volume. Overall, the application of numerical methods and simulation tools, including MATLAB and
DWSIM, demonstrated their reliability and efficiency in solving complex chemical engineering problems.

This report highlights the successful application of various numerical techniques and simulation tools to
solve real-world chemical engineering problems. The accompanying tables, flowcharts, and results illustrate
the thorough analysis conducted and offer practical solutions to the challenges presented. The integration of
DWSIM simulations further enhanced the understanding of chemical processes and their optimization in a
simulated environment.
Table of Contents
Attestation of Authorship
Contributions
1. Introduction
2. Results
2.1 Section 1
2.1.1 Cramer’s Rule
2.1.2 Matrix Inverse Method
2.1.3 Gaussian Elimination
2.1.4 Spreadsheet Solution
2.1.5 Mathlab Solution
2.2 Question 2
2.2.1 Question 2a
2.2.1.1 Newton-Raphson Method
2.2.1.2 Interval Bisection Method
2.2.1.3 Spreadsheet Solution
2.2.1.4. Mathlab Solution
2.2.2 Section 2b
2.2.2.1 Spreadsheet Solution
2.2.2.2 MathlabSolution
2.3 Section 3
2.3.1 Model Derivation
2.3.2 Explicit Euler’s Method
2.3.3 Runge-Kutta 4th Order Method
2.3.4 Comparison of the two Methods

2.4 Question 4
2.4.1 Manual Solution
2.4.2 Spreadsheet Solution
2.4.3 Mathlab Solution

2.5 Question 5

2.5.1 Analysis description


2.5.2 Software analysis
2.6 question 6
2.6.1 Analysis description
2.6.2Software analysis
2.7 question 7
2.7.1Analysis description

2.7.2Software analysis
2.8 question 8
2.8.1Analysis description

2.8.2Software analysis
Attestation of Authorship
We hereby attest to the originality of our work and establish that we have not in any way copied or
reproduced the work of other groups or one that was previously submitted in the past years. All
parts of this report, including the solutions to the problems, and the attached spreadsheet and
program files, have been entirely developed by us without direct input (solution approaches were
only discussed with other groups) from any person other than those listed below.
Members

Jacob Daniel Ndatusung

190401025

Balogun Khalid
190401002

Olaosun Zion Timileyin


190401049

Soyinka Zion OluwaTimileyin


190401059
1. Introduction

A mathematical model is a structured representation of a system—whether existing or


conceptual—that captures its essential characteristics in a usable form. According to Eykhoff
(1974), a mathematical model represents knowledge of a system in a way that allows for analysis
and application. The process of constructing such a model is called modelling.

Mathematical modelling plays a crucial role in science and engineering by transforming real-world
problems into mathematical frameworks. This enables better understanding, optimization, and
decision-making. For example, in climate science, mathematical models help predict temperature
changes, ice cap melting, and extreme weather patterns using historical and real-time data. In
aerospace engineering, models simulate rocket propulsion dynamics to optimize fuel efficiency
and trajectory planning.

Beyond these fields, modelling is widely applied in chemical engineering, where it contributes
to:

 Process Design – Evaluating new plant designs for efficiency and feasibility.
 Process Control – Developing automated control systems to regulate processes.
 Process Safety – Predicting potential hazards and designing safer operational procedures.
 Troubleshooting – Identifying causes of performance deviations and system failures.
 Operator Training – Using simulations to train personnel on process handling.
 Optimization – Enhancing efficiency and sustainability in industrial operations.

Types of Mathematical Models

Mathematical models are generally classified into three types:

1. Fundamental (Mechanistic) Models – These rely on physical and chemical principles to describe system
behavior without requiring experimental data.
2. Empirical (Black-Box) Models – Built entirely on observed data without prior knowledge of system
mechanics.
3. Semi-Empirical (Hybrid) Models – A combination of theoretical and experimental approaches, often used in
reaction engineering, where rate laws blend empirical data with established physical laws.

The Modelling Process

A well-structured mathematical model follows a seven-step approach:

1. Problem Definition – Clearly stating the objective and system constraints.


2. Identification of Key Factors – Determining influential variables.
3. Data Collection & Evaluation – Gathering and analyzing relevant datasets.
4. Model Development – Formulating mathematical equations or computational algorithms.
5. Model Simulation & Solution – Applying numerical techniques to solve the model.
6. Model Verification – Ensuring the model behaves as expected under test conditions.
7. Validation & Interpretation – Comparing results with real-world data and refining the model as needed.
Conclusion

The success of a mathematical model depends not only on the depth of knowledge about the
system but also on the precision of the modelling approach. As Hangos (2001) suggests, effective
modelling can significantly improve system performance, risk assessment, and decision-making
across various scientific and engineering disciplines.
2. RESULTS
2.1 SECTION 1

The diagram below illustrates a chemical engineering process featuring three reactors—A, B, and
C—operating under steady-state conditions. With the given volumetric and mass flow rates at both
the inlet and outlet streams, our objective is to determine the concentration of the chemical
species inside each reactor.

volumetric flow rate: QAB = 40 m3/s, QAC = 80 m3/s, QBA = 60 m3/s, QBC = 20 m3/s, QCout = 150 m3/s,
mass flow rates: mCin = 195 mg/s, and mAin = 1320mg/s

Our approach to solving this chemical engineering mass balance problem is based on the
following key details and assumptions:
Steady-State Condition:
The system is in steady state, meaning the accumulation of the species in each reactor is zero.
Mass Conservation:
The species is neither produced nor destroyed in the reactors. The total incoming mass flow rate equals the total
outgoing mass flow rate.

∑(Mass flow rate into reactor i)=∑(Mass flow rate out of reactor i)

Reactor A:
mA,in + XB QBA = XAQAC + XAQAB
1320 + 60XB = 80XA + 40XA
120XA - 60XB = 1320 ---- (1)

Reactor B:
XAQAB = XBQBA + XBQBC
40XA = 60XB + 20XB
40XA - 80XB = 0 ------- (2)

Reactor C:
m c,in + XAQAC + XBQBC = XC QCout
195 + 80XA + 20XB = 150XC
80XA + 20XB - 150XC = -195 ----- (3)
We now present the manual solution to these equations via three different approaches.

2.1.1 Cramer’s Rule


Using Cramer’s rule, a solution is obtained in terms of the determinants of the coefficient matrix D,
as well as the matrices obtained from it when one column is replaced with the column vector of the
right-hand side of the equations. The determinants in this solution approach were calculated using
the det functionality on a scientific calculator.
For a system of three linear equations of the form:

a₁x + b₁y + c₁z = d₁


a₂x + b₂y + c₂z = d₂
a₃x + b₃y + c₃z = d₃

Coefficient Matrix (A):


�1 �1 �1
A = �2 �2 �2
�3 �3 �3

Constant Matrix (B):


�1
B = �2
�3

Solution using Cramer's Rule:


�� ��
�� �
x=

�� ��
�� �
y=

�� ��
�� �
z=

Modified Matrices:
�1 �1 �1
Aₓ = �2 �2 �2
�3 �3 �3

�1 �1 �1
Aᵧ = �2 �2 �2
�3 �3 �3

�1 �1 �1
Az�� = �2 �2 �2
�3 �3 �3
Determinant of a 3×3 Matrix:
� � �
For any 3×3 matrix:

M= � �
� � �

The determinant is calculated as:


det(M) = p(t * x - u * w) - q(s * x - u * v) + r(s * w - t * v)

Condition for Application:


Cramer's Rule is valid only if det(A) ≠ 0, ensuring the system has a unique solution.

Considering our system of equations developed earlier:


120XA - 60XB = 1320 --- (1)
40XA - 80XB = 0 --- (2)
80XA + 20XB - 150XC = -195 --- (3)

Solving for X A , XB, and XC we have

1320 −60 0
0 −80 0
DXA −195 20 −150 1.58 � 107
� 120 −60 0 1.08 �106
XA = = = = 14.67 mg/m3
40 −80 0
80 20 −150

120 1320 0
40 0 0
DXB 80 −195 −150 7.92 � 106
� 120 −60 0 1.08 �106
XB = = = = 7.33 mg/m3
40 −80 0
80 20 −150

120 −60 1320


40 −80 0
DXC 80 20 −195 1.09 � 107
� 120 −60 0 1.08 �106
XC = = = = 10.1 mg/m3
40 −80 0
80 20 −150

2.1.2 Matrix Inverse Method


Using the matrix inverse method, we can decompose the equations into the shorthand form
AX=b

where A is the matrix of coefficients, X is the vector of unknown variables, and b is the vector of
values on the right side of the equations. Solution of X is obtained by pre-multiplying both sides by
the inverse of the matrix of coefficients, giving
X =A 1 b
1
A 1= �� � × adj( A)
120 −60 0
det A = 40 −80 0 = 1.08 �106
80 20 −150

The adjoint of matrix A is the transpose of the matrix of cofactors of A and is obtained as follows

+ −80 0 − 40 0 + 40 −80
120 150 120 −150 80 20
−60 0 + 120 0 120 −60
adj A = − −
20 −150 80 −150 80 20
T

+ −60 0 −
120 0 + 120 −60
−80 0 40 0 40 −80

12000 6000 7200 12000 −9000 0


adj A = −9000 −18000 −7200 6000 −18000 0
0 0 −7200 7200 −7200 −7200
T =

12000 −9000 0
Therefore,

6000 −18000 0
1

7200 −7200 −7200


1.08� 106
A-1 =

��
12000 −9000 0 1320
�� = 6000 −18000 0 0
1
1.08� 106
��
7200 −7200 −7200 −195

�� 1.58 � 107 14.67


�� = 7.92 � 107 = 7.33
1

10.10
1.08� 106
�� 1.58 � 107
2.1.3 Gaussian Elimination
In this approach, we transform the augmented matrix A i nto an upper triangular matrix through
elementary row operations and then obtain the complete solution via back substitution. The
augmented matrix is given below.

120 −60 0 \ 1320


A = 40 −80 0 \ 0
80 20 −150 \− 195

The first row operation seeks to turn the first entry in row 2 to zero as shown below
1
R2 - 2 �3 R2
120 −60 0 \ 1320
A= 0 −90 75 \ 97.5
80 20 −150 \− 195

120
80
R3 - R2 R3

120 −60 0 \ 1320


A= 0 −90 75 \ 97.5
0 90 −225 \− 1612.5

R3 + R2 R3

120 −60 0 \ 1320


A= 0 −90 75 \ 97.5
0 0 −150 \− 1515

From here we quickly observe that

= 10.1
−1515 푚
−150 푚3
XC =

Upon back substitution,


-90XB + 75XC = 97.5

= 7.33
75(10.1) − 97.5 푚
90 푚3
XB =

120XA - 60XB = 1320

= 14.67
1320 − 60(7.33) 푚
120 푚3
XA =

2.1.4 Spreadsheet Solution


The three equations were typed in cells A2 to A4. In cells C2 to C4, these equations are entered as
formulas. Cells D2 through D4 hold the values we want these formulas to return.
Before a solution was found, we initialised cells B7 through B9 with ones (any other values could have
been used).
Next, we used the Solver add-in program. In the Solver dialog box, cells B7 to B9 were designated as the
variables to be adjusted to reach the final solution. We also applied three constraints: the values in cells C2
to C4 had to match those in cells D2 to D4. Additionally, since the concentration of the species cannot be
negative, we ensured that the appropriate constraint was applied.

Finally, we selected the Simplex LP solving method, as our equations were linear. With these settings in
place, we solved the problem by clicking the Solve command in the dialog box. The final solution is shown
in the last figure.
2.1.5 MathLab Solution
MathLab offers a very quick and easy way to solve this system of linear algebraic equations. In the
snapshots that follow, the coefficient matrix has been assigned to the variable “A” while the vector of values
on the right side of the equations have been assigned to “b”. The solution is found by obtaining the dot
product between the inverse of A and the vector b (note that the order matters, else it would violate the
matrix compatibility rule).

Output
2.2 Question 2

2.2.1 Question 2a
2.2.1.1 Newton-Raphson Method
Given:
RT =Ro (1+ AT +B T 2 +C T 4 + T6 )
R0 (resistance of the detector at 00C )=100 Ω

A=5.485× 10-3 , B=6.65× 10-6 ,C=2.805 ×1 0-11 , D = −2 ×1 0-17 , RT =300 Ω

We desire to determine the temperature of the material at RT using the Newton-Raphson algorithm.
The algorithm requires an initial guess value and is expressed as follows:

Ti = Ti -1 −
f(T)
f ' (T)

We must first express the equation given in the form f (T )=0 after which the derivative of this function, f '
(T ) is computed. On substituting R0and RT into the equation we have:

f(T) = AT + BT2 + CT4 + DT6 − 2


f '(T) = A + 2BT + 4CT3 + 6DT5

Noting that the coefficients of T in f (T ) are very small, we could assume that powers of T higher than 1
are negligible. Thus,

g(T) = AT − 2 = 0

5.485 x 10−3 T − 2 = 0

5.485 x 10−3 T = 2

T = 364.630C

This exercise has provided for us a reasonable starting value and we can now employ the algorithm to find
T 1.
�(�0 ) = 5.485 � 10−3 �0 + 6.65 � 10−6 �20 + 2.805 � 10−11 �40 − 2 � 10−17�60 − 2
�( �0 ) = 1.3330

�'(�0 ) = 5.485 � 10−3 + 2(6.65�10−6 �0 ) + 4(2.805 � 10−11�30 ) − 6(2 � 10−17�50 )

�'(�0 ) = 0.015
�1 = �0 −
�(�0)
�'(�0)

�1 = 364.63 − = 275.7630 �
1.3330
0.015
This process is repeated three times and the results are shown below:

�2 = 260.5820 �, �3 = 260.2190�, �4 = 260.2190 �

In just 4 iterations, the Newton-Raphson method converges to a root with an error of about 10-8.
Compared to the next method we will see, this is much faster.

2.2.1.2 Interval Bisection Method


Using the same equation and parameters in the previous solution, we could guess that the actual root of
the equation lies between 200 (which we will call a) and 300 (we call b). Then by iteration, we find the
middle of this interval, c. We want f (c ) to be as close to zero as possible. Because a is on the left side, f
(a) is less than 0, while f (b)is greater than 0. If f (c ) >0, then b is discarded and the root must now lie
between a and c. Otherwise, if f (c ) <0, then the root must now lie between c and b.
Below, we show the first two iterations.

a = 200, b = 300, c = 2 = 250


a+b

f(a) = − 0.59340, f(b) = 0.45663, f(c) = − 0.10844

Because f(c) > f(a), a now takes on the value of c while b remains the same. Then we repeat the process
above. With 16 iterations, the final value of T is 260.21881°C with an error of 10-6.

a+b
a = 250, b = 300, c = = 275
2
f(a) =− 0.10844, f(b) = 0.45663, f(c) = 0.16305

s/N a b c f(a) f(b) f(c)


0 200 300 250 -0.5934 0.4566 -0.1084
1 250 300 275 -0.1084 0.4566 0.1631
2 250 275 262.5 -0.1084 0.16305 0.02468
3 250 262.5 256.25 -0.1084 0.02468 -0.04252
4 256.25 262.5 259.375 -0.04525 0.02468 -0.009083
5 259.375 262.5 260.9375 -0.00908 0.02468 0.007757
6 259.375 260.9375 260.15625 -0.00908 0.00776 -0.000673
7 260.15625 260.9375 260.54688 -0.00067 0.00776 0.0035396
8 260.15625 260.546875 260.35156 -0.00067 0.00354 0.0014327
9 260.15625 260.351563 260.25391 -0.00067 0.001433 0.0003797
10 260.15625 260.253906 260.20508 -0.00067 0.00038 -0.000147
11 260.20508 260.253906 260.22949 -0.000147 0.00038 0.0001165
12 260.20508 260.229492 260.21729 -0.000147 0.000117 -1.5E-05
13 260.21729 260.229492 260.22339 -1.51 E-05 0.000117 5.073E-05
14 260.21729 260.223389 260.22034 -1.51 E-05 5.07 E-05 1.783E-05
15 260.21729 260.220337 260.21881 -1.51 E-05 1.78E-05 1.381E-06
Table 2.1 Results from interval bisection method

With just 4 iterations, the Newton-Raphson method converged to a solution with an error of the order 10-8
which is quite impressive. On the other hand, with 16 iterations, the interval bisection method is still unable
to find a solution as close as possible to that obtained via Newton-Raphson.
Infact, in order to get as close, we would require 26 iterations. We have paused at the fifteenth iteration for
the interval bisection method because we expect that in all practicality, the results obtained via the two
methods would not make that much of a difference in application.
2.2.1.3 Spreadsheet Solution
We assigned the value of T and RT to the cells B11 and B14 respectively. We also assigned cells B6, B7,
B8, B9 and B10 to the given fixed values of R, A, B, C, and D respectively. Using Excel’s “goal seek”, we
obtained the value of T = 260.19747 o C that made Eq. equal to 300.

2.2.1.4.MathLab solution

Three functions were created, one to determine the residue, and another, which was an implementation of
the interval bisection algorithm that has been discussed earlier. The tolerance was set to 10-6 and the
program was run. After 18 iterations, the algorithm converged to a solution.
output:

for a resistance of 300ohms the output temperature is 260.216. resukt obtained with a tolerance
level of 0.000001.
2.2.2 Section 2b
In this problem, we are required to determine the volume of Nitrogen gas at 298 Kelvin and at
specified pressures using the van der Waals equation of state given by:

nRT n2 a
P = −
V − nb V

f(v) = PV3 − (Pnb + nRT)V2 + (n2 ab)V − n3 ab = 0


The above equation is rewritten as follows:

The following parameters have been provided:


n=1.5 mol, R=0.08206 L . atm/(mol .K ) ,a=1.39 L2 .atm /mol2 ,
b=0.03913 L/mol ,T =298 K , P=13.5 atm

2.2.2.1 Spreadsheet Solution


In the excel spreadsheet below, the parameters specified in the problem were entered in the range A1:C7
together with their values and their units. The pressure determination of the system for each percentage
above the base pressure was carried out in the range A10:I10. For instance, given the base pressure of

15
13.5 atm, 15% above this pressure would be
(13.5) + 13.5 = 15.525atm
100
The formula for this can be seen in the text box (follow the arrow that emanates from cell C10).
Also note the use of absolute references because the formulas would be copied to other cells. In the range
A11:I11, the ideal gas volume was calculated, and the values obtained were passed down to the range
A12:I12 which were to be used as the starting values for the “goal seek” approach.

To use the goal seek functionality, we navigated to the What-if Analysis button on the Data tab and
selected goal seek. In the dialog box that was opened, we set the cell B13 to 0 by changing cell B12. This
was done repeatedly for each cell from B13 to I13, remembering to input the cells accordingly in the goal
seek dialog.
The final solution as well as the plot we generated are presented below.

2.2.2.2 MathLab Solution


The v an der Waals equation of state was expanded and rearranged to the following form where the right-

f(v) = PV3 − (Pnb + nRT)V2 + (n2 ab)V − n3 ab = 0


hand side of the equation was 0.

The known parameters were instantiated, and using the equation above, a custom function was created to
return the residue obtained for a given pressure and volume. We want this residue to be equal to zero as
seen in the previous equation.
Below, we present the output on the Mathlab console and the plot that was generated.
2.3 Section 3
The schematic diagram below represents a liquid tank system where the inlet and outlet flows are
volumetric quantities.

2.3.1 Model Derivation

In deriving a model for this problem, we make the following assumptions:


1. The density of the liquid is constant.
2. The tank is cylindrical and has a constant cross-sectional area so that the volume of
liquid in the tank is simply a product of the cross sectional area and the height of liquid.
3. There are no spatial variations (perfect mixing)
4. There is no consumption or generation of material in the tank.
5. The flow coefficient, Cv is 10.

Mass balance around the tank is carried out as follows:

Accumulation =Input−Output +Generation −Consumption

Since the system involves no reactions, the generation and consumption terms are zero. Therefore
the material balance equation reduces to:

Accumulation=Input – Output

The mass of liquid is a product of its volume and its density. Thus, the flow of liquid in and out can
be represented by ρ qi ∧ ρq. Substituting these into the material balance equation, we have
Noting that V = A h and that the liquid density and the cross sectional area are constant terms
which can be brought out of the derivative, we have

(b). Equation 2.3.1 is a lumped parameter, nonlinear model.

= 0
�ℎ

(c). Assuming A = 100cm2, and the steady state inflow, q =10 c m3/ s. At steady state,
i

Therefore,

Taking Cv, the flow coefficient, as 10, then the steady state height becomes h=1 cm.

(d). If the operator of the tank suddenly changes the inlet flow from the initial steady state by 50%
and maintains it at the new value, then the liquid level is subjected to a dynamic response.
Assuming this change represents an increase in inlet flow, then q i =1.5∗10=15 c m3 / s . To obtain
the system transfer function, we must now linearize the differential equation about the steady-state
conditions (h , q i )
The deviation variables are h ' = h− h∧qi '=qi−qi. Applying taylor series linearization method
presented below where f (h , qi)is the right hand side of Eq.2.3.1, the linearized differential
equation is given by Eq.2.3.3.

qi ' =qi−qi=15−10=5 c m3/ s , h ' =h−h=h−1. Substituting all known parameters into Eq.2.3.3, we have
Using Laplace transform to solve the ODE, we get

Using partial fractions to decompose the second term on the right side of the equation and then
taking inverse laplace transforms, the solution to the differential equation becomes

The above equation is a closed form expression for the dynamic response of the liquid level to the
operator’s command. . `

2.3.2 Explicit Euler’s Method


For the same input as in part d above, we now implement the explicit euler’s method to determine
the dynamic response for the system using SCILAB. The graph is shown below for various step
sizes. A snapshot of the code is also shown.
2.3.3 Runge-Kutta 4th Order Method
For the same input as in part d above, we now implement the runge-kutta method to determine the dynamic
response for the system using Mathlab. A snapshot of the plot is shown below.
2.3.4 Comparison of the two Methods

It can be observed that as the step size decreases, the discrepancies between the two results
increases. And indeed, if we toggle around with the flow coefficient, we observe that for high
values, the explicit euler method becomes less stable. Thus, the runge-kutta method is more
accurate than the explicit euler method.
2.4 Question 4
Given the following data
T(K) 595 623 761 849 989 1076 1146 1202 1382 1445 1562
Kx 2.12 3.12 14.4 30.6 80.3 131 186 240 489 604 868
1020(m3/s)

We wish to use the method of least squares to best fit the following function to the data:

The coefficients C, b, and D are found by differentiating the sum of square residuals with respect to
each variable and setting the values equal to zero to obtain:

2.4.1 Manual Solution


N is the number of data points, which for this problem is 11. The table below summarises the
values required to solve this system of equations.

K*E^ -20 In(T) 1/T In(K) (InT)^ 2 (1/ I/Tin(K) In(T)In( K) In(T)1/
T(K) T)^ 2*1 T
0^-6

595 2.12 6.3886 0.00168 -45.3003 40.8142 2.8224 -0.0761 -289.406 0.0107

623 3.12 6.4345 0.00161 -44.9139 41.4028 2.5921 -0.0723 -288.999 0.0103

761 14.4 6.6346 0.00131 -43.3845 44.0179 1.7161 -0.0568 -287.839 0.00869

849 30.6 6.7441 0.00118 -42.6307 45.4829 1.3924 -0.0503 -287.506 0.00796

989 80.3 6.8967 0.00101 -41.6659 47.5645 1.0201 -0.0421 - 287.357 0.00697

1076 131 6.9810 0.00093 -41.1765 48.7344 0.8649 -0.0383 - 287.453 0.00649

1146 186 7.0440 0.00087 -40.8260 49.6179 0.7569 -0.0355 - 287.578 0.00613

1202 240 7.0917 0.00083 -40.5710 50.2922 0.6889 -0.0337 -287.717 0.00589
1382 489 7.2313 0.00072 -39.8593 52.2917 0.5184 -0.0287 - 288.235 0.00521

1445 604 7.2759 0.00069 -39.6481 52.9387 0.4761 -0.0274 - 288.476 0.00502

1562 868 7.3537 0.00064 -39.2855 54.0769 0.4096 -0.0251 -288.894 0.00471

- 3169.459
❑ 76.0761 0.01147 -459.262 527.2341 13.2579 -0.4863 0.07816
∑❑

Substituting necessary values into the matrix, we get the following

Entering these equations directly into the calculator, we obtain the following solution:

C=−60.9316 , b=3.2009 , D =2836.0617

Having determined C, b, and D, the next task is to find the values of A and EA from the Arrhenius
equation. From the problem this has been provided as

Comparing this equation with equation with the equation of best fit we get that:

2.4.2 Spreadsheet Solution

We tabulated the given values of K and T in our spreadsheet, then evaluated the values of ln(k),
1/T and ln(T) using Excel built-in functions.
K*10^ 20 T(K) K In(K) 1/T In(T)
2.12 595 2.12E-20 -45.3003 0.001681 6.388561
3.12 623 3.12E-20 -44.9139 0.001605 6.434547
14.4 761 1.44E-19 -43.3845 0.001314 6.634633
30.6 849 3.06E-19 -42.6307 0.001178 6.744059
80.3 989 8.03E-19 -41.6695 0.001101 6.896694
131 1076 1.31E-18 -41.1765 0.000929 6.981006
186 1146 1.86E-18 -40.8260 0.000873 7.044033
240 1202 2.40E-18 -40.5711 0.000832 7.091742
489 1382 4.89E-18 -39.8593 0.000724 7.231287
604 1445 6.04E-18 -39.6481 0.000692 7.275865
868 1562 8.68E-18 -39.2855 0.00064 7.353722

We then added an add in called analysis Toolpak, which contains the regression analysis function
then we selected the regression function in the data analysis tools.
From the snapshot above, the intercept, X variable 1, and X variable 2, represent the parameters
C, b, and D. Therefore, C=−52.4427 , b=2.121598 ,
��
� =

Ea = RD

D = 2836.0617

Ea = 2836.0617 (8.314) = 23578.017 J/mole

2.4.3 MathLab Solution


The necessary Mathlab functions were used to obtain all the sum values as shown in the code
snippet below. The matrix of coefficients was defined and the results obtained using the backslash
operator.
15
2.2 Section 5
The following is the initial consideration for this paper:
A straightforward flash vaporization procedure was to be used to separate a hydrocarbon mixture
comprising 21% n-butane, 60% n-pentane, and the remaining n-hexane at 10 atm and 270 degrees
Fahrenheit. The process's schematic is displayed below:

Three distinct thermodynamic/property packages were employed to solve this problem in DWSIM.

2.5.1 Description of the Analysis


A new process modeling sheet was made at the start of the simulation, and the compounds required
for the simulation, the property packages, and the system of units were chosen. Three material
streams—feed, distillate, and bottoms—as well as an energy stream and a unit operating column were
chosen to carry out the absorption on the sheet. A gas-liquid separator was the chosen unit operation.
The streams were then linked to the unit operation, and the unit operation's parameters were
established. The heat requirement, distillate, and bottoms compositions and qualities were
automatically computed, and the feed composition, temperature, and pressure were also provided. To
tabulate the results, a master property table was used.
The Lee-Kesler-Plocker, Raoult's law, and Peng-Robinson property packages were chosen.

2.5.2 Analysis of Software


It is crucial to remember that separation was not possible due to the problem's design conditions.
As can be seen below, all of the feed moved to the distillate due to the temperature and pressure that
were applied, and the bottom stream's molar flow rate was zero.

16
This is because the heaviest component has a boiling point below 270°F at 10atm.
Instead, changing the temperature was taken into consideration because pressure vessels are
typically stated.
Trials revealed that separation was only possible at temperatures below 263°F and above 243°F. This
is to be expected, as the compounds' boiling points fall within this range at the pressure specified.
A temperature of 260°F was chosen and calculated using the three property packages in order to
achieve separation. The outcomes are listed below:

17
2.3 Section 6
A refinery stream with the following conditions is at 75°F and 100 psia:

COMPONENT FLOWRATE (Ib.mol/hr)

Propane 100

i-Butane 300

n-Butane 500

i-Pentane 400

n-Pentane 500

TOTAL 1800

The objective was to identify the unit operation that would do the separation the most effectively and to
divide this stream into five streams, each of which would be a relatively pure stream of a single
component. The separation trains were used to tabulate the mass fluxes for each stream.
2.6.1 Description of the Analysis

The DWSIM program was used to model the issue. The necessary substances for separation were
chosen, and a new process modeling flow sheet was constructed. To calculate a solution for the
flowsheet, the Peng-Robinson/Lee-Kesler Thermodynamic property program was utilized.
Fractional distillation is the unit operation that would most effectively carry out the separation of the
light hydrocarbons, according to the knowledge gained from the Separation Techniques 1 and 2
courses. The components' relative volatility is to blame for this. Nevertheless, a column for fractional
distillation is absent from the software.
By using four distillation shortcut columns in sequence, the solution was improvised. The column for
shortcuts was chosen in order to prevent assuming details about the design challenge, such as the
quantity of plates and other attributes.
The first distillation column was tasked with separating the propane into a rather pure stream into the
top product after the feed parameters specified in the question were set. The remaining compounds
were to remain in the bottom stream. This was accomplished by setting the mole fractions of the
"heavy key compound" (isobutane, the next most volatile component) in the top stream and the "light
key compound" (propane) in the bottom stream to 0.01. In this manner, the vapour stream's maximum
propane percentage was more than 98%.
The next most volatile chemical was separated by feeding the bottom stream into a second distillation
column.

18
To obtain relatively pure streams of isobutane, n-butane, and isopentane in the vapour streams of
columns 2, 3, and 4, respectively, as well as n-pentane in the liquid stream of column 4, the
aforementioned step was repeated.
Lastly, a Master Property Table was included that included the phases in each stream, the molar
fractions of each component, and the mass and molar flow rates.
2.6.2 Software
Analysis

19
2.3 SECTION 7

Natural gas contains mostly methane but also small amounts of other chemicals that are

valuable in themselves. In a refrigerated absorption process, the natural gas is cooled to

240oF at 865 psia and sent to an absorber, which uses dodecane as the absorbing media,

with a flow rate of 10,000 lb mol/h. The task in this section was to determine the fraction of

each of the chemicals absorbed in a tower with 30 stages.

2.7.1 Analysis Description

After setting up the process flowsheet, the necessary compounds were added, and
an appropriate thermodynamic property package and unit system were selected. Two
feed streams were introduced: one containing pure dodecane as the absorbing
medium and the other representing the natural gas stream. An absorption column
was integrated, ensuring all material streams were correctly connected. The molar
flow rates of each component were specified according to the problem statement,
and the column was configured with 30 stages as required. The natural gas feed
conditions were set to 24°F and 865 psi. With all parameters defined, the simulation
was executed to obtain the results.

20
2.7.2 Software Analysis

21
2.3 SECTION 8

Ethyl chloride is manufactured in an integrated process, as shown in the figure below:

Ethane reacts with chlorine to make ethyl chloride and hydrogen chloride, and ethylene

reacts with hydrogen chloride to form ethyl chloride according to the equation below.

The process is fed with three streams: ethane, ethylene, and chlorine. The feed stream

contains 100 mol/h of each: ethane, ethylene, and chlorine. The ethane/ethylene stream also

contains 1.0% acetylene and carbon dioxide. (For this problem, just use 1% carbon dioxide.)

The feed streams are mixed with an ethylene recycle stream and go to the first reactor

(chlorination reactor), where the ethane reacts with chlorine with a 95% conversion per pass.

The product stream is cooled, and ethyl chloride is condensed and separated. It is assumed

that all the ethane and ethyl chloride go out in the condensate stream. The gases go to

another reactor (hydrochlorination reactor) where the reaction with ethylene takes place with

a 50% conversion per pass. The product stream is cooled to condense the ethyl chloride,

and the gases (predominantly ethylene and chlorine) are recycled. A purge or bleed stream

takes off a fraction of the recycle stream (use 1%).

22
This process was simulated on DWSIM, and the complete material balance for this process

was determined.

2.8.1 Analysis Description

The simulation utilized the Raoult's Law property package. Two feed streams, each
containing chlorine, ethylene, and ethane at a flow rate of 100 mol/hr per component,
were introduced into a stream mixer. The mole fractions of ethylene, ethane, and a
carbon dioxide impurity in the ethylene-ethane stream were set at 0.495, 0.495, and
0.01, respectively.

The mixed stream (chlorination feed) was then directed into a conversion reactor,
where the first reaction occurred with a 95% per-pass conversion. The chlorination
product was subsequently cooled and routed to Compound Separator CS-01. The top
outlet stream from CS-01 (hydrochlorination feed) was fed into a second conversion
reactor, where ethane reacted with hydrogen chloride, achieving a 50% conversion to
form the hydrochlorination product.

This product was then processed in a second Compound Separator (CS-02). The
bottom stream was cooled and combined in Mixer-02 with the bottom stream from
CS-01, producing the final ethyl chloride product. Meanwhile, the top stream from
CS-02 was split into a purge stream and a chlorine stream, with the latter being
recycled back into Mixer-01. The overall material balance of the process is detailed in
the following section.

23
2.8.2 Software Analysis

24
25
3. Discussion of Results
In this chapter, we describe the events that occurred in each section, the challenges we
encountered, and the strategies we used to overcome them.

In Section 1, we analyzed a chemical engineering process involving three reactors


operating at steady state. By performing material balances on the reactors, we
determined the concentration of a specific species (x) in each reactor using Cramer's
rule, matrix inversion, and Gaussian elimination. The obtained concentrations for Xa,
Xb, and Xc were 14.67, 7.33, and 10.1 mg/m³, respectively. Upon comparison, these
values were consistent, both with each other and with the programmatically calculated
values.

In Section 2, we explored the relationship between a resistor's resistance and its


temperature, modeled by a polynomial of up to the sixth degree. The task was to find
the temperature of the resistor for a resistance of 300 ohms, which we did manually
using the Newton-Raphson and Interval Bisection methods. After four iterations of
the Newton-Raphson method, the temperature was determined to be 260.21868°C.
After 15 iterations of the Interval Bisection method, the temperature was found to be
260.21881°C. Notably, the Newton-Raphson method converged to a solution with an
error of the order of 10⁻⁸ in just 4 iterations, while the Interval Bisection method
required 26 iterations to achieve comparable accuracy. However, we stopped the
Interval Bisection method at the 18th iteration, as we felt the results would not
significantly differ in practice.

We also solved the problem using a spreadsheet and MATLAB. The spreadsheet
method, using the Goal Seek function, gave a temperature of 260.21870°C, differing
by only 0.00011°C from the Newton-Raphson result. Using MATLAB, the
temperature was 260.218811°C, which matched the Newton-Raphson result exactly.

In Section 2b, we worked with the van der Waals equation, which describes the
relationship between the pressure and volume of a gas. Using the constants for
nitrogen gas, we calculated the volume (V) for a base pressure of 13.5 atm, obtaining
a value of 2.6915 L. We repeated the calculations for pressures at 15%, 30%, 45%,
60%, 75%, 90%, and 105% of the base pressure, tabulating the pressure and volume
values. A graph of pressure versus volume was plotted and included in the report,
which confirmed that Boyle’s Law holds (i.e., pressure is inversely proportional to
volume).

In Question 3, we modeled a liquid tank system. Several assumptions were made to


simplify the model and enhance its solvability. A mass balance was performed around
the tank, and we derived an expression describing the relationship between the rate of
change of the water height in the tank and the inlet flow rate. The resulting model was
a lumped-parameter, non-linear system. The ODE was solved using the Laplace
transform, yielding the expression for height, h(t) = 2 – e⁻⁰⁰⁵ᵗ.

In Question 4, we were given a linearized version of the Arrhenius equation and asked
to use the method of least squares to fit a function of the form ln(k) = C + b ln(T) -
D/T to the experimental data. Through manual calculations, we found C = -60.9316, b
= 3.2009, and D = 2836.0617. With these values, we calculated A and Ea numerically.
A was found to be 3.449 × 10⁻²⁷ and Ea was 23,579 J/mol. The results obtained
through the spreadsheet method showed negligible differences.

The remaining four section presents an analysis of the results obtained from
the study. It provides an overview of the achieved outcomes, validation of
results, challenges encountered, solutions applied, and key lessons learned.

Section 5: Separation of n-Butane, n-Pentane, and n-Hexane

This section focused on a chemical engineering separation process involving


three components: n-butane, n-pentane, and n-hexane. The objective was to
determine the concentrations of the species after separation using the
DWSIM simulation software with three different property packages: Peng-
Robinson, Raoult’s Law, and Lee-Kesler-Plocker.

Initially, at the given problem conditions (270°F and 10 atm), no separation


was observed. The entire feed composition was found in the distillate, while
the molar flow rate of the bottoms was zero. Through trial and error and prior
knowledge of flash vaporization, it was determined that the temperature and
pressure settings were too high for separation. Since temperature
adjustments were more feasible than pressure changes, the temperature was
reduced to 260°F, successfully achieving separation in all three property
packages.

The mole fractions of the components after separation for each property
package are summarized in the table below:

Distillate Bottoms
Property Flow Rate
Mole Mole Temperature (°F)
Package (lbmole/hr)
Fractions Fractions
Peng- 0.24 n-B, 0.60 0.12 n-B, 0.59 77.1 (Distillate),
260 (Both)
Robinson n-P, 0.16 n-H n-P, 0.29 n-H 22.9 (Bottoms)
Raoult’s 0.25 n-B, 0.61 0.10 n-B, 0.59 72.5 (Distillate), 257.6 (Distillate),
Law n-P, 0.14 n-H n-P, 0.31 n-H 27.5 (Bottoms) 241.7 (Bottoms)
0.23 n-B, 0.60 0.12 n-B, 0.59 80.1 (Distillate), 263.5 (Distillate),
LKP
n-P, 0.16 n-H n-P, 0.29 n-H 19.86 (Bottoms) 260 (Bottoms)

All three property packages provided similar separation results. However, the
temperature remained constant in the still, feed, bottoms, and distillate for the
Peng-Robinson property package, whereas temperature variations were
observed in the other packages, with Raoult’s Law exhibiting the most
significant temperature change.

Challenges Encountered:

Determining the appropriate temperature for separation.


Section 6: Separation of a Five-Component Stream

This section involved the separation of a stream containing five components


(propane, i-butane, n-butane, i-pentane, and n-pentane) into five relatively
pure product streams. This was achieved using a series of four distillation
columns, resulting in product streams with mole fractions above 99.6%.

Challenges Encountered:

Extensive trial and error were required to achieve meaningful results.

Section 7: Absorption of Natural Gas Using Dodecane

An absorption process was conducted to determine the fraction of each


chemical absorbed in a 30-stage absorption tower. The final composition of
the lean gas was as follows:

 94% Methane
 3.6% Ethane
 1.4% Propane
 0.4% Isobutane
 0.3% n-Butane
 0.07% Iso-pentane
 0.015% n-Pentane
 0.0001% n-Hexane
 Remainder: Dodecane

Challenges Encountered:

I. Difficulties in specifying the absorption column parameters.


II. Initial discrepancies in the absorbent oil and natural gas indices,
which were out of bounds.

Section 8: Manufacture of Ethyl Chloride

This section examined the production of ethyl chloride using an integrated


process with two recycle streams. A series of reactions was conducted,
accompanied by a purge stream. The overall material balance was evaluated,
revealing the following:

 Entry stream: 204 mol/hr


 Ethyl chloride product stream: 202.52 mol/hr
 Remaining stream: Purge stream

Challenges Encountered:
The simulation was complex and required significant time to achieve
accurate results.

Validation of Results

The obtained results were reasonable given the available data and problem
constraints. Each simulation aligned with theoretical expectations, confirming
the accuracy and reliability of the methods applied.

Lessons Learned

This assignment provided valuable experience in simulating and optimizing


chemical engineering processes using DWSIM. Key takeaways include:

Effective teamwork and coordination in solving engineering problems.

Application of separation techniques using simulation software.

Process optimization through iterative parameter adjustments to achieve


optimal solutions.

4. Conclusion

The purpose of this assignment was to apply the numerical methods introduced in this
course to solve real-world chemical engineering problems. From the data derived, it
was evident that the differences in the results were often less than 0.05, which, in real-
world applications, could be considered negligible and would not significantly impact
the problems they are applied to.

One key observation was the graph of pressure versus volume, which validated
Boyle’s Law, confirming that the pressure of a gas is inversely proportional to the
volume it occupies. While some noticeable variations were observed, these
discrepancies can be attributed to errors during approximation for the hand-solved
solutions.

The assignment also served to assess and reinforce knowledge in Chemical


Engineering Analysis (CHG 433), with the use of DWSIM simulation software to
evaluate four distinct problems:

Problem 1 involved the separation of a multi-component stream using flash


distillation with three property packages. Initially, no separation occurred due to high
temperature and pressure, but successful separation was achieved by lowering the
temperature.

Problem 2 required the separation of a five-component stream into pure fractions.


Given the absence of a fractional distillation column in DWSIM, a sequence of four
distillation columns was used as an alternative solution.
Problem 3 focused on natural gas absorption using dodecane in a 30-stage tower,
with the component fractions determined in the lean gas.

Problem 4 explored the production of ethyl chloride via a multi-step process


involving recycle streams and a purge stream, with an overall material balance
evaluation.

Each problem was systematically analyzed, and reasonable solutions were obtained.
The necessary tables and flowcharts have been included in the report for further
reference.

You might also like