Sie sind auf Seite 1von 5

1

INDIVIDUAL OPEN ENDED

Newton Rapson Method

Name : Muhammad Sulhi Bin Zainudin

Matric No. : DF140019

1.0 About Newton's Method for Finding Roots

In numerical analysis, Newton's method (also known as the Newton–Raphson


method), named after Isaac Newton and Joseph Raphson, is a method for finding
successively better approximations to the roots (or zeroes) of a real-valued function.

x: f(x) = 0

The Newton–Raphson method in one variable is implemented as follows:

The method starts with a function f defined over the real numbers x, the
function's derivative f ′, and an initial guess x0 for a root of the function f. If the function
satisfies the assumptions made in the derivation of the formula and the initial guess is
close, then a better approximation x1 is

f (x0 )
x1 = x0 –
f′ (x0 )

Geometrically, (x1, 0) is the intersection of the x-axis and the tangent of


the graph of f at (x0, f (x0)).

The process is repeated as

f (xn )
xn+1 = xn -
f′ (xn )

until a sufficiently accurate value is reached.

This algorithm is first in the class of Householder's methods, succeeded by Halley's


method. The method can also be extended to complex functions and to systems of
equations.
2

Aim: Find the root of an equation 3𝑥 + sin(𝑥) − 𝑒 𝑥 = 0 using Newton Rapson Method

2.0 Pseudo Code

1. Start
2. Enter the initial guess, x.
3. Enter the desired accuracy, eps.
4. Repeat
xn = x - f(x) / f’(x)
Until xn – x <= eps
5. Print ‘xn’, which is the root.
6. Finish

3.0 Flow Chart

Start

Enter x

Enter eps

xn = x - f(x) / f’(x)

No

Is (xn – x) <= eps

Yes

Print xn

Finish

Figure 1: Flow chart


3

4.0 Algorithm

Figure 2: Algorithm

Figure 3: Algorithm
4

Appendix

Figure 4: Root finder for equation 3𝑥 + sin(𝑥) − 𝑒 𝑥 = 0

Figure 5: Output from C++ Programme


5

Figure 6: Output from C++ Programme

Das könnte Ihnen auch gefallen