Sie sind auf Seite 1von 13

Numerical Methods

Dr. Kumar Abhishek,


Department of Mathematics,
Amrita Vishwa Vidyapeetham,
Coimbatore 641 105.

January 12, 2017


Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Roots of equations of the form f (x) = 0. . . . . . . . . . . . . 2
2.1 Bisection Method. . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Advantages of Bisection Method. . . . . . . . 5
2.1.2 Disadvantages of Bisection Method. . . . . . . 5
2.2 Secant Method. . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Geometrical interpretation of Secant method. 6
2.2.2 Advantages of Secant Method. . . . . . . . . 7
2.2.3 Disadvantages of Secant Method. . . . . . . . 7
2.3 Method of False-Position(Regula-Falsi). . . . . . . . . . 7
2.3.1 Advantages of False-position Method. . . . . 7
2.3.2 Disadvantages of False-position Method. . . . 8
2.4 Newton-Raphsons Method. . . . . . . . . . . . . . . . 8
2.4.1 Geometrical interpretation of Newton-Raphsons
method. . . . . . . . . . . . . . . . . . . . . . 9
2.4.2 Advantages of Newton-Raphsons Method. . . 9
2.4.3 Disadvantages of Newton-Raphsons Method. 9
2.5 Fixed Point iteration method. . . . . . . . . . . . . . . 10

i
Dr. Kumar Abhishek 15MAT212

1 Introduction
Our creations are based on mathematical models of what occurs in nature:

1. structural response to wind/waves/earthquakes

2. airplane performance

3. chemical reactions

4. automobile suspensions

5. steel bridge deformations

6. insurance premiums

and the list goes on.


One of the basic objectives of applied mathematics is not only to formulate an
appropriate model for a phenomena but also to provide a meaningful solution
for the given model so as to predict the evolution of the given system. Often
it is not possible to determine the analytical solution for a given system
because of:

1. complex computations

2. huge size of the problem

3. complex functional relationship between the dependent and indepen-


dent variables involved.

If the methods prescribed by

1. Algebra

2. Calculus

3. ODE and PDE

fails to provide analytical solutions for a given system, we resort to Numerical


Methods.

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 1


Dr. Kumar Abhishek 15MAT212

2 Roots of equations of the form f (x) = 0.


Let f (x) be a continuous function defined over an interval [a, b]. The function
may be an algebraic function as in the case of

f (x) = Pn (x) = a0 xn + a1 xn1 + + an ; a0 6= 0 (1)

or the given function may be a transcendental function.

Definition 2.1. A number is a root or solution or zero of f (x) = 0 if


f () = 0. Geometrically, a root of f (x) = 0 is a value of x at which the graph
of y = f (x) intersects the xaxis.

Example 2.2. = 1 are the roots of x2 1 = 0.

Example 2.3. 1 = 3 and 2 = 2 are the roots of x2 5x + 6 = 0.

Definition 2.4. If we can write f (x) as f (x) = (x)m g(x) where g() 6=
0 then is said to be root of f (x) = 0 with multiplicity m. For m = 1; is
called as simple root.

Example 2.5. 1 = 3 and 2 = 2 are simple roots of x2 5x + 6 = 0.

Example 2.6. 1 = 1 is a root multiplicity 3 for x3 + 3x2 + 3x + 1 = 0.

Irrespective of the fact whether f (x) is algebraic or transcendental func-


tion, there are generally two method to find the root of f (x) = 0

1.Direct Method: This method gives the exact value of the roots in a finite
and fixed number of steps. This also give all the roots at the same time.

Example 2.7. Solving quadratic equation ax2 + bx + c = 0 by using =


b2 4ac.

2.Iterative Method: This method is based on the idea of successive ap-


proximations ie, starting with one or more approximations to the root,
we obtain a sequence of approximations which in limiting condition
converges to the root. This method gives one root at a time.

Definition 2.8. Let {xk } be the sequence of approximations for a root of


f (x) = 0. A sequence of approximations {xk } is said to converge to the root
if
lim xk = (2)
k

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 2


Dr. Kumar Abhishek 15MAT212

Definition 2.9. If xk , xk1 , xk2 , . . . , xkm+1 be the m approximations of


the root of f (x) = 0, then a multipoint iteration function is defined as

xk+1 = (xk , xk1 , xk2 , . . . , xkm+1 ) (3)

In particular for m = 1, we get one point iteration function as

xk+1 = (xk ) (4)

Given one or more initial approximations to the root, we require a suitable


iteration function for the given f (x) such that the sequence of iterates
obtained from (3) of (4) converges to . In practice except for the rare cases,
it is not possible to find which satisfies f (x) = 0 exactly. we, therefore,
attempt to find an approximate root such that

|f ( )| < 
or, |xk+1 xk | < 

where  is the prescribed error tolerance.


To apply the iteration method to find a root to given equation of the form

f (x) = 0 (5)

initial approximations to the root has to be done. Initial approximations


to the root are often determined from the physical considerations of the
problem, or otherwise the following method are used:

1. Graphical method, or

2. Intermediate value theorem.

Once the initial approximations to the root is done an iteration function


is required. Choice of the iteration function depends upon

1. Required accuracy,

2. Rate of convergence,

3. The way the initial approximations affects the computations.

Following are some of the methods for obtaining the iteration function and
hence the solution to (5).

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 3


Dr. Kumar Abhishek 15MAT212

2.1 Bisection Method.


This method is based on the repeated application of Intermediate value the-
orem[IVT].

Theorem 2.10 (IVT). An equation f (x) = 0, where f (x) is a real con-


tinuous function, has at least one root between a and b if f (a)f (b) < 0.

If we know that a root of f (x) = 0 lies in the interval I0 = (a0 , b0 ), we


bisect the interval I0 at the point m1 defined as
a0 + b 0
m1 =
2
Once m1 is defined we define an interval I1 such that I0 I1 where

(a0 , m1 ), if f (a0 )f (m1 ) < 0;
I1 = (6)
(m1 , b0 ), if f (m1 )f (b0 ) < 0.

We next bisect the interval I1 defined in (6) at the point m2 defined as

a1 + b 1
m2 = (7)
2
where 
(a0 , m1 ), if f (a0 )f (m1 ) < 0;
(a1 , b1 ) =
(m1 , b0 ), if f (m1 )f (b0 ) < 0.
to get an interval I2 such that I0 I1 I2 where

(a1 , m2 ), if f (a1 )f (m2 ) < 0;
I2 = (8)
(m2 , b1 ), if f (m2 )f (b1 ) < 0.

We continue this procedure to get a set of nested intervals I0 I1 I2


Iq such that we either find the root or find an interval Iq of length
1
2q 0
(b a0 ) which contains the root. We take the mid point of the last
interval Iq as the approximation of the root. Thus we have

1
= mk+1 = ak + (bk ak ); k = 0, 1, 2, . . . (9)
2
where 
(ak , mk+1 ), if f (ak )f (mk+1 ) < 0;
(ak+1 , bk+1 ) =
(mk+1 , bk ), if f (mk+1 )f (bk ) < 0.

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 4


Dr. Kumar Abhishek 15MAT212

2.1.1 Advantages of Bisection Method.


1. This method uses only the end points of the interval (ak , bk ) for which
f (ak )f (bk ) < 0 not the functional values at these points, to obtain the
next approximations of the root, thereby making this method simple
to use.
2. The sequence of approximations always converges to the root for any
f (x) which is continuous in the interval which contains the root.

2.1.2 Disadvantages of Bisection Method.


1. Slow convergence.
2. Requires large number of iterations for accuracy.
3. Bisection method can be fooled by singularities in the function.
4. Bisection method cannot find complex roots of polynomials.
Problem 2.11. Perform 5 iterations of bisection method to obtain the
smallest root of f (x) = x3 5x + 1 = 0. Ans: 0.203125

Problem 2.12. Find the value of 5 correct up to 4 decimal places by
bisection method.
Problem 2.13. Perform 5 iterations of bisection method to obtain the
smallest root of f (x) = cosx xex = 0. Ans: 0.515625
Problem 2.14. Using method of bisection, compute a real root of:
3
1. x x = 1 Ans: 1.32475
2. x3 9x + 1 = 0 Ans: 2.9429
3. x cosx = 0 Ans: 0.7388
4. x3 4x + 9 = 0 Ans: 2.7065
5. xlog10 x = 1.2 Ans: : 2.742
6. x3 2x 5 = 0 Ans: 2.0943
Problem 2.15. Find the interval in which the smallest positive root of the
equation tanx + tanhx = 0 and determine the root correct to decimal places
using the bisection method. Ans: 2.37
Problem 2.16. Find the interval in which the smallest positive root of the
equation f (x) = x3 x 4 = 0 and determine the root correct to 2 decimal
places using the bisection method. Ans: 1.80

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 5


Dr. Kumar Abhishek 15MAT212

2.2 Secant Method.


In this method we try to approximate the function f (x) by a first degree
equation in the neighborhood of the root. There fore we can write

f (x) a0 x + a1 = 0 (10)

The solution of (10) is given by


a1
x= (11)
a0
where a0 6= 0 and a1 are the arbitrary parameters to be determined by
prescribing two appropriate conditions on f (x) and/or its derivatives. If
xk1 and xk are two approximations to the root, them a0 and a1 can be
determined as

f (xk1 ) = a0 xk1 + a1 (12)


f (xk ) = a0 xk + a1 (13)

on solving the above system we get,

f (xk ) f (xk1 )
a0 = (14)
xk xk1
xk f (xk1 ) xk1 f (xk )
a1 = (15)
xk xk1

Using (14) and (15) in (11) the next approximation to the root if given by

xk f (xk1 ) xk1 f (xk )


xk+1 = (16)
f (xk ) f (xk1 )

which can be rewritten as


xk xk1
xk+1 = xk f (xk ), k = 1, 2, . . . (17)
f (xk ) f (xk1 )

2.2.1 Geometrical interpretation of Secant method.


In this method, we replace the function f (x) by a straight line passing
through the points (xk , f (xk )) and (xk+1 , f (xk+1 )) and take the point of in-
tersection of the straight line with the xaxis as the next approximation to
the root.

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 6


Dr. Kumar Abhishek 15MAT212

2.2.2 Advantages of Secant Method.


1. It converges at faster than a linear rate, so that it is more rapidly
convergent than the bisection method.
2. It does not require use of the derivative of the function, something that
is not available in a number of applications.
3. It requires only one function evaluation per iteration, as compared with
Newtons method which requires two.

2.2.3 Disadvantages of Secant Method.


1. It may not converge.
2. There is no guaranteed error bound for the computed iterates.
3. Newtons method generalizes more easily to new methods for solving
simultaneous systems of nonlinear equations.
Problem 2.17. Perform 5 iterations of secant method to obtain the small-
est root of f (x) = x3 5x + 1 = 0.

Problem 2.18. Find the value of 3 17 correct up to 4 decimal places by
secant method.
Problem 2.19. Perform 5 iterations of secant method to obtain the small-
est root of f (x) = cosx xex = 0.

2.3 Method of False-Position(Regula-Falsi).


Geometrically this method is similar to the secant method except for the fact
that the points xk and xk+1 is chosen such that f (xk )f (xk+1 ) < 0. Using the
arguments similar to that of secant method we get the iteration function as

xk xk1
xk+1 = xk f (xk ), k = 1, 2, . . . , where, f (xk )f (xk+1 ) < 0
f (xk ) f (xk1 )
(18)

2.3.1 Advantages of False-position Method.


1. Simple to execute.
2. Brackets root.
3. Gives maximum error.

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 7


Dr. Kumar Abhishek 15MAT212

2.3.2 Disadvantages of False-position Method.


1. Can be VERY slow.

2. Like Bisection, needs an initial interval around the root.

Problem 2.20. Find the root of xex 2 = 0 correct upto 4 decimal places
using false-position method.
Problem 2.21. Find the root of cosx xex = 0 correct upto 3 decimal
places using false-position method.
Problem 2.22. Find the root of x3 5x + 1 = 0 correct upto 6 decimal
places using false-position method.
Problem 2.23. Using method of false position, compute a real root of:
1. x3 4x + 1 = 0 Ans: 0.2541

2. x3 0.2x2 1.2 = 0 Ans: 1.198

3. x3 2x 5 = 0 Ans: 2.094548

4. xex 3 = 0 Ans: 1.050

5. xlog10 x 2 = 0 Ans: 2.74065

6. xex cosx = 0 Ans: 0.5177

2.4 Newton-Raphsons Method.


Let xk be an approximation to the root of the equation

f (x) = 0 (19)

Let x be an increment in x such that

xk+1 = xk + x (20)

is an exact root of (19). Therefore,

f (xk + x) = 0. (21)

Expanding f (xk + x) in Taylors series about the point xk , we get

(x)2 00 (x)3 000


f (xk + x) = f (xk ) + xf 0 (xk ) + f (xk ) + f (xk ) + . . .
2! 3!

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 8


Dr. Kumar Abhishek 15MAT212

which can be rewritten as

f (xk + x) = f (xk ) + xf 0 (xk ) + O(x)2 (22)


f (xk ) + xf 0 (xk ) (23)
Using (20), (21) and (23) we get,

f (xk )
xk+1 = xk , k = 1, 2, . . . (24)
f 0 (xk )

2.4.1 Geometrical interpretation of Newton-Raphsons method.


This method is a particular case of secant method, where the next approx-
imation to the root of (19) is chosen as the point where the tangent to the
curve f (x) intersect the xaxis.

2.4.2 Advantages of Newton-Raphsons Method.


1. Unlike bisection method this method is not fooled by the singularities
of the function.
2. This method can identify the repeated roots, since it doesnot look for
the changes in the sign of f (x).
3. We can find the complex root of the function, if it exists, provided we
take the complex value as our initial approximation.
4. For many problems, Newton-Raphson converges quicker than either
bisection or incremental search.

2.4.3 Disadvantages of Newton-Raphsons Method.


1. The Newton-Raphson method only works if you have a functional rep-
resentation of f 0 (x). Some functions may be difficult to impossible to
differentiate.
2. The Newton-Raphson method is not guaranteed to find a root. For
example, if the starting point x1 is sufficiently far away from the root
for the function f (x) = tan1 x, the functions small slope tends to drive
the x guesses further and further away from the root.
3. If the derivative of the function at any tested point xi is sufficiently
close to zero, the next point xi+1 will be very far away. You may still
find the root, but you will be delayed.

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 9


Dr. Kumar Abhishek 15MAT212

4. If the derivative of the function changes sign near a tested point, the
Newton-Raphson method may oscillate around a point nowhere near
the nearest root.

Problem 2.24. Find the root of xex 2 = 0 correct upto 4 decimal places
using Newtons method.

Problem 2.25. Find the root of cosx xex = 0 correct upto 3 decimal
places using Newtons method.

Problem 2.26. Find the root of x3 5x + 1 = 0 correct upto 6 decimal


places using Newtons method.

Problem 2.27. Using method of Newton-Raphson, compute a real root of:

1. (x 1)sinx x = 1 Ans: 0.42036

2. ex = sinx Ans: 0.5885

3. x3 25 = 0 Ans: 2.924

4. x4 x 1 = 0 Ans: 1.22138

5. x + ex = 0 Ans: 0.567

6. 3x3 + 4x 40 = 0 Ans: 0.5635

2.5 Fixed Point iteration method.


If we can transform
f (x) = 0 (25)
algebraically as
x = g(x). (26)
Then we can choose an x0 and compute

x1 = g(x0 )
x2 = g(x1 )
x3 = g(x2 )
..
.

xn+1 = g(xn ) (27)

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 10


Dr. Kumar Abhishek 15MAT212

The solution of (27) is called a fixed point of g(x). Depending on the choice
of g(x) the behavior of the iteration sequence x0 , x1 , x2 , . . . may differ, in
particular with regards to the convergence. The convergence of the iteration
method being dependent on the choice of g(x) and x0 , we require a condition
which will ensure that the sequence of iterates x0 , x1 , x2 , . . . converges for a
particular choice if g(x). The following theorem lays down the condition on
g(x).

Theorem 2.28. Let x = s be a solution of (26) and suppose that g(x) has
a continuous derivative in some interval I containing s. Then if |g 0 (x)|
K < 1 in I then the iteration process defined by (27) converges for any
x0 I.

The proof of the Theorem 2.28 is essentially an application of Lagranges


Mean Value Theorem.

Problem 2.29. Find the root of x2 3x + 1 = 0 correct upto 4 decimal


places using fixed point method.

Problem 2.30. Correct up to 4 decimal places find the roots of the fol-
lowing using fixed point method.

1. ex 3x = 0 Ans: 0.6190

2. cosx = 3x 1 Ans: 0.6071

3. cosx xex = 0 Ans: 0.5177

4. x3 = 2x + 5 Ans: 2.0945

5. x3 + x2 1 = 0 Ans: 0.7548

6. 2x log10 x = 7. Ans: 3.7892

Dept. of Mathematics, Amrita Vishwa Vidyapeetham 11

Das könnte Ihnen auch gefallen