Individual Assignment MEC500 Numerical M
Individual Assignment MEC500 Numerical M
MEC500
Numerical Method
Individual Assignment
Lecturer:
HAFIZI BIN LUKMAN
Bisection Method......................................................................................................................5
Newton-Raphson Method........................................................................................................7
References ................................................................................................................................. 9
LIST OF TABLE
Table 1 : Bisection method ..................................................................................................................... 6
Table 2 :Newton-Raphson Method......................................................................................................... 7
LIST OF EQUATION
Equation 1 : The formula of K ..................................................................................................................
3
Equation 2 : the given function............................................................................................................... 4
Equation 3 : approximate error .............................................................................................................. 5
Equation 4 : true error ............................................................................................................................ 5
Equation 5 : Newton raphson mthod ..................................................................................................... 7
Equation 6: equation of motion.............................................................................................................. 7
Question A
Background
Water vapor (H2O) is heated to sufficiently high temperatures that a significant portion of the
water dissociates, or splits apart, to form oxygen (O2) and hydrogen (H2):
��2𝑂 ↔ ��2 +
2 ��2
If it is assumed that this is the only reaction involved, the mole fraction x of H2O that
dissociates
can be represented by
𝑥 2��𝑡
𝐾= √
1−𝑥 2+𝑥
where K = the reaction equilibrium constant and pt = the total pressure of the mixture.
The Task
An engineering design project requires that you accurately estimate the mole fraction x of H2O
if pt = 3.5 atm and K = 0.04, determine the value of x that satisfies the equation above.
Instruction
1. Use any two numerical roots of equations method and determine the roots for the mole
fraction x of H2O.
(CO2/PO1/C3)
(CO2/PO1/C3)
QUESTION 1
𝑥 2��𝑡
𝐾= √
1−𝑥 2+𝑥
By applying the value of K=0.04 and pt = 3.5 the equation can be rearranged to:
3
Thus, = x3 – 4375x2 − 3𝑥 + 2
Equation 2 : the given function
0
f(x) = x 3 – 4375x2 − 3𝑥 + 2
The roots of equation will be determined by using both bisection method and Newton-
Raphson method. Therefore, the real root of the equation is x = 0.0210937.
1ST METHOD
Bisection Method
The bisection method finds the roots of equation by continuously bisecting the interval and
then selects a subinterval in which a root must lie for further processing. It is a robust but slow
method of finding the roots. For this problem, the stopping criterion ℇs is 0.5%.
Initial value;
Xl = 0
Xu = 0.03
Xr = (0+0.03)/2
= 0.015
Lower limits
f(Xl)
��(0) = (0) − 4375(0) − 3(0) + 2
3 2
��(0) = 2
Middle point
f(Xr)
��(0.015) = (0.015) − 4375(0.015) − 3(0.015) + 2
3 2
��(0.015) = 0.970628375
If the product of f(Xl) and f(Xr) is of positive value then the value of Xr will go to the next Xl ,
if the product yield a negative value them the value of Xr will go to the next Xu .
Approximate error, ℇa
��𝑟 ���� −
��𝑟 ��𝑤
�� = | | × 100%
��𝑟
��𝑤
0.015 − 0.0225
�� = | 0.0225 | × 100%
�� = 33.33%
True error, ℇt
Equation 4 : true error
0.015 − 0.0210937
�� = | 0.0210937 | × 100%
�� = 28.89%
Table 1 : bisection method
Iteration
n XL Xr Xu ∫Xr ∫XL ∫XL*∫Xr ɛa ɛt
0 0 0.015 0.03 0.970628 2 1.94125675 28.88872
1 0.015 0.0225 0.03 -0.28233 0.970628 -0.274039799 33.33333 -6.66692
2 0.015 0.01875 0.0225 0.405671 0.970628 0.393755448 -20 11.1109
3 0.01875 0.020625 0.0225 0.07705 0.405671 0.031256838 9.090909 2.22199
4 0.020625 0.021563 0.0225 -0.0988 0.07705 -0.007612221 4.347826 -2.22246
5 0.020625 0.021094 0.021563 -0.00991 0.07705 -0.000763708 -2.22222 -0.00024
6 0.020625 0.020859 0.021094 0.033809 0.07705 0.002604998 -1.1236 1.110877
7 0.020859 0.020977 0.021094 0.012009 0.033809 0.000406008 0.558659 0.55532
8 0.020977 0.021035 0.021094 0.001063 0.012009 1.2771E-05 0.278552 0.277541
9 0.021035 0.021064 0.021094 -0.00442 0.001063 -4.70102E-06 0.139082 0.138652
The iteration is stopped at the ninth iteration as both the approximate and true error is below
the stopping criterion. From this bisection iteration method, the root of the equation x=
0.021056 with 0.139% approximate error and 0.1386% true error.
Newton-Raphson Method
Newton-Rapson is another roots approximation method. The method is simpler and faster than
most numerical roots of equation methods. The Newton-Raphson method use the formula;
𝑋 = −
��(��𝑖 )
��′
��+1
(��𝑖𝑖)
in order to determine the next value of x which will approximately approach the value of the
roots of equation and by calculating the approximate error the roots of equation are
determined. The stopping criterion ℇs is 0.5%.
Sample of calculation
−2.02747
����+1 = 0.03 −
−265.497
����+1 =
0.022363
The calculation for approximate error and the true error is the same as in bisection method.
At the fourth iteration, the approximate error value is below the stopping criterion thus the
iteration is stopped. The root is determined to be x = 0.021041 with approximate error of
0.18% and a true error of 0.25%.
Question 2
There is two method that used for this task which is Bisection method and Newton
Raphson method. The reason choosing this two method to show the different way of finding
the real root of (x), the rate of change of approximate error and true error. To ensure the high
accuracy of the result several iteration were taken for each method.
The bisection method is a method that used the point of lower, upper and midpoint.
The bisection method in mathematics is a root-finding method that repeatedly bisects an
interval and then selects a subinterval in which a root must lie for further processing. It is a
very simple and robust method, but it is also relatively slow. Because of this, it is often used
to obtain a rough approximation to a solution which is then used as a starting point for more
rapidly converging methods. The method is also called the interval halving method, the
binary search method, or the dichotomy method. The result show that the root of equation can
be determine after 10 iteration with x(true value) = 0.021056. The root has approximate error
of 0.139% and true value error of 0.13865.
The Newton-Raphson method is and open. For this method there is only 5 iteration
that used, compare with bisection method there is more iteration that used. The real root the
Newton Raphson is more simple and more faster determined. The root determined is x =
0.021041. thus it has approximate error of 0.18% and a true error of 0.25%.
References
2. Lecturer note: Hafizi Bin Lukman, “Chapter 2: Roots of Equation”, Numerical Method MEC500,
Universiti Teknologi MARA.
ON TIME /
EMD6M7A 15/7/2018 9/7/2018
LATE
No Name Student ID
TOTAL 20%
REMARKS: