newton raphson method raphson method •aim: to find the root of an equation 𝑓𝑥=0 •this is...

17
Newton Raphson method Dr. Motilal Panigrahi Associate Professor Nirma University Dr. Motilal Panigrahi, Nirma University

Upload: tranthuy

Post on 28-May-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Newton Raphson

methodDr. Motilal Panigrahi

Associate Professor

Nirma University

Dr. Motilal Panigrahi, Nirma University

Newton Raphson method

• Aim: To find the root of an equation 𝑓 𝑥 = 0

• This is an open method.

• However, here we take one initial point to start with.

Dr. Motilal Panigrahi, Nirma University

In this method

• Iteratively, we find new point.

• Given 𝑥0. We find the point (𝑥0, 𝑓 𝑥0 ).

• Then we find the tangent to the curve at this point. If the derivative

(slope) is not 0 at this point, then the tangent will hit the 𝑥 −axis at the

point say, 𝑥1.

Dr. Motilal Panigrahi, Nirma University

Consider a curve f(x)

Dr. Motilal Panigrahi, Nirma University

Take initial point 𝑥0, find (𝑥0, 𝑓 𝑥0 )

(𝑥0, 𝑓 𝑥0 )

Dr. Motilal Panigrahi, Nirma University

Draw tangent at the point (𝑥0, 𝑓(𝑥0))

Dr. Motilal Panigrahi, Nirma University

Tangent crosses the x-axis

Dr. Motilal Panigrahi, Nirma University

Tangent hits the x-axis at the point 𝑥1

𝑓′ 𝑥𝑖 =−𝑓(𝑥𝑖)

𝑥𝑖+1 − 𝑥𝑖

Dr. Motilal Panigrahi, Nirma University

Slope of the tangent at the point 𝑥𝑖 , 𝑓(𝑥𝑖 )

• 𝑓′ 𝑥𝑖 =−𝑓(𝑥𝑖)

𝑥𝑖+1−𝑥𝑖or,𝑓′ 𝑥𝑖 𝑥𝑖+1 − 𝑥𝑖 = −𝑓(𝑥𝑖)

Or, 𝑥𝑖+1 − 𝑥𝑖 = −𝑓 𝑥𝑖

𝑓′ 𝑥𝑖

Or, 𝑥𝑖+1 = 𝑥𝑖 −𝑓 𝑥𝑖

𝑓′ 𝑥𝑖

Dr. Motilal Panigrahi, Nirma University

Termination criteria and error estimate

• 𝜀𝑎 =𝑥𝑖+1−𝑥𝑖

𝑥𝑖+1100%

• If we denote the stopping criterion as 𝜀𝑠 then we stop our process of searching when 𝜀𝑎< 𝜀𝑠.

• Or else we can fix that two consecutive values are very close, meaning say, correct to four decimal places, or three decimal places etc.

Dr. Motilal Panigrahi, Nirma University

Example 1

• Using Newton-Raphson method find the root of the following equation

correct to four decimal places.

• 𝑥 log10 𝑥 − 1.2 = 0, 𝑥0 = 1

Dr. Motilal Panigrahi, Nirma University

Solution.

• 𝑓 𝑥 = 𝑥 log10 𝑥 − 1.2

• 𝑓′ 𝑥 = log10 𝑥 + 𝑥.1

𝑥 ln 10= log10 𝑥 +

1

ln 10

• Given initial point 𝑥0 = 1

• So 𝑓 1 = −1.2, 𝑓′ 1 = 0.434294

Dr. Motilal Panigrahi, Nirma University

𝑓 𝑥 = 𝑥 log10 𝑥 − 1.2

𝑓′(𝑥) = log10 𝑥 +1

ln 10

n x(n) f(x(n)) f'(x(n)) e_a

0 1 -1.2 0.434294

1 3.763102 0.965838 1.00984 73.42618

2 2.806675 0.05793 0.882487 34.07685

3 2.741031 0.000336 0.872208 2.394868

4 2.740646 1.18E-08 0.872147 0.014057

5 2.740646 0 0.872147 4.92E-07

𝒙𝒊+𝟏 = 𝒙𝒊 −𝒇 𝒙𝒊𝒇′ 𝒙𝒊

Dr. Motilal Panigrahi, Nirma University

𝑥0

𝑥1𝑥2

𝑥3

𝑓 𝑥 = 𝑥 log10 𝑥 − 1.2

Dr. Motilal Panigrahi, Nirma University

Example 2.

• Determine the real root of

• 𝑓 𝑥 = −2𝑥6− 1.5𝑥

4+ 10𝑥 + 2 = 0

• By Newton-Raphson method and compare it with secant method.

• Take initial guess as 𝑥0 = 1, for the Newton-Raphson method, and

• Take initial guess as 𝑥0 = 1, 𝑥1 = 2.06 for the secant method.

• Iterate until the estimated error falls below a level of

• 𝜀𝑠 = 0.01%

Dr. Motilal Panigrahi, Nirma University

𝑓 𝑥 = −2𝑥6 − 1.5𝑥4 + 10𝑥 + 2𝑓′ 𝑥 = −12𝑥5 − 6𝑥3 + 10

• Initial point 𝑥0 = 1, by Newton-Raphson method

n x(n) f(x(n)) f '(x(n)) e_a

0 1 8.5 -8

1 2.0625 -158.4736 -490.51112 51.51515

2 1.739422 -49.73059 -212.65236 18.5739

3 1.505563 -13.94429 -103.30346 15.53297

4 1.370579 -2.844567 -63.484271 9.848669

5 1.325772 -0.236708 -53.131782 3.379725

6 1.321317 -0.002145 -52.171018 0.337172

7 1.321275 -1.81E-07 -52.162209 0.003111

𝒙𝒊+𝟏 = 𝒙𝒊 −𝒇 𝒙𝒊𝒇′ 𝒙𝒊

Dr. Motilal Panigrahi, Nirma University

ComparisonSecant NR

n x(n) f(x(n)) x(n) f(x(n))

0 1 8.5 1 8.5

1 2.06 -157.251 2.0625 -158.4736

2 1.054359 7.942221 1.7394216 -49.73059

3 1.102708 7.213438 1.5055629 -13.94429

4 1.581269 -22.8309 1.3705791 -2.844567

5 1.217608 4.361666 1.3257717 -0.236708

6 1.275939 2.153752 1.3213166 -0.002145

7 1.332839 -0.61766 1.3212755 -1.81E-07

8 1.320158 1.5395683 1.3212755 -3.55E-15

Dr. Motilal Panigrahi, Nirma University