0% found this document useful (0 votes)
103 views39 pages

Group 9 Assignment 1

The document reports on the solutions to various modelling problems using numerical methods, spreadsheets, and Scilab. It presents the work of a group of four chemical engineering students. The problems addressed include: (1) solving a system of linear equations representing material balances in three reactors using analytical and numerical methods, (2) finding roots of nonlinear equations using Newton-Raphson, bisection, spreadsheets, and Scilab, (3) numerically modeling liquid level in a storage tank using Euler's method and Runge-Kutta, and (4) fitting rate data to an equation using least squares. The results obtained from different solution methods were consistent, and the document discusses the findings and conclusions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views39 pages

Group 9 Assignment 1

The document reports on the solutions to various modelling problems using numerical methods, spreadsheets, and Scilab. It presents the work of a group of four chemical engineering students. The problems addressed include: (1) solving a system of linear equations representing material balances in three reactors using analytical and numerical methods, (2) finding roots of nonlinear equations using Newton-Raphson, bisection, spreadsheets, and Scilab, (3) numerically modeling liquid level in a storage tank using Euler's method and Runge-Kutta, and (4) fitting rate data to an equation using least squares. The results obtained from different solution methods were consistent, and the document discusses the findings and conclusions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Solution of Modelling Problems Using

Numerical Methods, Spreadsheet, and Scilab

A Report Presented to
The Department of Chemical Engineering

By
Group 9

In Partial Fulfilment of the Requirements for the Course


CHG 433: Chemical Engineering Analysis
University of Lagos, Lagos
November 22, 2022

Group Members

Olamilekan O. Adenusi *(170401059)

Zainab O. Idris (170401031)

Gabriel I. Kasali (170401008)

Immaobong E. Udoh (180401508)

*Corresponding Author:

Olamilekan O. Adenusi; [email protected]

Course Lecturer:

Almoruf, O. F. Williams, Ph.D; [email protected]


Executive Summary
The first problem was a chemical engineering process application which involved three reactors
operating at steady state and under the assumption that for a particular species, there was neither
generation nor consumption. Material balance equations were written for each reactor in order to
determine the concentration of that species in them. The system of linear equations generated was
solved manually with Cramer’s rule, matrix inversion method, gaussian elimination, and then
programmatically with Excel spreadsheet and Scilab. In all cases, the results obtained were the
same.

In the second problem, we were tasked with finding the root of nonlinear equations. For the first of
the two questions posed, the root of the given equation was found manually using both Newton-
Raphson’s and the interval bisection algorithms. This problem was also solved using Excel’s goal
seek functionality and by implementing the interval bisection algorithm from scratch in scilab.
Without doubt, the Newton-Raphson method bested the interval bisection method in converging to
a solution under 4 iterations compared to the interval bisection method which required 26 iterations
for the same level of accuracy. In the second of the two questions, we exploited scilab’s fsolve
function to find the volume of Nitrogen gas using van der Waals’ equation of state.

In the third problem, we derived a mechanistic model for the height of liquid in a liquid storage
tank. The modelling process was simplified via reasonable assumptions such as perfect mixing,
constant liquid density, and constant cross sectional area. A closed form expression for the
dynamic response of the liquid was obtained using linear analysis, after which the dynamic
response of the liquid level was determined numerically by implementing Euler’s explicit method
and Runge-Kutta method on scilab. For a flow coefficient of 10, the results of both methods
gradually became distinguishable as the step size increased. As a trivial exercise, we varied the
value of the flow coefficient and observed that for large values, Euler’s explicit method was less
stable than the Runge-Kutta method.

In the final question, we formulated an appropriate least squares problem to best fit a given
function to the rate coefficient and temperature data for a given reaction. The system of equations
generated was solved manually and programmatically. On obtaining the necessary parameters, we
observed that there was a clear difference in results obtained manually and programmatically, yet
the parameters obtained in both cases fitted the data quite well. This led us to conclude that the
difference in results was due to rounding error within the calculator.
Table of Contents
Attestation of Authorship 4

Contributions 5

1. Introduction 6

2. Results 8
2.1 Section 1 8
2.1.1 Cramer’s Rule 9
2.1.2 Matrix Inverse Method 11
2.1.3 Gaussian Elimination 13
2.1.4 Spreadsheet Solution 14
2.1.5 Scilab Solution 15
2.2 Question 2 17
2.2.1 Question 2a 17
2.2.1.1 Newton-Raphson Method 17
2.2.1.2 Interval Bisection Method 18
2.2.1.3 Spreadsheet Solution 20
2.2.1.4.Scilab Solution 20
2.2.2 Section 2b 22
2.2.2.1 Spreadsheet Solution 22
2.2.2.2 Scilab Solution 24
2.3 Section 3 27
2.3.1 Model Derivation 27
2.3.2 Explicit Euler’s Method 29
2.3.3 Runge-Kutta 4th Order Method 30
2.3.4 Comparison of the two Methods 31
2.4 Question 4 32
2.4.1 Manual Solution 32
2.4.2 Spreadsheet Solution 34
2.4.3 Scilab Solution 36

3. Discussion of Results 37

4. Conclusion 39
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 Matric No. Signature

Olamilekan O. Adenusi 170401059

Zainab O. Idris 170401031

Gabriel I. Kasali
170401008

Immaobong E. Udoh 180401505


Contributions

Author Contribution

Olamilekan O. Adenusi - Conceptual formulation of solution (Q1, Q2a,


Q3, Q4)
- Leadership and team coordination
- Programming tasks (All questions)
- Layout/typing of the report
- Results analysis, interpretation, and
validation
- Executive Summary and Introduction

Zainab O. Idris - Conceptual formulation of solution (Q2)


- Programming/computing tasks (Q2)
- Programming/computing tasks (Q4)
- Discussion of results
- Conclusion of results

Gabriel I. Kasali - Writing of Introduction

Immaobong E. Udoh - Conceptual formulation of solution (Q3)


1. Introduction
A mathematical model is a representation of the essential aspects of an existing system (or a
system to be constructed) which represents knowledge of that system in a usable form (Eykhoff,
1974). The activities leading to the construction of the model is referred to as modelling.

Mathematical modelling has always been an important activity in science and engineering because
of how it helps us formulate real-life situations in a mathematical form for the purpose of
understanding, modifying, and controlling them to suit our needs or to make decisions. For
example, one type of event which has occurred in several places around the world is the boiling
liquid expanding vapour explosion (BLEVE). In such cases, it is often important to estimate the
radiation levels at key distances from the event as well as projectiles from the rupture of the vessel
(Hangos, 2001). This is one area where predictive mathematical models can be used to estimate
the level of radiation at nominated distances from the BLEVE, thus providing input to planning
decisions.

Modelling can be done for a number of other reasons. To the chemical engineer,
mathematical modelling is valuable in the following areas:

● Process Design. For example a model could be used in conducting feasibility analysis of
novel designs.
● Process control, e.g examining regulatory control strategies and analysing dynamics for set
point changes or disturbances.
● Process safety, eg detecting hazardous operating regimes and estimating the accidental
release events
● Troubleshooting - identifying likely causes for quality problems as well as likely causes for
process deviations.
● Operator training
● Optimization

There are three broad classifications of models, namely, fundamental, empirical, and semi-
empirical models. The fundamental model describes physico-chemical processes using
engineering knowledge, and does not involve direct use of measurement data. Black box models,
on another hand, describe physico-chemical models using collected sets of measurement data and
do not require prior engineering knowledge of the system. Semi-empirical models are the most
practical process engineering models because they bring together the features of both
fundamental and empirical models. A good example of this is rate law for chemical kinetics.

A systematic modelling procedure will involve the following seven steps:


1. Problem definition
2. Identification of controlling factors
3. Evaluation of problem data
4. Model construction
5. Model solution
6. Model verification
7. Model validation and solution interpretation
In light of all these, it is clear that the success of any model depends not just on the state of
knowledge about the system being modelled, but also on how well the modelling is done.
2. Results

2.1 Section 1
The figure below depicts a chemical engineering process application involving three reactors, A, B,
and C operating at steady state. Given the volumetric and mass flow rates into and out of the
reactors, we are interested in finding the concentration of the chemical species within them.

3
Volumetric flow rates(m / s):Q AB =40 , Q AC =80 , QBA =60 , QBA =20 ,QCout =150

mass flow rates(mg/s ):m A ,∈ ¿=1320, m C,∈¿=196 ¿


¿

Our solution approach to this problem shall be based upon the following details specified in
the problem and assumptions:

1. The process operates at steady state so that there is no accumulation of material.


2. No generation or consumption of material.

Mass is conserved, so our material balance equation becomes


Input=Output

Material balance around reactor A:

Material balance around reactor B:


Material balance around reactor C yields:

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.

Given a system of three linear equations of the form:

Solution of this system by Cramer’s Rule is as follows:

Where,

And

Considering our system of equations developed earlier


Solving for X A , X B , and X C we have

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
−1
X =A b
1
A−1= × adj( A)
det ( A)

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

Thus,
2.1.3 Gaussian Elimination
In this approach, we transform the augmented matrix A into an upper triangular matrix through
elementary row operations and then obtain the complete solution via back substitution. The
augmented matrix is given below.

The first row operation seeks to turn the first entry in row 2 to zero as shown below
From here we quickly observe that

Upon back substitution,

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. On the solver dialogue box, cells B7 to B9 were
declared as cells whose values should be varied to arrive at the final solution. We also included
three constraints: that the values in cells C2 to C4 be the same as those in cells D2 to D4.
Because the concentration of the species cannot be a negative number, we ensured to tick the box
Finally, the Simplex LP solving method was selected since our set of equations were linear. With
these in place, the problem is solved by clicking the solve command on the dialog box. The
solution is presented in the last figure.

2.1.5 Scilab Solution


Scilab 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).
2.2 Question 2

2.2.1 Question 2a

2.2.1.1 Newton-Raphson Method


Given
2 4 6
RT =Ro (1+ AT +B T +C T + D T )

R0 (resistance of t h e detector at 0 C )=100 Ω
−3 −6 −11 −17
A=5.485× 10 , B=6.65× 10 ,C=2.805 ×1 0 , D=−2 ×1 0 , RT =300 Ω

We want 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:

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 R0 and RT into the equation we have

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,
This exercise has provided for us a reasonable starting value and we can now employ the
algorithm to find T 1 .

This process is repeated three times and the results are shown below

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.

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.
s/N a b c f(a) f(b) f(c)

0 200 300 250 -0.5934 0.456625 -0.108438

1 250 300 275 -0.108438 0.456625 0.1630529

2 250 275 262.5 -0.108438 0.163053 0.024679

3 250 262.5 256.25 -0.108438 0.024679 -0.04252

4 256.25 262.5 259.375 -0.04252 0.024679 -0.009083

5 259.375 262.5 260.9375 -0.009083 0.024679 0.0077573

6 259.375 260.9375 260.15625 -0.009083 0.007757 -0.000673

7 260.15625 260.9375 260.54688 -0.000673 0.007757 0.0035396

8 260.15625 260.546875 260.35156 -0.000673 0.00354 0.0014327

9 260.15625 260.351563 260.25391 -0.000673 0.001433 0.0003797

10 260.15625 260.253906 260.20508 -0.000673 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.51E-05

13 260.21729 260.229492 260.22339 -1.51E-05 0.000117 5.073E-05

14 260.21729 260.223389 260.22034 -1.51E-05 5.07E-05 1.783E-05

15 260.21729 260.220337 260.21881 -1.51E-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 B15 respectively. We also assigned cells
B6, B7, B8, B9 and B10 to the given fixed values of Ro, A, B, C, and D respectively. Using Excel’s
“goal seek”, we obtained the value of T = 261.2187 oC that made Eq. equal to 300.

2.2.1.4.Scilab Solution
Two 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 16 iterations, the algorithm converged to a solution
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

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 /mo l 2 ,
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 13.5 atm, 15% above this pressure would be

15
(13.5)+13.5=15.525 atm
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.

Note: We do not want to paste the whole contents (including the formula) of the range A11:I11. To
paste only the values displayed, right click on the cell you want to paste in and from “Paste
options”, select “values”.

Using Eq.3.2.1, f (V ) was calculated in the cells B13 to I13. For readability, these cells were
merged with cells B14 to I14 respectively.

Fig. Spreadsheet solution snapshot


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 Scilab Solution

The van der Waals equation of state was expanded and rearranged to the following form where
the right-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.

An informed guess for the real volume was made using the ideal gas equation of state. It was
proper to do this because the ideal gas EOS would give a reasonably fair approximation of the real
volume. Finally, the real volume was determined using the fsolve function for each pressure and
the result was plotted.

Below, we present the output on the scilab 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−Consumpt i on

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 ρ q i∧ρ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.

dh
(c). Assuming A = 100cm2, and the steady state inflow, q i=10 c m3 / s. At steady state, =0.
dt
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.
3
Assuming this change represents an increase in inlet flow, then q i=1.5∗10=15 c m /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 areh '=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.

q i '=q i−q i=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 Scilab. 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 increases, 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

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.

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

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


289.40 3
6

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


288.99 6
9

761 14.4 6.6346 0.00131 -43.3845 44.0179 1.7161 -0.0568 - 0.0086


287.83 9
9

849 30.6 6.7441 0.00118 -42.6307 45.4829 1.3924 -0.0503 - 0.0079


287.50 6
6

989 80.3 6.8967 0.00101 -41.6659 47.5645 1.0201 -0.0421 - 0.0069


287.35 7
7

1076 131 6.9810 0.00093 -41.1765 48.7344 0.8649 -0.0383 - 0.0064


287.45 9
3

1146 186 7.0440 0.00087 -40.8260 49.6179 0.7569 -0.0355 - 0.0061


287.57 3
8

1202 240 7.0917 0.00083 -40.5710 50.2922 0.6889 -0.0337 - 0.0058


287.71 9
7

1382 489 7.2313 0.00072 -39.8593 52.2917 0.5184 -0.0287 - 0.0052


288.23 1
5

1445 604 7.2759 0.00069 -39.6481 52.9387 0.4761 -0.0274 - 0.0050


288.47 2
6

1562 868 7.3537 0.00064 -39.2855 54.0769 0.4096 -0.0251 - 0.0047


288.89 1
4


76.0761 0.01147 -459.262 527.234 13.257 -0.4863 - 0.0781



1 9 3169.4 6
59

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.
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
D=
R

Ea = RD

D = 2836.0617

Ea = 2836.0617 (8.314) = 23578.017 J/mole

2.4.3 Scilab Solution


The necessary scilab 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.
3. Discussion of Results
We discuss in this chapter the description of what happened in different sections and the
challenges faced, as well as how we overcame them.
In section 1, a chemical engineering process application was considered which involved three
reactors operating at steady state. From material balances over the reactors, the concentration of
a particular species, xA, xB and xc in the three reactors were determined using Crammer’s rule,
matrix inversion method, and gaussian elimination. The values obtained for XA, XB, and XC were
14.67, 7.33, and 10.1 mg/m3 respectively. From observations, these values did not differ from one
another. On comparing them with values obtained programmatically, there was also no difference.

In section 2, we evaluated the relationship between the resistance of a resistor and its temperature
which was a polynomial up to the sixth degree. We were tasked with finding the temperature of the
resistor for a resistance of 300 ohms. This was done manually using various methods including the
Newton-Raphson method, and the Interval bisection method. On evaluating the results obtained
using these two methods, we saw After four takes of the Newton Raphson method, we determined
the temperature to be 260.21868 oC. After the 15th iteration of the interval bisection method, we
determined that our T value was 260.21881oC. The Newton-Raphson method converged to a
solution with an error of order 10-8 in only 4 iterations, which is quite impressive. The interval
bisection method, on the other hand, was still unable to find a solution that is as close to Newton-
Raphson as possible after 16 iterations. In fact, 26 iterations would be required to get as close. We
stopped the interval bisection method at the fifteenth iteration because we believe that the results
obtained by the two methods will not differ significantly in practice.

We were also required to find the solution using a spreadsheet and SCILAB. For the spreadsheet,
we used the goal seek function and evaluated our T value to be 260.21870C. This value differs
from the answer we obtained using the Newton Rapson method by only 0.00011 whilst using
SCILAB we obtained a T value of 260.218811 0C. This answer is identical to what was obtained
using the Newton-Raphson method.

In section 2b, we were given the van der Waals equation which shows the relationship between
the Pressure and volume of a gas. The gas in question was nitrogen gas, and we were given the
necessary constants needed to evaluate the value of V for a given base pressure of 13.5 atm. We
obtained a V value of 2.6915 L. The calculations were repeated for incremental values of 15, 30,
45, 60, 75, 90, 105%, respectively. The values of pressure and volume were documented and
tabulated. A graph of pressure against was plotted and is attached to this report. From the graph,
we can see that Boyle’s law is preserved (P is inversely proportional to V).

Question 3 had us model a liquid tank system. Some assumptions were made in order to simplify
our model and increase its solvability. Mass balance was carried out around the tank and we
derived an expression to describe the relationship between the rate of change of the height of
water in the tank and the inlet flow rate. The model obtained is a lumped parameter, a non-linear
model. The ODE obtained was solved using Laplace transform and h(t) was evaluated to be 2 –
e^-0.05t

Explicit Euler’s method and Runge – Kutta 4th order method were used. In question 4, we were
given a linearized version of the Arrhenius equation and asked to use the method of the least
square to best fit a function of the form in(k) = C + bln(T) - D/T to the experimental data given to
us. Evaluating manually, we obtained C =-60.9316, b=3.2009, and D=2836.0617. After
determining our C, b and D values, we determined the values of A and Ea using numeric
computations. A was evaluated to be 3.449 × 10^-27 and Ea was evaluated to be 23,579 J/mole.
The difference in values using the spreadsheet method was negligible.
4. Conclusion
The purpose of this assignment was to apply the numerical methods we have been introduced to
in this course to solve real-world chemical engineering problems. From the data derived, it could
be seen that the difference in the answers was often less than 0.05. In real-world applications,
these differences could be negligible, as they would pose no real threat to problems they would be
applied to.

The graph of pressure against Volume which was plotted validated Boyle’s law, which states that
the pressure of a gas is inversely proportional to the volume it occupies.

In some cases, noticeable variations were observed, but this could be attributed to errors occurring
during approximation for the hand-solved solutions.

You might also like