Sie sind auf Seite 1von 23

WEEK 3

Roots of Equations: Open methods


 Simple fixed point method
 Newton-Raphson method
 Secant method 2
LESSON OUTCOMES

At the end of this topic, the students will be able:

 To identify and apply the open methods to solve


roots of equations
OPEN METHOD
Open methods are
based on formulas
that require only a
single starting value
of x or two starting
values that do not
necessarily bracket
the root.

Sometimes, the open methods


diverge from the root (b)
But when they do converge, they do so more
quickly than the bracketing methods (c)
4
 Simple fixed point method
• Rearrange the function so that x is on the left
side of the equation
• Rearrange by algebraic manipulation

x 2
3
x  2x  3  0  x 
2

• OR add x to both sides of original equation

sin x  0  x  sin x  x
5
Iterative method
• New estimate of x is expressed by iterative formula
xi 1  g ( xi )
• formula to predict the value of x as a function of x
i.e. it can be used to estimate the new value xi+1
knowing or having an initial guess xi (an old value).

xi 1  xi
• Calculation of error as  a  100%
xi 1

Example:
Use simple fixed-point iteration to locate the root of
f(x)=e-x –x .Use initial guess of x0 = 0.
6
Two curve graphical method

• Other method is by separate equation into 2


component part, as in,
𝑓1 𝑥 = 𝑓2 𝑥
𝑦1 = 𝑓1 𝑥
𝑦2 = 𝑓2 𝑥

• The two equations are then plotted separately.


• The x values corresponding to the intersections
of these functions represent the roots of f(x) = 0.
Example
Separate the equation e-x – x = 0 into two
parts and determine its root graphically.

Reformulate the equation as:


y1 = x
y2 = e-x
x y1 y2
0.0 0.0 1.000
0.2 0.2 0.819
0.4 0.4 0.670
0.6 0.6 0.549
0.8 0.8 0.449
1.0 1.0 0.368

The intersection of two curves


indicates a root estimate of
approximately x = 0.57.
8
Convergence

(a) staircase; convergence


(b) oscillating; convergence
(c) staircase; divergence
(d) oscillating : divergence

How to overcome?
1. Choose different initial
guess.
2. Modify the function g(x)
into another form.
3. Choose another method.

Fixed-point iteration converges if


g ( x)  1 Refer page 138
9
 Newton raphson method
• Most widely used method.
• Based on Taylor series expansion:
x 2
f ( xi 1 )  f ( xi )  f ( xi )x  f ( xi )  Ox 3
2!
The root is the value of x i 1 when f(x i 1 )  0
rearrangin g,
Solve for
0  f(xi )  f (xi )( xi 1  xi )
f ( xi )
xi 1  xi 
f ( xi )
10
• Based on Geometrical interpretation

f ( xi )  0
f ' ( xi ) 
xi  xi 1
rearrangin g,
f ( xi )
xi 1  xi 
f ( xi )

11
Although NR is often very efficient,
there are situations where it performs
poorly and slow convergence due to
nature of the function and other
difficulties:

a) Iterations beginning at x0
progressively diverge from the root.

b) Tendency to oscillate around a


local maximum or minimum.

c) Initial guess that is close to one


root can jump to a location several
roots away (method will not work if
a zero or near zero slope is
encountered).

d) Solution shoots off horizontally and


never hits the x axis.

12
Example

Use Newton Raphson to estimate


the root of f(x) = e-x – x, employing
an initial guess of x0 = 0. Iterate
until the true percent relative error
is less than 0.05%. Given true root
= 0.56714..
f ' ( x)  e  x  1

e  xi  xi
xi 1  xi   xi
 e 1
13
 Secant method

A slight variation of Newton’s method for


functions whose derivatives are difficult
to evaluate. For these cases the derivative
can be approximated by a backward finite
divided difference.

14
f ( xi 1 )  f ( xi )
f ( xi ) 
xi 1  xi
f ( xi )
xi 1  xi 
f ( xi )
f ( xi )( xi 1  xi )
xi 1  xi  i  1,2,3, 
f ( xi 1 )  f ( xi )
15
• Requires two initial estimates of x , e.g, xo,
x1. However, because f(x) is not required to
change signs between estimates, it is not
classified as a “bracketing” method.
• The secant method has the same properties
as Newton’s method. Convergence is not
guaranteed for all xo.

16
Example

Use Secant Method to estimate the


root of f(x)=e-x – x. Start with initial
estimates of x-1 = 0 and x0 =1. Iterate
until the true percent relative error is
less than 0.05%. Given true root =
0.56714..

Refer Example 6.6


MODIFIED SECANT METHOD

• An alternative way for Secant method


• Using new term  δ (small perturbation
fraction) – will be given (e.g 0.01, 0.03)

xi f ( xi )
xi 1  xi 
f ( xi  xi )  f ( xi )

18
Example

Use Modified Secant Method to estimate


the root of f(x)=e-x – x. Use a value of 0.01
for δ and start with x0 = 1.0 for εt < 0.01.
Given true root = 0.56714.

Refer Example 6.8

19
False position and secant method

• The similarity
– Use two initial estimates to compute an
approximation of the slope of the function that is
used to project to the x axis for a new estimate of
the root
• The difference
– How one of the initial values replaced by the new
estimate

20
Comparison of the False
position and the secant
methods.

The first iterations (a) and


(b) for both techniques are
identical.

The second iterations (c)


and (d), the points used
difference.

21
Exercise
(6.2) Determine the highest real root of
f(x) = 2x3 – 11.7x2 + 17.7x – 5

a) Fixed-point iteration method (three iterations,


x0=3). Make sure to develop a solution that
converge on the root.

b) Newton-Raphson method (three iterations,


x0=3)

c) Secant method (three iterations, x-1=3, x0=4)


22
(6.3) Use x0= 5 to determine a root of
f(x) = -x2 + 1.8x + 2.5
(a) fixed-point iteration and

(b) Newton-Raphson method

Perform the computation until a is less


than s = 0.05%.

23

Das könnte Ihnen auch gefallen