0% found this document useful (0 votes)
16 views27 pages

Lesson 2 pt.2

This document discusses iterative root-finding numerical methods, including fixed-point iteration, Newton-Raphson, and secant methods. It provides examples of using each method to find roots of equations. The fixed-point iteration method transforms equations into the form x=g(x) and iteratively calculates xn+1=g(xn). Newton-Raphson uses tangent lines to iteratively calculate xn+1=xn-f(xn)/f'(xn). Secant method uses secant lines through two points to iteratively calculate xn+1=xn-f(xn)(xn-xn-1)/(f(xn)-f(xn-1)). Examples demonstrate applying each method to find positive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views27 pages

Lesson 2 pt.2

This document discusses iterative root-finding numerical methods, including fixed-point iteration, Newton-Raphson, and secant methods. It provides examples of using each method to find roots of equations. The fixed-point iteration method transforms equations into the form x=g(x) and iteratively calculates xn+1=g(xn). Newton-Raphson uses tangent lines to iteratively calculate xn+1=xn-f(xn)/f'(xn). Secant method uses secant lines through two points to iteratively calculate xn+1=xn-f(xn)(xn-xn-1)/(f(xn)-f(xn-1)). Examples demonstrate applying each method to find positive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

ITERATIVE

METHODS OF ROOT-FINDING
NUMERICAL METHODS AND ANALYSIS
LESSON 2
PRESENTED BY: ENGR. ROMULO C. CRUZ JR.
ITERATIVE OPEN
METHODS
LESSON 2
ITERATIVE OPEN METHODS

➢ Fixed-point iteration method

➢ Newton-Raphson method

➢ Secant method

NOTE: Open methods do not always converge

Presented by: Engr. Romulo C. Cruz Jr.


FIXED-POINT ITERATION

The equation f(x) = 0 can be transformed into x = g(x), and choosing an initial
guess x0, successive approximations can be obtained:
x1 = g(x0)
x2 = g(x1)

xn+1 = g(xn)

The solution of x = g(x) is called the fixed point of g.

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 5

Find a positive root of the equation x4 + 2x – 8 = 0. Round off to 3 decimal digits.

SOLUTION:
The equation can be written as
8
𝑥 = 𝑥 3 +2  𝑔(𝑥)

By fixed point iteration, this can be generalized as


8
𝑥𝑛+1 = 𝑥 3  xn+1 = g(xn)
𝑛 +2

If 𝑥0 = 1, then
8 8
𝑥1 = 𝑥 3 +2
= 13+2 = 2.667
0
EXAMPLE PROBLEM 5

8 8
𝑥2 = 𝑥 3 +2 = 2.6673 +2 = 0.382
1
8 8
𝑥3 = 𝑥 3 +2 = 0.3823 +2 = 3.892
2
8 8
𝑥4 = 𝑥 3 = 3.8923 +2 = 0.131
3 +2
8 8
𝑥5 = 𝑥 3 +2 = 0.1313 +2 = 3.995
4
8 8
𝑥6 = = = 0.122
𝑥5 3 +2 3.9953 +2
8 8
𝑥7 = = = 3.996
𝑥6 3 +2 0.1223 +2

The iterative process is diverging (does not converge into a solution)

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 5

Let us re-write the equation into



𝑥 = 8 − 2𝑥 4

or by fixed point iteration



𝑥𝑛+1 = 8 − 2𝑥𝑛 4

If 𝑥0 =1, then

𝑥1 = 8 − 2(1) 4 = 1.565

𝑥2 = 8 − 2(1.565) 4 = 1.486

𝑥3 = 8 − 2(1.486) 4 = 1.497

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 5


𝑥4 = 8 − 2(1.497) 4 = 1.496

𝑥5 = 8 − 2(1.496) 4 = 1.496

This converges to 1.496. For other values of x0, refer to the Table below:

n 0 1 2 3 4 5 6
𝑥𝑛 1 1.565 1.486 1.498 1.496 1.496
𝑥𝑛 2 1.414 1.508 1.494 1.496 1.496
𝑥𝑛 3 1.189 1.540 1.489 1.497 1.496 1.496

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 6

Find a negative root of the equation x3 + 2x2 – x – 1 = 0. Round off to 3 decimal digits.

SOLUTION:

Re-write as 𝑥 = 1 + 𝑥 − 2𝑥 2 3


By fixed point iteration: 𝑥𝑛+1 = 1 + 𝑥𝑛 − 2𝑥𝑛 2 3

If 𝑥0 = 1, then

𝑥1 = 1 + 1 − 2(1)2 3 =0

𝑥2 = 1 + 0 − 2(0)2 3 =1

𝑥3 = 1 + 1 − 2(1)2 3 = 0 ==> Diverging!
EXAMPLE PROBLEM 6

If 𝑥0 = 2, then

𝑥1 = 1 + 2 − 2(2)2 3 = −1.710

𝑥2 = 1 − 1.710 − 2(−1710)2 3 = −1.872

𝑥3 = 1 − 1.872 − 2(−1.872)2 3 = −1.990

𝑥4 = 1 − 1.990 − 2(−1.990)2 3 = −2.073

𝑥5 = 1 − 2.073 − 2(−2.073)2 3 = −2.130

Refer to Table for summary of computed values:


EXAMPLE PROBLEM 6

n 0 1 2 3 4 5 6 7 8 9 10
xn 1 0 1 0
xn 2 -1.710 -1.872 -1.990 -2.073 -2.130 -2.169 -2.195 -2.213 -2.225 -2.232

n 11 12 13 14 15 16 17
xn
xn -2.237 -2.240 -2.242 -2.244 -2.245 -2.246 -2.246

Therefore, the negative root is −2.246


NEWTON-RAPHSON METHOD

➢ a root-finding method based on


the tangent line to the graph of
the function 𝑦 = 𝑓 𝑥
➢ from Isaac Newton and Joseph
Raphson

Presented by: Engr. Romulo C. Cruz Jr.


NEWTON-RAPHSON METHOD

The tangent line to f(x) at the point [x0, f(x0)] is


𝑓 𝑥0
𝑡𝑎𝑛𝜃 = 𝑥 = 𝑓 ′ (𝑥0 )
0 −𝑥1
𝑓 𝑥0
𝑥1 = 𝑥0 − 𝑓′ 𝑥0

In a similar manner,
𝑓 𝑥1
𝑥2 = 𝑥1 −
𝑓′ 𝑥1

By considering successive tangent lines, these can be generalized into the


iteration formula
𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 − 𝑓′ 𝑥𝑛

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 7

Using Newton-Raphson method, find a positive root of the equation x4 + 2x – 8 = 0.

SOLUTION by Newton-Raphson method:


𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 − 𝑓′ 𝑥𝑛
where f(x) = x4 + 2x – 8
f’(x) = 4x3 + 2

If 𝑥0 = 1, then
𝑓 𝑥0 = 14 + 2 1 − 8 = −5
𝑓 ′ 𝑥0 = 4 1 3 +2=6

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 7

𝑓 𝑥0 −5
𝑥1 = 𝑥0 − 𝑓′ = 1− = 1.833
𝑥0 6
𝑓 𝑥1 6.955
𝑥2 = 𝑥1 − 𝑓′ = 1.833 − = 1.572
𝑥1 26.635
𝑓 𝑥2 1.251
𝑥3 = 𝑥2 − 𝑓′ = 1.572 − = 1.501
𝑥2 17.539
𝑓 𝑥3 0.078
𝑥4 = 𝑥3 − 𝑓′ 𝑥3
= 1.501 − 15.527
= 1.496
𝑓 𝑥4 7.16x10−4
𝑥5 = 𝑥4 − = 1.496 − = 1.496
𝑓′ 𝑥4 15.392

The Table shows the summary of computed values:

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 7

Iteration n xn f(xn) f’(xn) xn+1


1 0 1 -5 6 1.833
2 1 1.833 6.955 26.635 1.572
3 2 1.572 1.251 17.539 1.501
4 3 1.501 0.078 15.527 1.496
5 4 1.496 7.16x10-4 15.392 1.496

Therefore, as in the Fixed-point iteration method the positive root is 1.496

Presented by: Engr. Romulo C. Cruz Jr.


LET’S TRY THIS: EXAMPLE PROBLEM 8

Using Newton-Raphson methods, find a positive root of the equation


x sinx + cosx = 0. Round off to 3 decimal digits.

Presented by: Engr. Romulo C. Cruz Jr.


SECANT METHOD

➢ uses two roots of a secant line


(passing through two points of
a curve) to approximate the
root of a function f(x)

Presented by: Engr. Romulo C. Cruz Jr.


SECANT METHOD

The slope of the secant line at points (xn+1, f(xn+1)) and (xn, f(xn)) is equal to the
slope at points (xn, f(xn)) and (xn-1,f(xn-1)):

𝑓 𝑥𝑛 −𝑓(𝑥𝑛+1 ) 𝑓 𝑥𝑛−1 −𝑓(𝑥𝑛 )


𝑚= =
𝑥𝑛 −𝑥𝑛+1 𝑥𝑛−1 −𝑥𝑛

Since f(xn+1) = 0, this will yield the iteration formula


𝑓 𝑥𝑛 (𝑥𝑛 −𝑥𝑛−1 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓 𝑥𝑛 −𝑓(𝑥𝑛−1 )

Presented by: Engr. Romulo C. Cruz Jr.


SECANT METHOD

Note that it is not advisable to simplify this into

𝑥𝑛−1 𝑓 𝑥𝑛 −𝑥𝑛 𝑓(𝑥𝑛−1 )


𝑥𝑛+1 =
𝑓 𝑥𝑛 −𝑓(𝑥𝑛−1 )

as this may lead to loss of significant digits (if 𝑥𝑛 and 𝑥𝑛−1 are almost equal)

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 9

Using Secant method, find a positive root of the equation x4 + 2x – 8 = 0. Round off to 3 decimal
digits.

SOLUTION by Secant method:


𝑓 𝑥𝑛 (𝑥𝑛 −𝑥𝑛−1 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑓 𝑥𝑛 −𝑓(𝑥𝑛−1 )

where: 𝑓 𝑥 = 𝑥 4 + 2𝑥 − 8

Let 𝑥0 = 1, 𝑥1 = 2
𝑓(𝑥1 ) 𝑥1 −𝑥0 12 2−1
𝑥2 = 𝑥1 − =2− = 1.294
𝑓 𝑥1 −𝑓(𝑥0 ) 12− −5

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 9

𝑓(𝑥2 ) 𝑥2 − 𝑥1 −2.608 1.294 − 2


𝑥3 = 𝑥2 − = 1.294 − = 1.420
𝑓 𝑥2 − 𝑓(𝑥1 ) −2.608 − 12

𝑓(𝑥3 ) 𝑥3 − 𝑥2 −1.094 1.420 − 1.294


𝑥4 = 𝑥3 − = 1.420 − = 1.511
𝑓 𝑥3 − 𝑓(𝑥2 ) −1.094 − (−2.608)

𝑓(𝑥4 ) 𝑥4 − 𝑥3 0.235 1.511 − 1.420


𝑥5 = 𝑥4 − = 1.511 − = 1.495
𝑓 𝑥4 − 𝑓(𝑥3 ) 0.235 − (−1.094)

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 9

𝑓(𝑥5 ) 𝑥5 − 𝑥4 −0.015 1.495 − 1.511


𝑥6 = 𝑥5 − = 1.495 − = 1.496
𝑓 𝑥5 − 𝑓(𝑥4 ) −0.015 − 0.235

𝑓(𝑥6 ) 𝑥6 −𝑥5 7.16x10−4 1.496−1.495


𝑥7 = 𝑥6 − = 1.496 − = 1.496
𝑓 𝑥6 −𝑓(𝑥5 ) 7.16x10−4 −(−0.015)

Presented by: Engr. Romulo C. Cruz Jr.


EXAMPLE PROBLEM 9

Therefore, as in the Newton-Raphson and fixed-point iteration methods, the root is 1.496.
The Table shows the summary of the calculated values.

Iteration n xn xn-1 f(xn) f(xn-1) xn+1


1 1 2 1 12 -5 1.294

2 2 1.294 2 -2.608 12 1.420

3 3 1.420 1.294 -1.094 -2.608 1.511

4 4 1.511 1.420 0.235 -1.094 1.495

5 5 1.495 1.511 -0.015 0.235 1.496

6 6 1.496 1.495 7.16x10-4 -0.015 1.496

Presented by: Engr. Romulo C. Cruz Jr.


LET’S TRY THIS: EXAMPLE PROBLEM 10

Using Secant method, find a positive root of the equation x sinx + cosx = 0.
Round off to 3 decimal digits.

SOLUTION:
Iteration n xn xn-1 f(xn) f(xn-1) xn+1
1 1 3 2 - 0.567 1.402 2.712
Let 𝑥0 = 2 , 𝑥1 = 3
2 2 2.712 3 0.220 - 0.567 2.793
𝑓 𝑥 = 𝑥 sin 𝑥 + cos 𝑥
𝑓 𝑥𝑛 (𝑥𝑛 −𝑥𝑛−1 ) 3 3 2.793 2.712 0.014 0.220 2.799
𝑥𝑛+1 = 𝑥𝑛 − 𝑓 𝑥𝑛 −𝑓(𝑥𝑛−1 )
4 4 2.799 2.793 - 0.002 0.014 2.798

5 5 2.798 2.799 - 0.001 - 0.002 2.797


 the positive root is 2.798
6 6 2.797 2.798 0.004 - 0.001 2.798

Presented by: Engr. Romulo C. Cruz Jr.


LET’S TRY THIS: PRACTICE TASK

Determine a root of the function


f(x) = x3 + x – 1

by: (i) fixed point iteration, (ii) Newton-Raphson method, and (iii)
secant method. Round off your answer to three decimal places.

Presented by: Engr. Romulo C. Cruz Jr.


https://www.clipartkey.com/view/miowRw_thank-you-thank-you-in-different-languages-png/
Presented by: Engr. Romulo C. Cruz Jr.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy