4-Numerical Methods-Roots of Equations (Open Methods)
4-Numerical Methods-Roots of Equations (Open Methods)
School of Engineering
Department of Civil Engineering
(0951301): Numerical Methods
Dr. Ramia Al-Ajarmeh
Roots of Equations
(Open Methods)
Roots of Equations
Refer to the Textbook, Chapters 5 & 6
Open Methods
Refer to the Textbook, Chapter 6
𝑥 2+3
𝑒. 𝑔. : 𝑥 2 − 2𝑥 + 3 = 0 → 𝑥 =
2
𝑠𝑖𝑛𝑥 = 0 → 𝑥 = 𝑠𝑖𝑛𝑥 + 𝑥
𝑥𝑖+1 − 𝑥𝑖
𝜀𝑎 % = 100%
𝑥𝑖+1
Open Methods
Example:
Find the root of 𝑥 − 𝑒 −𝑥 , with initial guess 𝑥0 = 3.0 using fixed-point
method, consider 𝑔 𝑥 = 𝑒 −𝑥 , [𝜀𝑠 = 1%]
Solution:
𝑖 0 1 2 3 4 5 6 7
𝑥𝑖 3.0 0.0498 0.951 0.386 0.68 0.507 0.602 0.548
𝑖 8 9 10 11 12 13 14
𝑥𝑖 0.578 0.561 0.571 0.565 0.568 0.567 0.567
𝜀𝑎 =0.53%
2- Newton-Raphson method
Open Methods
2- Newton-Raphson method
2- Newton-Raphson method
Example:
Find the root of 𝑥 − 𝑒 −𝑥 , with initial guess 𝑥0 = 3.0 using Newton
method, [𝜀𝑠 = 1%]
Solution:
𝑓 ′ 𝑥𝑖 = 1 + 𝑒 −𝑥
𝑖 𝑥𝑖 𝑥𝑖+1 𝜀𝑎 %
0 3.0 0.1897
1 0.1897 0.5386
2 0.5386 0.567 5%
3 0.567 0.567 <<<5%
Exercise:
Using:
(1) Simple fixed-point iteration method
(2) Newton method
Open Methods
3- Secant method
Example:
Find the root of the function using Secant method:
𝑓 𝑥 = cos 𝑥 + 2𝑠𝑖𝑛 𝑥 + 𝑥 2
𝑥−1 = 0, 𝑥0 = −0.1, 𝜀𝑠 = 0.01%
Solution:
Iteration 𝑥𝑖−1 𝑥𝑖 𝑥𝑖+1 𝜀𝑎 %
1 0.0 -0.1 -0.51371 80.53
2 -0.1 -0.51317 -0.60996 15.78
3 -0.51317 -0.60996 -0.6518 6.48
4 -0.60996 -0.6518 -0.6588 1.06
5 -0.6518 -0.6588 -0.65926 0.07
6 -0.6588 -0.65926 -0.65927 0.0007
Open Methods
4- Modified Secant method
Example:
Find the root of the function using modified Secant method,
𝑓 𝑥 = cos 𝑥 + 2𝑠𝑖𝑛 𝑥 + 𝑥 2 ,
𝑥0 = −0.1, 𝛿 = −0.01, 𝜀𝑠 = 0.01%
Iteration 𝑥𝑖 𝛿 𝑥𝑖+1 𝜀𝑎 %
1 -0.1 -0.01 -0.526 80.99
2 -0.526 -0.01 -0.64187 18.05
3 -0.64187 -0.01 -0.65873 2.56
4 -0.65873 -0.01 -0.65926 0.08
5 -0.65926 -0.01 -0.65927 0.0008
Open Methods
Secant vs. modified Secant methods
Exercise:
Find a root of the following function:
𝑓 𝑥 = 2𝑥 3 − 11.7𝑥 2 + 17.7𝑥 − 5
Using:
(1) Secant method with 𝑥−1 = 3, 𝑥0 = 4
(2) Modified Secant method with 𝑥0 = 3 and = 0.01
Perform three iterations
Open Methods
5- Multiple Root
Examples:
Examples:
Difficulties:
• Function does not change sign with double (or even number
of multiple root); therefore, cannot use bracketing methods.
Example:
Using Newton-Raphson and modified Newton-Raphson; evaluate
the multiple root of:
𝑓 𝑥 = 𝑥 3 − 5𝑥 2 + 7𝑥 − 3,
initial guess: 𝑥0 = 0, 𝑟 = 1 𝑡𝑟𝑢𝑒 , 𝜀𝑠 = 0.01%
Solution:
𝑥𝑖 3 −5𝑥𝑖 2 +7𝑥𝑖 −3
(1) Newton-Raphson formula: 𝑥𝑖+1 = 𝑥𝑖 −
3𝑥𝑖 2 −10𝑥𝑖 +7