Professional Documents
Culture Documents
Numerical Method 1
Numerical Method 1
ASSIGNMENT 1
SCHOOL OF ENGINEERING
FACULTY OF ENGINEERING, TECHNOLOGY & BUILT
ENVIRONMENT
2020
Chapter 2: Locating the Roots of Single Non‐Linear Equation
Introduction
A chemical engineer was required to design a computerised system for production of acetone with
could be controlled automatically with minimal supervision to enhance the efficiency of the
production line. This requires accurate estimates of molar volume of the gas involved on a
continuous basis to ensure the desired final product. The exact estimate of the volumes of gas
involved should be evaluated in a short period.
Problem Statement
The ideal gas law is given as PV=nRT. Although this equation is widely used, it is only accurate
over a limited range of temperature and pressure. An alternative equation to calculate the molar
volume of gas is given by the Van de Waals equation as follows.
𝑎
(𝜌 + ) (𝑣 − 𝑏) = 𝑅𝑇
𝑣2
Where 𝜌 is the pressure, 𝑣 = 𝑉/𝑛 is the molar volume, 𝑎 & 𝑏 are the empirical constant of the gas,
R is the universal gas constant and T is the temperature. The following information is obtained to
be used in the calculations in the ideal conditions for reaction:
𝑅 = 0.082054 𝐿. 𝑎𝑡𝑚/(𝑚𝑜𝑙. 𝐾)
𝑇 = 400𝐾
𝑝 = 2.5𝑎𝑡𝑚
𝐺𝑎𝑠 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡, 𝑎 = 14.09
𝐺𝑎𝑠 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡, 𝑏 = 0.0994
Solution
𝑃𝑉 = 𝑛𝑅𝑇
𝑉 𝑅𝑇 0.082054 × 400
= = = 13.12864 𝐿/𝑚𝑜𝑙
𝑛 𝑃 2.5
14.09
𝑓(13.12864 ) = (2.5 + ) (13.12864 − 0.0994) − 0.082054(400)
(13.12864 )2
= 0.81660
14.09 2.801092
𝑓 ′ (𝑣) = 2.5 − +
𝑣2 𝑣3
14.09 2.801092
𝑓 ′ (13.12864) = 2.5 − 2
+
(13.12864) (13.12864)3
= 2.41949
Newton-Raphson is selected to be used to calculate the root as it is the most efficient when
estimating values for numerous data as should be expected from an automatically controlled
system. It only requires one guess to obtain the root which speeds up to process of calculation by
the computer, in contrast to other methods which requires more data.
𝑎
(𝜌 + ) (𝑣𝑖 − 𝑏) − 𝑅𝑇
𝑣𝑖 2
𝑣𝑖+1 = 𝑣𝑖 −
𝑎 2𝑎
(𝜌 + 2 ) − (𝑣𝑖 − 𝑏) ( 3 )
𝑣𝑖 𝑣𝑖
First iteration:
14.09
(2.5 + ) (13.12864 − 0.0994) − 0.082054(400)
(13.12864)2
𝑣1 = 13.12864 −
14.09 2(14.09)
(2.5 + 2 ) − (13.12864 − 0.0994) ( )
(13.12864) (13.12864)3
= 12.79113
14.09
𝑓 (12.79113 ) = (2.5 + ) (12.79113 − 0.0994) − 0.082054(400)
(12.79113 )2
= 0.0007
14.09 2.801092
𝑓 ′ (12.79113) = 2.5 − +
(12.79113)2 (12.79113)3
= 2.41522
Second iteration:
𝑣1 = 12.79113
14.09
(2.5 + ) (12.79113 − 0.0994) − 0.082054(400)
(12.79113)2
𝑣2 = 12.79113 −
14.09 2(14.09)
(2.5 + ) − (12.79113 − 0.0994) ( )
(12.79113)2 (12.79113)3
= 12.79083
14.09
𝑓(12.79083 ) = (2.5 + ) (12.79083 − 0.0994) − 0.082054(400)
(12.79083 )2
= - 0.000015
14.09 2.801092
𝑓 ′ (12.79083) = 2.5 − 2
+
(12.79083) (12.79083)3
= 2.41521
The following few iterations were calculated using excel and is shown in below table:
After three iterations, the molar volume obtained is 𝑣 = 12.7908 𝐿/𝑚𝑜𝑙 which is close to the
initial calculated value from the ideal gas formula and with an 𝜀𝑎 of less than 0.0001 percent,
which was set as the tolerable error percentage. This concludes that Newton-Raphson is a suitable
method of estimation for this case study.
Chapter 3: Finding the Solution of Linear Algebraic Equations System
Introduction
Problem Statement
The liquid-liquid electroplating process was conducted in the company laboratory that involved
the extraction of nickel from the aqueous phase to the organic phase. The experimental data is as
below:
Assuming j is the amount of Ni in the organic phase and k is the amount of Ni in the aqueous
phase, the quadratic interpolant that estimates g is given by :
Find the values of 𝑥1 , 𝑥2 , 𝑥3 using LU decomposition. Estimate the amount of nickel in the
organic phase when 4.1 g/l is in the aqueous phase using quadratic interpolation.
Solution
LU decomposition was choosen as the method to find solution for the linear equations as it can
produce accurate results with minimal steps.
Using MatLab
Finally, the solution is found by function of x, in which the upper triangular matrix is divided by
the d.
X1 = -3.8600
X2 = 25.6300
X3 = -28.7500
Manual Calculation
4 2 1
[6.25 2.5 1]
9 3 1
4 2 1
Row 2 – (Row 1× (1.5625)) = [0 −0.625 −0.5625]
9 3 1
4 2 1
Row 3 – (Row 1 × (2.25)) = [0 −0.625 −0.5625]
0 −1.5 0.1
4 2 1
Row 3 – (Row 2× (2.4)) = [0 −0.625 −0.5625]
0 0 0.1
4 2 1
[𝑈] = [0 −0.625 −0.5625]
0 0 0.1
To find [L],
6.25
𝑙21 = = 1.5625
4
9
𝑙31 = = 2.25
4
−1.5
𝑙32 = = 2.4
−0.625
1 0 0
[𝐿] = [1.5625 1 0]
2.25 2.4 1
[𝐿][𝑍] = [𝐶]
1 0 0 𝑧1 7.07
[1.5625 1 0] [𝑧2 ] = [11.2]
2.25 2.4 1 𝑧3 13.4
𝑧1 = 7.07
1.5625𝑧1 + 𝑧2 = 11.2
2.25𝑧1 + 2.4𝑧2 + 𝑧3 = 13.4
Solving this;
4 2 1 𝑥1 𝑧1
[0 𝑥 𝑧
−0.625 −0.5625] [ 2] = [ 2 ]
0 0 0.1 𝑥3 𝑧3
4 2 1 𝑥1 7.07
[0 𝑥
−0.625 −0.5625] [ 2] = [ 0.1531 ]
0 0 0.1 𝑥3 −2.8749
−2.8749
𝑥3 = = −28.749
0.1
𝑗 = 𝑥1 𝑘 2 + 𝑥2𝑘 + 𝑥3
𝒋 = 𝟏𝟏. 𝟒𝟒𝟕𝟏𝒈/𝒍