0% found this document useful (0 votes)
3 views165 pages

Error Estimation in Numerical Methods

Chapter one of the document covers basic concepts of error estimation in numerical methods, including the identification of error sources and types. It discusses inherent and truncation errors, rounding techniques, and the propagation of errors in computations. The chapter emphasizes the importance of understanding errors for effective numerical problem-solving in engineering contexts.

Uploaded by

edrisabbas3
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)
3 views165 pages

Error Estimation in Numerical Methods

Chapter one of the document covers basic concepts of error estimation in numerical methods, including the identification of error sources and types. It discusses inherent and truncation errors, rounding techniques, and the propagation of errors in computations. The chapter emphasizes the importance of understanding errors for effective numerical problem-solving in engineering contexts.

Uploaded by

edrisabbas3
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

Numerical Method for Engineering

Chapter one

Basic Concepts on error estimation

Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of errors


 Identifying the source of errors
 Identifying the types of errors

INTRODUCTION

Numerical methods are methods for solving problems on computers by numerical calculations,
often giving a table of numbers and/or graphical representations or figures. Numerical methods
tend to emphasize the implementation of algorithms. The aim of numerical methods is therefore
to provide systematic methods for solving problems in a numerical form. The process of solving
problems generally involves starting from an initial data, using high precision digital computers,
following the steps in the algorithms, and finally obtaining the results. Often the numerical data
and the methods used are approximate ones. Hence, the error in a computed result may be caused
by the errors in the data, or the errors in the method or both.
Definition: Numerical method is the study of approximate analysis for solving problems of
mathematical analysis by means of arithmetic calculations.

Basic concepts of errors

Objectives:

At the end of this topic students should be able to:

 define errors
 identifying thesource of errors

1
Numerical Method for Engineering

Analysis of errors is the central concern in the study of numerical methods and therefore we
will investigate the sources of errors, the type of errors that may be occurring in the given
problem and the subsequent propagation of errors.
1.1. Sources of errors
The main sources of errors in obtaining numerical solutions to mathematical problems are:
a. The model: To solve different problems, mathematical models are formulated to describe
them and these models do not describe them exactly and as a result errors are introduced.
b. The numerical method: The methods used to solve the mathematical models are often
not exact and as a consequence errors are induced.
c. The data: There may be errors in measuring or estimating values.
d. The representation of numbers: A computer has a finite word length and so only a
fixed number of digits of a number are inserted and as a consequence errors are
introduced.
e. The arithmetic: Frequently errors are introduced in carrying out operations such as
addition and multiplication.

Remark 1: There are two kinds of numbers which are exact and approximate numbers.

Example 1.1

a. The numbers ⁄ ⁄ √ and so on written in this manner are exact


numbers.
b. The numbers and so on are approximate values
of the number .
 The digits that are used to express a number are called significant digits or significant
figures.

Example1. 2

a. The numbers and each contain five significant digits.


b. The numbers and each contain two significant figures.

2
Numerical Method for Engineering

1.2. Approximation of errors

Objectives:

At the end of this topic students should be able to:

 identifying the types of errors

Classification of errors

1. Inherent errors: Most of numerical computations are inexact either due to the given data
or due to the limitations of the computing aids such as mathematical tables, desk
calculators or the digital computers. Due to these limitations numbers have to be rounded
causing errors called inherent (rounded – off) errors. These errors cannot be completely
removed but can be minimized if we select a better data and by using computing aids of
higher precision.
2. Truncation errors: The mathematical models may be algebraic or transcendental or
other types of equations. The solution of such equations may not be solved analytically,
hence we use numerical methods. In the process errors are induced and such errors are
called truncation errors. In general, truncation errors are errors due to the model and
method.
1.3. Rounding of numbers

Objectives:

At the end of this topic students should be able to:

 Understanding the concept chooping and rounding of errors

With digit computer a number with mantissa greater than digits cannot be represented
exactly. Such number must be reduced to digits and there are two ways of reducing the
number of digits of the given number.

a. Chopping: In a digit computation, all digits of the number to the right of are
dropped – off.

3
Numerical Method for Engineering

Let sign , where , then in a digit computer the


mantissa is copped as:

Therefore, the number to be represented in side the computer is given by:

̃ Sign ̃

The resulted error in this process is given by the formula | ̃|.

b. Rounding: In this method if and if


1. , we add to that is we round up.
2. , we drop – off all digits after the first digits.
3. , then round – off to if is odd otherwise chop – off (Here the number to
be rounded – off is called correct to n significant digits).

Let sign , where , then

1. If and is add (odd if ), then


̃

Therefore, the number to be represented in side the computer is given by:

̃ Sign ̃

2. If and is even (even if ), then


̃

Therefore, the number to be represented in side the computer is given by:

̃ Sign ̃

In both cases the resulted error in this process is given by the formula | ̃|.

Example1.3 Let , then represent the number inside the computer


with the given capacity and find the error.

4
Numerical Method for Engineering

Solution: Chopping form: Here and ̃ .

Therefore, the number becomes, ̃ and the resulted error is given by:

| ̃| | |

Rounding form: Here and ̃ .

Therefore, the number becomes, ̃ and the resulted error is given by:

| ̃| | |

1.4. Absolute error and relative error

Objectives:

At the end of this topic students should be able to:

 Define theAbsolute error and relative of errors

Absolute error: Is the numerical difference between the true value of a quantity and its
approximate value. i.e. . if is the true value of a quantity and ̃ is its approximate value, then
the absolute error is given by:

| ̃|

̃
Relative error: The relative error is defined by: | |

 The percentage relative error is given by .

Example1. 4 Let the exact value or true value of the number is ⁄ and its approximate value is
, then find the absolute error, relative error and the percentage relative error.

Solution: | ̃| | ⁄ | ⁄

̃ ⁄
| | | | ⁄

5
Numerical Method for Engineering

⁄ ⁄

Example 1.5 Three approximate values of the number ⁄ are given as and .
Which one of the three is the best approximation?

Solution: The value with the smallest absolute error is the best approximation and therefore we
have to find the absolute errors. Let ̃ ̃ and ̃

| ⁄ | ⁄

| ⁄ | ⁄

| ⁄ | ⁄

Here, ⁄ ⁄ ⁄

Therefore, the best approximation of the number is .

Example 1.6 Given the number is approximated using significant digits.

a. Determine the relative error due chopping and express it as a percentage.


b. Determine the relative error due to rounding and express it as a percentage.

Solution:

a. In case of chopping , then the relative error is:

| | | |

and .
b. In case of rounding ( & ), then the relative error is:

| | | |

and .

Remark 2: If the number is rounded to decimal places, then the absolute error is given by:

6
Numerical Method for Engineering

Example 1.7 If and correct to two decimal places, then find the absolute error.

Solution: , but in this case

1.5. Propagation of errors


Objectives:

At the end of this topic students should be able to:

 Define thePropagation of errors

Propagation of errors is the measure how the error in the independent variable yield an error on
the dependent variable. Suppose that we have a function that is dependent on a single
independent variable . Assume that ̃ is an approximation of . Now, we would like to assess
the effect of the discrepancy between and ̃ on the value of the function. That is we would like
to estimate
̃ | ̃ |
The problem with evaluating ̃ is that is unknown, because is unknown. We can
overcome this difficulty if ̃ is very close to and ̃ is continuous and differentiable. If these
conditions hold, then Taylor series expansion can be employed to compute near ̃ .
̃ ̃
̃ ̃ ̃ ̃ ̃

For very small ̃ dropping the second and higher order derivatives and rearranging the
rest yields
̃ ̃ ̃
̃ ̃ ̃
| ̃ | | ̃ ̃ |

| ̃ | | ̃ | ̃

7
Numerical Method for Engineering

̃ | ̃ | ̃

Where, ̃ | ̃ | represents an estimation of the error of the function and


̃ | ̃| represents an estimation of the error of .

Example 1.8 Estimate the error committed in , when is approximated by ̃


with error ̃ .

Solution: ̃ | ̃ | ̃ | ̃ | ̃

1.6. Numerical computation


Objectives:
At the end of this topic students should be able to:

 Undrerstanding the concept of programming

The analytic methods have certain limitation in practical application. So, exact solution is not
possible from applied mathematics, in such cases numerical methods are very important tools to
provide practical method for calculating the solutions of the problems.

So, it is essential to use numerical methods in programming problems on computers if and only
if the method is inherently efficient and good programmed.

Therefore, to solve problems using computers we have to follow the following steps.

1. Selection(choice) of a method
2. Designing(preparation) of algorithm
3. Flow charting
4. Programming
5. Execution of the program.

8
Numerical Method for Engineering

Selection of the method: Is the selection of a mathematical formula to the given problem to
find the solution. In this case, there may be more than one method available and hence only one
method must be chosen.

After the method has been decided a complete set of computational steps have to be followed in
a sequence and this sequence of steps is called an algorithm. A diagrammatic representation that
illustrates the sequence of steps to be performed to arrive at the solution is called a flow chart.

We can summarize these commonly used symbols to represent these illustrations and their
meaning as

Start or stop of the program

Input or out put

Computations

Decision making

For loops

Connector for joining of two parts of a flow chart

Example1. 9 Develop the algorithm and draw the flow chart to solve a quadratic equation.

Solution: The quadratic equation is given by . To solve this problem, first find
the descriminant .

Case 1: Let is negative, then the roots are complex roots. That is

√ √
and the roots are

9
Numerical Method for Engineering

√| | √| |
and

Case 2: Let , then the roots are real and equal and given by:

Case 3: Let is positive, then we have two real roots and the roots are:

√ √
and

Algorithm

1. Input
2.
3. If
4. Cout the roots are imaginary

5.

6.
7. Cout the roots are
8. Else if
9. Cout the roots are equal and real

10.

11. Cout
12. Else
13. Cout the roots real and unequal
14.
15.
16. Cout
17. Stop

10
Numerical Method for Engineering

Flow chart
Start

Input

Yes If No

Display imaginary
roots Yes

No
Display equal
real roots
Display two
d/t real roots
a

Display,

Display Display

11
Numerical Method for Engineering

Stop

Unit Summary

In this chapter we described the concept of error, the source of error.


There are two kinds of numbers which are exact and approximate numbers.
The digits that are used to express a number are called significant digits or significant figures.
The main sources of errors in obtaining numerical solutions to mathematical problems are the
model, the numerical method, the data, the representation of numbers and the arithmetic.
We have defined absolute and relative errors, inherent errors, round-off errors, truncation
errors, machine epsilon and error propagation.
Methods for the estimation were briefly outlined.

Review Exercise
1. Determine the absolute and relative errors involved if x = 2/3 is represented in normalized
decimal form with 6 digits by
a. Round-off
b. Truncation.
2. Given that digit chopping is used for arithmetic calculations involving where

and . Determine the absolute and relative errors involved.

3. If x = 3.536, determine the absolute error and relative error when.


a. is rounded
b. is truncated to two decimal digits.
4. Show that the relative error of the product where x and
is . Assume | | and | | .
5. Show that the relative error of the quotient where x and is
Assume | | << 1 and | | << 1.
6. If the number x = 57.46235 is rounded off to four significant figures, find the absolute error,
relative error and the percentage relative error.
7. Determine the true error and true percentage relative error for each case.
a. If the measured length of a track is approximated by 9999 cm and the true value is 10,000 cm

12
Numerical Method for Engineering

b. If the measured length of a track is approximated by 9 cm and the true value is 10 cm.

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

John F. Mathews Numericalmethods using MATLAB, third edition

John F. Mathews Numericalmethods using MATLAB, third edition

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

13
Numerical Method for Engineering

Chapter Two

Non – Linear Equations

Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of direct indirect method


 Understand the concepts of Bisection method and False position method
 Understand the concept of successive approximation method, secant method and Newton-
Rabson method
 Identifying the differences between Bisection method, False position
methodapproximation method, secant method and Newton- Rabson method

Introduction
One of the most common problems encountered in engineering analysis is that given a function
find the values of x for which . The solution(values of ) are known as the roots
of the equation , or the zeroes of the function
The roots of equations may be real or complex. In general, an equation may have any number of
(real) roots or no roots at all. For example, – has a single root, namely, ,
whereas tan x – x = 0 has infinite number of roots ( There are two
types of methods available to find the roots of algebraic and transcendental equations of the form

1. Direct Methods: Direct methods give the exact value of the roots in a finite number of steps.
Weassume here that there are no rounds off errors. Direct methods determine all the roots at the
same time.
2. Indirect or Iterative Methods: Indirect or iterative methods are based on the concept of
successive approximations. The general procedure is to start with one or more initial
approximation to the root and obtain a sequence of iterates ( which in the limit converges to
the actual or true solution to the root. Indirect or iterative methods determine one or two roots at
a time. The indirect or iterative methods are further divided into two categories: bracketing and
open methods. The bracketing methods require the limits between which the root lies, whereas

14
Numerical Method for Engineering

the open methods require the initial estimation of the solution. Bisection and False position
methods are two known examples of the bracketing methods. Among the open methods, the
Newton-Raphson and the method of successive approximation are most commonly used. The
most popular method for solving a non-linear equation is the Newton-Raphson method and this
method has a high rate of convergence to a solution.
This chapter deals about way of solving non – linear equations using different types of numerical
methods.

The following equations are called non – linear equations

 Quadratic equations given by:


 Cubic equations given by:
 General polynomial equations of degree , given by

 Equations which contains transcendental functions such as


etc. that is:

2.1 Locating roots

Let us suppose that our aim is to find some or all roots of the non – linear equation .
Before we use a numerical method, we should have some idea about the approximate location of
the roots. The usual approach involves the construction of graphs or tables of values of the
function . The equation can be expressed by splitting into two elementary
functions and such that

(*)

And then sketch the graph of . The desired roots are then the values of x in the
intersection points of the graphs.

Example2.1 Locate the roots of the equation .

Solution: let a , then the graphs of and are given as


follows:

15
Numerical Method for Engineering

Fig.1

We can deduce from the graph that the equation has only one root near and we then tabulate
near as follows:

Therefore, the root lies between .

2.2 Bisection method


Objectives:

At the end of this chapter the students will be able to:


 Understand the concepts of Bisection method

Suppose we have an equation ,

where is continuous on and and or vice versa and now


assume the first one.

16
Numerical Method for Engineering

True solution

True solution

Fig.2 Solution of between and

In order to find a root of lying in the interval we divide the interval into half. i.e.

then

1. If , then is the exact root of the equation.


2. If , then the root lies in the interval .
3. If , then the root lies in the interval .

Then the newly reduced interval denoted by is again halved and the same
investigation is made. Finally, at some stage in the process, we get either the exact root of
or a finite sequence of intervals such that
and . If | | , is a given absolute error or tolerance,
then the process terminates and the approximate root is .

Example 2.2 Solve the equation using the Bisection method in the interval
with error .

Solution: Here and

is continuous in the given interval and . Hence, there is a


root of the equation in the given interval.

and

17
Numerical Method for Engineering

Then, the root lies in the interval and | |

and

Then, the root lies in the interval and | |

and

Then, the root lies in the interval and | |

and

Then, the root is in the interval & | |

and

Then, the root lies in the interval and

| |

and

Then, the root lies in the interval and

| |

and

Then, the root lies in the interval and

| |

Then, the root lies in the interval and

18
Numerical Method for Engineering

| |

Then, the root lies in the interval and

| |

Then, the root lies in the interval and

| |

Since | | , the process terminates and the


approximate root of the equation is .

Table 1 shows the entire iteration procedure of bisection method.


iter A B m=(a+b)/2 f(a) f(b) f(m) swap |b-a|
1 0 1 0.5 3 -1 0.625 a=m 1
2 1 0.625 -1 b=m 0.5
3 0.625 a=m 0.25
4 b=m 0.125
5 a=m 0.0625
6 b=m 0.03125
7 b=m 0.015625
8 b=m 0.0078125
9 b=m 0.0039062
10 b=m 0.0019531
11 b=m 0.0009765

Stopping Criteria

19
Numerical Method for Engineering

Since in this an iterative method, we must determine some stopping criteria that will allow the
iteration to stop. Here are some commonly used stopping criteria.
Let ε be the tolerance; that is, we would like to obtain the root with an error of at most of ε. Then
Accept as a root of if any of the following criteria is satisfied:
1. | | (The functional value is less than or equal to the tolerance).
| |
2. | |
(The relative change is less than or equal to the tolerance).

3. (The length of the interval after k iterations is less than or equal to the tolerance).

4. The number of iterations k is greater than or equal to a predetermined number, say n.


Comments:
1. The Criterion 1 can be misleading, since, it is possible to have | | very small, even if
is not close to the root.
2. The Criterion 3 is based on the fact that after k steps, the root will be computed with error at

most

Number of Iterations Needed in the Bisection Method to Achieve Certain Accuracy


Let's now find out what is the minimum number of iterations n needed with the Bisection method
to achieve a certain desired accuracy.
Length of the first interval after iteration after iterations ,

after iterations . Since the pre-determined error toleranceε for the error cannot be

larger than the length of the interval, then, knowing ε it is always easy to predict the number of

iterations n: ( )

Therefore, the number of iterations n needed in the Bisection Method to obtain an accuracy
(error tolerance) of is given by

(2)

Remarks: Since the number of iterations needed to achieve a certain accuracy depends upon
the initial length of the interval containing the root, it is desirable to choose the initial interval
as small as possible.

20
Numerical Method for Engineering

advantages of bisection method


a) The iteration using bisection method always produces a root, since the method brackets the
root between two values.
b) As iterations are conducted, the length of the interval gets halved. So one can guarantee the
convergence in case of the solution of the equation.
c) The Bisection Method is simple to program in a computer.
d) The number of iterations needed to achieve a specific accuracy is known in advance.
Disadvantages of bisection method
a) The convergence of the bisection method is slow as it is simply based on halving the interval.
b) Bisection method cannot be applied over an interval where there is a discontinuity.
c) Bisection method cannot be applied over an interval where the function takes always values of
the same sign.
d) The method fails to determine complex roots

Exercise 2.1 Solve the following equations using the bisection method

1. in the interval with .


2. in the interval correct to two decimal places.
3. – – = 0 in the interval 2, 3][accurate to three decimal places.

2.3 False position method

21
Numerical Method for Engineering

Objectives:
At the end of this chapter the students will be able to:

 Understand the concepts of False position method

The curve is not generally a straight line. Assume that is continuous in the interval
and .

Approximate solution

Exact solution

Fig.3 False position method

Now, the equation of the straight line which passes through the points and is
given by:

( )

( )

Now, if we find the intercept, then it is given as follows:

Therefore, the approximate root of the equation is given by the formula

22
Numerical Method for Engineering

Suppose that and , then as in the Bisection method we follow three cases.

1. If ̃ , then ̃ is the exact root of the equation.


2. If ̃ , then the root lies in the interval ̃ .
3. If ̃ , then the root lies in the interval ̃.
 If either case 2 or 3 occurs, then the process is repeated until the root is obtained to the
desired accuracy.

Example 2.3 Solve the equation using False position method in the interval
with .

Solution: Here and .Now, is continuous in and


. Hence there is a root of the equation in the given interval.

̃ ,

and | | . Then, the root lies in the interval .

̃ ,

and | | . Then, the root lies in the interval .

and| | .

Then, the root lies in the interval .

and | | .

Then, the root lies in the interval .

23
Numerical Method for Engineering

and | | .

Since | | , the process terminates and the approximate


root of the equation is ̃ .

Exercise 2.2Solve the following equations using False position method

1. in the interval with .


2. in the interval to an accuracy of five digits.
3. – . Correct to four decimal places

2.4 Successive approximation (fixe point Iterative)method


Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of Successive approximation method ( Iterative method)


Definition: Consider a real function A number a is called a fixed point of the
function if it satisfies
f
Suppose we are trying to solve the equation We can rearrangethis equation as
so now we are looking for a fixed point for the function
We start with an initial guess x0 and compute a sequence of successiveapproximations
using the formula

If the sequence converges, then it will converge to the fixed point of


so we have found the root of
Dan
aNow chose the initial value and the next approximations are given by:

Remark 2: the process terminates if two consecutive approximate values of are nearly equal
with the prescribed error.

Example 2.4 Solve the equation using trial and error method.

24
Numerical Method for Engineering

Solution: Let √

Or

Or √

Now, let us use the first equation and initial value , then

√ √

√ √

√ √

etc.

Convergence condition for the fixed-point iteration scheme

Consider the equation Consider the equation , which has the root a and can be written
as the fixed-point problem g(x) = x. If the following conditions hold which has the root a and can
be written as the fixed-point problem g(x) = x. If the following conditions hold
1. and are continuous functions;
2. | |

then the fixed-point iteration scheme based on the function g will convergeto a.

Alternatively, if | | then the iteration will not converge to a.


(Note that when | | 1 no conclusion can be reached.)
D

Exercise 2.3Solve the following equations using the method of successive approximation.

25
Numerical Method for Engineering

1. with correct to three decimal places.


2. with correct to four decimal places.
3. – Correct to four decimal places.

2.5 Newton Raphson method

Assume we need to find a root of the equation Consider the graph of the function
and an initial estimate of the root, . To improve this estimate, take the tangent to the
graph of through the point and let be the point where this line crosses the
horizontal axis

26
Numerical Method for Engineering

27
Numerical Method for Engineering

This method is simple and fast. Let be an initial approximate root of and let
such that and is continuous and differentiable. Then, using Taylor
series expansion can be expanded as:

Then,

Now, neglect the second and higher order derivatives and we get

In general, the Newton Raphson method is given by:

With

 The process terminates when two successive values of are nearly equal with the
prescribed error.

Example 2.5 Solve the equation using Newton Raphson method with initial
point and .

Solution: Here, and , then

and | | | |

28
Numerical Method for Engineering

and | | | |

and | | | |

and | | | |

Since, | | , the process terminates and the approximate root is


.

Advantages and disadvantages of Newton‟s method:

 The error decreases rapidly with each iteration


 2 Newton‟s method is very fast. (Compare with bisection method!)
 3 Unfortunately, for bad choices of x0 (the initial guess) the method can
fail to converge! Therefore, the choice of x0 is very important!
 4 Each iteration of Newton‟s method requires two function evaluations,
while the bisection method requires only one.
Note: A good strategy for avoiding failure to converge would be to use the bisection method for
a few steps (to give an initial estimate and make sure the sequence of guesses is going in the
right direction) followed by Newton‟s method, which should converge very fast at this point.
Da

Exercise 2.4 Solve the following equations using the Newton Raphson method

1. With and .
2. Near accurate to five decimal places.

29
Numerical Method for Engineering

2.6 Secant method

The secant method is very similar to the Newton-Raphson method. The main disadvantage of the
Newton-Raphson method is that the method requires the determination of the derivatives of the
function at several points and often the calculations of these derivatives takes too much time. To
remove these difficulties, we use this method. In this method given in the Newton-
Raphson method is approximated in the following way

Where, and are two approximations of the root. Then, the iterative formula to go from the
to the approximation is given by:


( )

 The process terminates when two successive values of are nearly equal with the
prescribed error.

Example 2.6 Solve the equation using secant method with and
.

Solution: Here and

30
Numerical Method for Engineering

| | | |

| | | |

| | | |

Since , the process terminates and the approximate root of the


equation is .

Advantages and disadvantages of secant method:

 The error decreases slowly at first but then rapidly after a few
iterations.
 2 The secant method is slower than Newton‟s method but faster than
the bisection method.
 3 Each iteration of Newton‟s method requires two function evaluations,
while the secant method requires only one
 4 The secant method does not require differentiation.
Exercise 2.5 Solve the following equations using the secant method

1. with and correct up to five significant figures.


2. with and correct up to five significant figures.
3. Solve the equation using the initial value and

31
Numerical Method for Engineering

Unit Summary

In this chapter, the techniques for the numerical solution of algebraic and transcendental
equations have been presented. Numerical methods involving iterative solution of
nonlinear equations are more powerful.
These methods can be divided into two categories: Direct methods and Indirect (or
iterative) methods. The indirect or iterative methods are further divided into two
categories: bracketing and open method. The bracketing methods require the limits
between which the root lies, whereas the open methods require the initial estimation of
the solution. Bisection and False Position methods are two known examples of the
bracketing methods. Among the open methods, the Newton-Raphson and the method of
Successive Approximation are most commonly used.
The most popular method for solving a non-linear equation is the Newton-Raphson
method and this method has a quadratic rate of convergence. These methods have been
illustrated with examples.

Review Exercise

1. Use the Bisection method to find a solution accurate to four decimal places for
in the interval (
2. Use the Bisection method to compute the root of – correct to three decimal
places in the interval
3. Use the Bisection method to determine a root correct to three decimal places of the
equation . Interval
4. Use the method of False Position to find solution accurate to within for the function
– in the interval ).

5. Use the method of False Position to solve the equation accurate to three
decimal places starting with as the initial approximations to the root.
6. Use the method of False Position to solve the equation – correct to four
decimal places in the interval

32
Numerical Method for Engineering

7. A root of – lies close to . Determine this root with


the Newton-Raphson method to five decimal accuracy.
8. A root of – lies in the interval ( Determine this root with the
Newton-Raphson method to five decimal accuracy.
9. Use Newton-Raphson method to find the smallest positive root of the equation
accurate to four decimal places.
10. Use the Successive Approximation method to find correct to four significant figures a real

root of – .
11. Use the Successive Approximation method to find correct to four decimal places a real root
of – – .
12. Find the real root of the equation – – to three significant digits using the
Successive Approximation method.
13. Find a root of the equation x3 – 75 = 0 using the secant method with the initial
approximations of and
14. Find a root of the equation – using the secant method with initial
approximations and .

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

John F. Mathews Numericalmethods using MATLAB, third edition

33
Numerical Method for Engineering

Chapter Three
Systems of linear equations
Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of direct and indirect method


 Understand the concepts of Gauss elimination andGauss Jordan elimination method
 Understand the concepts ofMatrix inversion using Jordan’s method
 Understand the concept of Matrix Decomposition (LU factorization)method
 Understand the concept of GaussJacobi and Gauss-Seidel methods
 Understand the concept of Newton’s method

Introduction
Systems of simultaneous equations occur in solving problems in a wide variety of disciplines,
including mathematics and statistics, the physical, biological, and social sciences, as well as
engineering and business. They arise directly in solving real world problems depending on the
structure of the equations. In this chapter we present the solution of n linear simultaneous
algebraic equations in n unknowns. Linear systems of equations are associated with many
problems in engineering and science, as well as with applications of mathematics to the social
sciences and quantitative study of business and economic problems.
A linear system of equations in unknowns is a set of the system of algebraic
equations has equations of the form

. . . . (3.1)
. . . .

Where, the coefficients and the are constants.


The system (3.1) is homogeneous if all the are zero, otherwise is non-homogeneous.
In matrix form, the system (3.1) can be written as
(3.2)

34
Numerical Method for Engineering

Where,

( )( ) ( )

There are two different approaches for finding numerical solutions of a system of equations,
namely
1) Direct methods (or exact methods)
2) Indirect methods (or approximated methods)

3.1 Direct methods for system of linear equations

Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of direct method


 Understand the concepts of Gauss elimination method, Gauss-Jordan elimination
method, Matrix Inversion method, LU-decomposition method etc.
 Solve system of linear equations using Gauss elimination method, Gauss-Jordan
elimination method, Matrix Inversion method, LU-decomposition method etc.

Let be any given linear system. Then there are different numerical methods to find the
exact solution set of the given system, some of methods to be discussed in this chapter are:
1) Gauss elimination method
2) Gauss-Jordan elimination method
3) Matrix Inversion method
4) LU-decomposition method

The Backward and Forward substitution formulas

In linear system of equations, where the coefficient matrix is triangular are simple to
solve.A system , where an upper triangular matrix is has the form:

35
Numerical Method for Engineering

If we assume , for all , then the unknowns can be computed in the


order of as follows:

This can be written in more compact form as follows:



(Backward substitution formula)

A linear system of equations which has a lower triangular coefficient matrix has the form
is written as:

Assuming , for all , the unknowns are computed in the order of

as follows:

36
Numerical Method for Engineering

This can be written in more compact form as follows:



(Forward substitution formula)

3.1.1 Gauss elimination method


In this method, the unknowns are eliminated successively and the system is reduced to an upper
triangular system from which the unknowns are found by back substitution.
For the sake of simplicity, we restrict ourselves to the system of 3 equations in 3 unknowns:

(3.3)

Step-1: elimination of from the second and the third equations. By assuming that ,
we eliminate from the second equation by subtracting ( ) times the first equation from
the second equation. Similarly, we eliminate from the third equation by subtracting ( )
times the first equation from the third equation. We thus, get the new system

(3.4)
Note:
 In a given system of linear equations, an equation which is used to eliminate variables
from other equations is called a pivot equation and its first nonzero coefficient is called a
pivot (or pivot element). Here „ ‟ is called the pivot element (or the first pivot) and
the first equation is called a pivot equation.
Step-2: elimination of from the third equation in the new system (3.4). Assuming that
, we eliminate from the third equation of (3.4) by subtracting ( ) times the second
equation from the third equation. We thus, get the new upper triangular system

(3.5)
Step-3: the unknowns and are obtained from the upper triangular system (3.5) by back
substitution.

Remark 1: we make the above steps by applying one of the following elementary operations.

37
Numerical Method for Engineering

1. Interchanging of two rows


2. Multiplication of one row by a non-zero constant
3. Addition of a multiple of one row to another row.
 Finally, by applying backward substitution formula we find the values of the unknowns.

Example 3.1Use Gaussian elimination to solve the linear system

Solution: Set the equations as


(i)
(ii)
(iii)
(iv)
First, to eliminate from (ii), (iii), and (iv), we operate [( and
We obtain,
(i)
(v)
(vi)
(vii)
Second, to eliminate from (vi) and (vii), we operate [(vi)-3.1/3.8(v)] and
We obtain,
(i)
(v)
(vii)
(ix)
Next, to eliminate from (ix), we operate We thus, get
a system of upper triangular form

38
Numerical Method for Engineering

Finally, the unknowns are obtained by back substitution as


, , , and .
Example 3.2 Given the system of equations

Solve for and by using Gaussian elimination method.

Solution: The augmented matrix of the system is:

( +

Step 1:

( + ( ) [ ]

Step 2:

( ) ( )

Here, ( ) is the augmented matrix of the system of equations given below

39
Numerical Method for Engineering

Now, to find the values of and we apply the backward substitution formula. i.e.

From equation , we get and substitute this into equation and solve for and we
get . Finally, substitute values of and in equation and solve for , then we get
.
Therefore, the solution of the system is { }.
Exercise 3.1 Using Gaussian elimination method solve the following system of linear equations.

1.

2. ( ,( ) ( ,

3.1.2 Gauss elimination with partial pivoting

If the pivot is zero, the entire process in Gaussian elimination fails and if it closes to zero, round
off errors may occur. These problems can be avoided by adopting a procedure called pivoting. In
the first step, the numerically largest coefficient of is chosen from all the equations from all
the equations and brought as the first pivot by interchanging the first equation with the equation
having the largest coefficient of . In the second step, the numerically largest coefficient of
is chosen from the remaining equations (leaving the first equation) and brought as the second
pivot by interchanging the second equation with the equation having the largest coefficient of .
This process is continued till we arrive at the equation with the single variable. This modified
procedure is called partial pivoting.
Example 3.3 Use Gaussian elimination with partial pivoting method to solve the linear system

40
Numerical Method for Engineering

Solution: Using Gaussian elimination with partial pivoting, since the first pivot element is zero,
interchanging the third equation with the first equation we have,
(i)
(ii)
(iii)
Then, to eliminate from (ii), we operate [(ii)-3/6(i)]. We thus, get the new system

(iv)

Next, interchanging (iii) with (iv) we have the system

Then also, to eliminate from the third equation in the above system, we subtract (4/8) times
the second equation from the third equation leaving the first equation. We then obtain a system
of an upper triangular form

So that the unknowns are obtained by back substitution as follows:

[ ( *]

* ( )+ .

Exercise 3.2 Use Gauss elimination with partial pivoting method to solve the system

41
Numerical Method for Engineering

3.1.3 Gauss-Jordan elimination method

This is a modification of the Gaussian elimination method. In this method, elimination of the
unknowns is performed not in the equations below but in the equations above also, ultimately
reducing the system to a diagonal matrix form, i.e., equation involving only one unknown. From
the resulting system of equations the unknowns can be obtained readily.

Principle of the method: The Gauss Jordan method works by transforming the linear system
into an equivalent system , where is an arbitrary non – singular matrix and
is an identity matrix of order , so that is the solution of the original linear system.

Description of the method: Consider the following matrix equations

( )( ) ( )

Step 1: Assume that , then replace by 1 in the augmented matrix and this is

possible by pre – multiplying by elementary matrix ( ). So after normalization the

first row of matrix becomes

⁄ , for all

Now, we make the non – diagonal elements of the first column of to become zero. That is
, for all .

Step 2: Assuming , then replace by 1 in the augmented matrix and this

is possible by pre – multiplying by elementary matrix ( ). So after normalization the

second row of matrix becomes

⁄ , for all

42
Numerical Method for Engineering

Now, we make the non – diagonal elements of the second column of to become zero. That is
, for all .

Step k: Assume , then multiply by the elementary matrix ( ) to

change to 1. The other coefficients of the row are given by:

⁄ , for all .

The non – diagonal elements of the column must be zero. That is


.

Remark 2: Similar to the Gaussian elimination method the steps listed above are done by
applying the three elementary operations.

Example 3.4 Using Gauss Jordan method, solve the matrix equation defined by:

( +( + ( +

Solution: The augmented matrix of the system of equation is given by:

( +

Step 1: Eliminate the coefficients of the first column below the diagonal element.

( + ( +

Step 2: Normalization is obtained on by pre – multiplying by . i.e.

( + ( )

43
Numerical Method for Engineering

Once again eliminate the non – diagonal elements of the second column. i.e.

( )

( )

Step 3: Normalization is obtained on by pre – multiplying by . i.e.

( ) ( )

Then, eliminate the non – diagonal elements of the third column. i.e.

( ) ( )

Here, is the augmented matrix of the system of equation given below.

( )

Therefore, the solution of the system is { ( ) }.

Example3.5 Use Gauss-Jordan elimination method to sole the system

44
Numerical Method for Engineering

Solution: Set

(i)
(ii)
(iii)
First, to eliminate from (ii) and (iii), we operate [(ii)-2(i)] and [(iii)-3(i)]. We get,
(i)
(iv)
(v)
Second, to eliminate from (i) and (v), we operate [(i)+1/5(iv)] and [(v)+1/5(iv)]. We get,

(vi)

(iv)
(vii)

Next, to eliminate from (iv) and (vi), we operate [(iv)-5/6(vii)] and [(vi)-7/12(vii)].
Finally, we obtain the diagonal system

Hence, the solutions are obtained directly as , , and .

Exercise3.3 Use Gauss-Jordan elimination methods to solve the system


a. b .

c.

45
Numerical Method for Engineering

3.1.4 Matrix inversion using Jordan’s method


In this section we consider some algebra associated with matrices and show how it can be used
to solve problems involving linear systems.
Definition: Two matrices A and B are equal if they have the same number of rows and columns,
say , and if , for each and .
Definition: Let A be an matrix and B an matrix. The matrix product of A and B,
denoted AB, is an matrix C whose entries are
∑ , for each and .

The computation of can be viewed as the multiplication of the entries of the row of A
with corresponding entries in the column of B, followed by a summation; that is,

* + , where .

This explains why the number of columns of A must equal the number of rows of B for the
product AB to be defined.
Definition: A square matrix has the same number of rows as columns. A diagonal matrix
D=[ ] is a square matrix with whenever . The identity matrix of order ,

, is a diagonal matrix with entries { .

Definition: An matrix A is nonsingular (or invertible) if an matrix exists with


. The matrix is called the inverse of A. A matrix without an inverse is
called singular (or noninvertible).
Reading assignment
 determinant of a matrix
Condition for the existence of inverse

46
Numerical Method for Engineering

If the determinant of a square matrix A is nonzero, i.e., if , then the matrix A is


nonsingular.
Consider a system of equations in unknowns

. . .. . .
. . . .

In matrix form, it is written as

Where,

[ ] [ ] * +

If the coefficient matrix A is invertible, then the solution of the above system is given by the
formula

The task to solve a certain system of linear equations using matrix-inversion method is then to
find the inverse of the coefficient matrix. There are several methods of finding the inverse of a
matrix. Some of the methods include:
 method of adjoint,
 Gauss elimination method, and
 Gauss-Jordan method.
In this section we will discuss Gauss-Jordan elimination method in finding the inverse of a
nonsingular coefficient matrix of a system of linear equations. In this method, the matrix is
converted in to an identity matrix.
In practice, we apply the elementary row operations for the augmented matrix formed by
combining the coefficient matrix A and the identity matrix . As soon as A is reduced to
identity, the other matrix represents the inverse of the coefficient matrix.

The augmented matrix of the coefficient matrix A and is of the form

47
Numerical Method for Engineering

[ ]

Let Abe any matrix. Consider the following operation on the rows of A :
(1) Interchange of any two rows of A, symbolically, .
(2) Add scalar multiple one row of Ato another row, i.e., , where .
(3) Multiply a row A with a nonzero scalar, i.e., .
These operations are called elementary row operations of A.
We illustrate this procedure in the following example.
Example3.6Use Matrix inversion using Jordan‟s method to solve the system

Solution: The corresponding coefficient matrix A is given by

[ ] and . So that, A is nonsingular and hence exists.

Now, the task is to find the inverse of A and we use the Jordan‟s method to do this.
Then the augmented matrix of A and is defined as

| ( | +

Using elementary row operations,

( | + [ ]

( | + [ ]

( | + [ ]

( | + [ ]

48
Numerical Method for Engineering

( | + [ ]

( | +.

Note: The symbol is used to say that the given augmented matrix and the successive
augmented matrices are equivalent.
Hence, the inverse of the given coefficient matrix A is

[ ]

Thus, the solution of the system is given by

[ ][ ] [ ]

[ ]
That is, , and .
Note:
 Matrix inversion using Jordan‟s method fails if the coefficient matrix A is a singular
matrix.
 Matrix inversion using Jordan‟s method is not suitable for a large system.
Example 3.7 Using Gauss Jordan method ; find the inverse of the matrix

( +

Solution: The augmented matrix of and is given by:

( +

Transform the elements below the diagonal element in the first column of to zero,
i.e.

49
Numerical Method for Engineering

( + ( +

Now, multiply by ( ) to change to 1. i.e.

( + ( )

Then, eliminate the non – diagonal elements of the second column, i.e.

( )

( )

Now, multiply by ( ) to change to 1. i.e.

( ) ( )
Then, eliminate the non – diagonal elements of the third column, i.e.

( ) ( )

Here, the last matrix is the end of the gauss Jordan method and in this is changed to
identity and this shows is invertible and its inverse is

( )

50
Numerical Method for Engineering

Exercise 3.4 Use Matrix inversion using Jordan‟s method to solve the system

3.1.5 Matrix decomposition method


This method is also known as LU-decomposition method.

This method is based on the fact a square matrix can be factorized into the form , where is
lower triangular matrix and is unit upper triangular matrix. Provided that the principal minors
of are non – singular. i.e.

| | | | , etc.

Now, let us consider the three equations

That is , where ( + ( + and ( +

Then, let , where ( + and ( +

Therefore, ( +( + ( +

Now, solve for the unknowns, then we get the following

51
Numerical Method for Engineering

( *

Now, , then let .

( +( + ( +

Then, solve for and by forward substitution formula. Then we have

( +( + ( +

Then, solve for and using the backward substitution formula.

52
Numerical Method for Engineering

Example 3.8 Using matrix decomposition method solve the following system of linear
equations.

Solution: The system is given as:

( +( ) ( +

Let

( +( + ( +

Then, solve the unknowns by equating the two matrices and we get

and
Then, we have

( +( + ( +

Then, by applying the forward substitution formula we get


and

Then, ( +( ) ( )

53
Numerical Method for Engineering

Then, by applying the backward substitution formula we get


and

Therefore, the solution of the system is { ( ) }.

Example 3.9 Use Matrix decomposition method to solve the system

Solution: the corresponding coefficient matrix is

[ ]

Let[ ][ ] [ ]i) Clearly, , , , and

, . So that, , and .
For and , we have the equations and . This implies
that, and . Finally, and are obtained from and
and hence, and . It follows that,

[ ][ ] (ii)

Then the system of equations can be written as

[ ][ ] [ ] (iii)

Where,

[ ][ ] [ ] (iv)

Hence solving the system in (iii) by forward substitution, we get


, , and .
Thus, solving the system in (iv) by backward substitution for the unknowns, we obtain

54
Numerical Method for Engineering

, , and .

Exercise 3.5 Solve the following system of linear equations using matrix decomposition method.
a. b.

3.1.6 Thomas Algorithm for Tridiagonal System

Consider the system of linear simultaneous algebraic equations given by


Where A is a tridiagonal matrix
Hence, we consider a tridiagonal system of equations given by

[ ][ ] [ ] (1)

equation (1) can be written as

(2)

The system of equations given by Eq. (2) is solved using Thomas Algorithm which is described
in threesteps as shown below:
Step 1: Set and compute

Step 2: Set = and compute

Step 2: Set and compute

Example 3.10 Solve the following equations by Thomas Algorithm.

55
Numerical Method for Engineering

Solution Here [ ] ⌈ ⌉=⌈ ⌉

⌈ ⌉
⌈ ⌉
⌈ ⌉

⌈ ⌉

Step 1: Set and compute

Step 2: Set = and compute






Step 2: Set and compute

56
Numerical Method for Engineering

Exercise 3.6
Solve the following set of tridiagonal set of algebraic equations using Thomas‟s method.

3.2In direct methods for system of linear equations

Objectives

At the end of this topic students should be able to:

 Identify Gauss Jacobi method and Gauss Seidel method of solving of system of linear
equation
 Solve system of linear equations using Gauss Jacobi and Gauss Seidel methods

Introduction: As a numerical technique, Gaussian elimination is rather unusual because it is


direct. Thatis, a solution is obtained after a single application of Gaussian elimination. Once a
“solution”has been obtained, Gaussian elimination offers no method of refinement. The lack
ofrefinements can be a problem because, as the previous section shows, Gaussian eliminationis
sensitive to rounding error.

Numerical techniques more commonly involve an iterative method. For example, in


Calculus we probably studied Newton‟s iterative method for approximating the zeros of a
differentiable function. In this section we will look at two iterative methods for approximatingthe
solution of a system of n linear equations in n variables.
3.2.1. Gauss Jacobi Method

The first iterative technique is called the Jacobi method, after Carl Gustav Jacob Jacobi

57
Numerical Method for Engineering

(1804–1851). This method makes two assumptions:

1. The system given by

has a unique solution


2. The coefficient matrix has no zeros on its main diagonal, namely are
nonzeros. That is, if any of the diagonal entries are zero, then rows or columns must be
interchanged to obtain a coefficient matrix that has nonzero entries on the main diagonal.

Main idea of Jacobi


To begin, solve the 1st equation for , the 2nd equation for and so on to obtain the rewritten
equations:

Then make an initial guess (assumption) of the solution .


Substitute these values into the right hand side the of the rewritten equations to obtain the first
approximation, .
This accomplishes one iteration.
In the same way, the second approximation is computed by substituting
the first approximation‟s values into the right hand side of the rewritten equations.

By repeated iterations, we form a sequence of approximations

( )

The Jacobi Method, for each generate the components of from of by

58
Numerical Method for Engineering

∑( )

[ ]

Example 3.11: Apply the Jacobi method to solve

Continue the iterations until two successive approximations are identical when rounded to three
significant digits.
Solution: To begin, write the system in the form

Because we do not know the actual solution, choose

Initial approximation

as a convenient initial approximation. So, the first approximation is

59
Numerical Method for Engineering

That is ( )

Continuing this procedure, we obtain the sequence of approximations shown in Table 3.2.

Table 3.2

Because the last two columns in Table 3.2 are identical, we can conclude that to threesignificant
digits the solution is
.

Note: For the system of linear equations given in Example 3.10, the Jacobi method is said
toconverge. That is, repeated iterations succeed in producing an approximation that is correctto
three significant digits. As is generally true for iterative methods, greater accuracy wouldrequire
more iteration.
3.2.2. The Gauss-Seidel Method

You will now look at a modification of the Jacobi method called the Gauss-Seidel method,
named after Carl Friedrich Gauss (1777–1855) and Philipp L. Seidel (1821–1896). This
modification is no more difficult to use than the Jacobi method, and it often requires fewer
iterations to produce the same degree of accuracy.
With the Jacobi method, the values of obtained in the nth approximation remain
Unchanged until the entire th approximation has been calculated. With the Gauss-
Seidel method, on the other hand, we use the new values of each as soon as they are known. That
is, once we have determined from the first equation, its value is then usedin the second
equation to obtain the new
Similarly, the new and are used inthe third equation to obtain the new and so on. This
procedure is demonstrated in
Example 3.12Use the Gauss-Seidel iteration method to approximate the solution to the system of
equations given in Example 3.10.

60
Numerical Method for Engineering

Solution: The first computation is identical to that given in Example 3.10. That is, using

as the initial approximation, we obtain the following new value for .

Now that we have a new value for however, use it to compute a new value for . That is,

Similarly, use and to copmute a new value for . That is,

So the first approximation is . Continued iterations


produce the sequence of approximations shown in Table 3.3.
Table 3.3

Note that after only five iterations of the Gauss-Seidel method, we achieved the same accuracy
as was obtained with seven iterations of the Jacobi method in Example 3.2.
Note: Neither of the iterative methods presented in this section always converges. That is, it is
possible to apply the Jacobi method or the Gauss-Seidel method to a system of linear equations
and obtain a divergent sequence of approximations. In such cases, it is said that the method
diverges.
Example 3.13: (An Example of Divergence) Apply the Jacobi method to the system

61
Numerical Method for Engineering

using the initial approximation , and show that the method diverges.

Solution: As usual, begin by rewriting the given system in the form

Then the initial approximation produces

As the first approximation. Repeated iterations produce the sequence of approximationsshown in


Table 3.4.
Table 3.4

For this particular system of linear equations we can determine that the actual solution is
and . So we can see from Table 3.4 that the approximations given by the Jacobi method
become progressively worse instead of better, and you can conclude that the method diverges.
The problem of divergence in Example 3.3 is not resolved by using the Gauss-Seidel method
rather than the Jacobi method. In fact, for this particular system the Gauss-Seidel method
diverges more rapidly, as shown in Table 3.4.
Table 3.4

62
Numerical Method for Engineering

With an initial approximation of neither the Jacobi method nor the Gauss-Seidel
method converges to the solution of the system of linear equations given in Example 3.3. We
will now look at a special type of coefficient matrix , called a strictlydiagonally dominant
matrix, for which it is guaranteed that both methods will converge.
Definition: (Strictly Diagonally Dominant Matrix)
An matrix A is strictly diagonally dominantif the absolute value of each entry on the main
diagonal is greater than the sum of the absolute values of the other entries in the same row. That
is,
| | | | | | | |
| | | | | | | |

| | | | | | | |
Example 3.14 which of the following systems of linear equations has a strictly diagonally
dominant coefficient matrix?

a)

b)

Solution

a) The coefficient matrix of the system is

* +

And is strictly diagonally dominant because| | | | | | | |.


b) The coefficient matrix of the system is

[ ]

is not strictly diagonally dominant because the entries in the second and third rows do not
conform to the definition. For instance, in the second row and it is not

63
Numerical Method for Engineering

true that | | | | | |. Interchanging the second and third rows in the original system of
linear equations, however, produces the coefficient matrix

[ ]

and this matrix is strictly diagonally dominant.


The following theorem, which is listed without proof, states that strict diagonal dominance is
sufficient for the convergence of either the Jacobi method or the Gauss-Seidel method.
Theorem 3.2(Convergence of the Jacobi and Gauss-Seidel methods)
If is strictly diagonally dominant, then the system of linear equations given by has a
unique solution to which the Jacobi method and the Gauss-Seidel method will converge for any
initial approximation.
In Example 3.13 we looked at a system of linear equations for which the Jacobi and Gauss-
Seidel methods diverged. In the following example you can see that by interchanging the rows of
the system given in Example 3.13, we can obtain a coefficient matrix that is strictly diagonally
dominant. After this interchange, convergence is assured.
Example 3.15: Interchange the rows of the system

to obtain one with a strictly diagonally dominant coefficient matrix. Then apply the Gauss-Seidel
method to approximate the solution to four significant digits.
Solution: Begin by interchanging the two rows of the given system we obtain

Note that the coefficient matrix of this system is strictly diagonally dominant. Then solve
for and as follows.

Using the initial approximation you can obtain the sequence of approximations
shown in Table 3.5.

64
Numerical Method for Engineering

Table 3.5

So we can conclude that the solution is .

Note: Theorem 3.2 does not imply that strict diagonal dominance is a necessary condition for
convergence of the Jacobi or Gauss-Seidel methods. For instance, the coefficient matrix of the
system

Here the coefficient of the system is not a strictly diagonally dominant matrix, and yet both
methods converge to the solution and when you use an initial approximation of
.
Exercise 3.7
1. Apply the Jacobi and Gauss-Seidel methods to the given system of linear equations, using
the initial approximation . Continue performing iterations
until two successive approximations are identical when rounded to three significant
digits.
a)

b)

c)

2. Show that the Gauss-Seidel method diverges for the given system using the initial
approximation .
a)

65
Numerical Method for Engineering

b)

3. Determine whether the following matrices are strictly diagonally dominant or not.

a) * +

b) [ ]

c) [ ]

4. Interchange the rows of the system of linear equations in Exercise 2 (a) to obtain a
system with a strictly diagonally dominant coefficient matrix. Then apply the Gauss-
Seidel method to approximate the solution to two significant digits.
5. Interchange the rows of the system of linear equations

to obtain a system with a strictly diagonally dominant coefficient matrix. Then apply the
Gauss-Seidel method to approximate the solution to two significant digits.
6. The coefficient matrices of the following system of linear equations are not strictly
diagonally dominant. Show that the Jacobi and Gauss-Seidel methods converge using an
initial approximation of .
a)

b)

3.3. Solving systems of Non-linear Equations using Newton’s Method

Objectives:

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

66
Numerical Method for Engineering

 Identify linear and non-linear system of equations


 Identify Newton‟s formula for non-linear system of equations
 Solve system of non-linear equation using Newton‟s method

Introduction:

Solving a system of nonlinear equations is a problem that is avoided when possible, customarily
by approximating the nonlinear system by a system of linear equations. When this is
unsatisfactory, the problem must be tackled directly
Definition: A system of nonlinear equations has the form

where each function can be thought of as mapping a vector


of the -dimensional space into the real line .

In general, we can usually find solutions to a system of equations when the number of unknowns
matches the number of equations. Thus, we wish to find solutions to systems that have the form:

. (1)

For convenience we can think of as a vector and as a vector valued


function . With this notation, we can write the system of equations (1) simply as: .

67
Numerical Method for Engineering

That is, we wish to find a vector that makes the vector function equal to the zero vectors.
As in Newton‟s method for one variable, we need to start with an initial guess . In theory, the
more variables one has, the harder it is to find a good initial guess. In practice, this must be
overcome by using physically reasonable assumptions about the possible values of a solution, i.e.
take advantage of engineering knowledge of the problem. Once is chosen, let
.
Linear Approximation for Vector Functions
In the single variable case, Newton‟s method was derived by considering the linear
approximation of the function at the initial guess . From Calculus, the following is the linear
approximation of at , for vectors and vector-valued functions:
.

Here is an matrix whose entries are the various partial derivative of the
components of . Specifically:

(2)

[ ]

The matrix is called the Jacobian matrix and id denoted by and has a number of
applications in analysis. That is

[ ]

Newton’s method

We wish to find that makes equal to the zero vectors, so let‟s choose so that

68
Numerical Method for Engineering

Since is a square matrix, we can solve this equation by

provided that the inverse exists. The formula is the vector equivalent of the Newton‟s method
formula we learned before. However, in practice we never use the inverse of a matrix for
computations, so we cannot use this formula directly. Rather, we can do the following. First
solve the equation
(3)

Since is a known matrix and is a known vector, this equation is just a system of
linear equations, which can be solved efficiently and accurately. Once we have the solution
vector ,we can obtain our improved estimate by:

For subsequent steps, we have the following process:


 Solve for
 Let
Example3.16 Solve the following non-linear system equations using Newton‟s method by leting
for about four approximations.

Solution: let

[ ]

From this we have

[ ]

and

Where * + because , which implies

* + and * + * +

69
Numerical Method for Engineering

Hence

[ ]

[ ] * +

Again consider * + as initial value and hence calculate the next Approximation.

Here * + * + * +

and * + * +

* +

Thus

* +

Again consider * + as initial value and hence calculate the next approximation.

Then * + * + * +

And * + * + and

* +

Hence

* +

Again consider * + as initial value and hence calculate the next approximation.

Then * + * + * +

And * + * + and

70
Numerical Method for Engineering

* +

Hence

* +

Note: We precede this process until we get the idea ‖ ‖ or ‖ ‖ . Where is


called pre specified error (or tolerance) and is usually given.
Exercise 3.8
1. Solve the system of non-linear equations

( )

Using Newton‟s method up to two iterations when the initial approximation is


.
2. Solve the system of non-linear equations

Using Newton‟s method for about three iterations with an initial approximation
.
3. Solve the system of linear equations

with an initial approximation , , and .

71
Numerical Method for Engineering

Unit Summary
 The solution of n linear simultaneous algebraic equations in n unknowns is presented.
 There are two classesof methods of solving system of linear algebraic equations: direct
and iterative methods.
 Direct methodstransform the original equation into equivalent equations that can be
solved more easily.
 Iterative or indirectmethods start with a guess of the solution x, and then repeatedly refine
the solution until a certain convergencecriterion is reached.
 Direct methods (matrix inversion method, Gauss elimination method, Gauss-
Jordanmethod, Matrix decomposition method and Thomas algorithm for tridiagonal
system)are presented.
 Two indirect or iterative methods (Jacobi‟s iteration method and Gauss-Seidal iteration
method)re presented.
 The LU decomposition method is closely related to Gauss elimination method. LU
decomposition iscomputationally very effective if the coefficient matrix remains the same
but the right hand side vector changes.
 Gauss-Jordan method is a very stable method for solving linear algebraic equations.
Gauss-Seidal iterativesubstitution technique is very suitable for predominantly diagonal
systems. It requires a guess of the solution.

Review Exercise
1. Using Gaussian elimination method solve the following system of linear equations

72
Numerical Method for Engineering

2. Solve the system of equations by Gauss Jordan method


b. c.

3. Using Gauss-Jacobi method find the first three approximate solutions of the following
systems with and respectively.
a. b.

4. Solve the following system of linear equations using matrix decomposition method.
b. b.

d.

5. Solve the following set of simultaneous linear equations by the matrix inverse method.
a. – – b.
– –

6. Solve the following tridiagonal system of equations using the Thomas algorithm.
a. b.

7. Using Gauss-seidel method find the first three approximate solutions of the following
systems with and respectively.

73
Numerical Method for Engineering

a. b.

8. Solve the system of non-linear equations

( )

Using Newton‟s method up to two iterations when the initial approximation is


.
9. Solve the system of non-linear equations

Using Newton‟s method for about three iterations with an initial approximation
.
10. Solve the system of linear equations

with an initial approximation , , and

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

John F. Mathews Numerical methods using MATLAB, third edition

74
Numerical Method for Engineering

Chapter Four

Finite Differences

Objectives:

At the end of this chapter the students will be able to:

 Understand the concepts of all finite differences


 Appreciate the concept of shift operators
 Identify forward, back ward and central difference operators
 Solve different related problems

Overview of the chapter:

This chapter concentrates on shift operators, forward difference operators, backward difference
operators and central difference operators.

Introduction:

Consider a function defined on (a, b), and are the independent and dependent
variables [Link] the points are taken at equidistance that is, ,
for , then the value of y, when , is denoted by , where
Here, the values of x are called arguments and the values of y are called as entries. The interval h
is called the difference interval. The differences – – – are called the first
differences of the function and are denoted by etc. That is


– (4.1)

The symbol in these equations is called the difference operator.

75
Numerical Method for Engineering

4.1. Shift Operators

Objectives

At the end of this topic students should be able to:

 Define shift operator


 Identify orders of shift operatos
 Relate shift operators

Actvity4.1: Let . Find and .

Shift operator, E:
Difinition4.1. The shift operator of a function denoted by is defined as
or

Hence, shift operator sifts the function value to the next higher value . The second shift
operator is given as follow.

E is linear and obeys the law of indices. And hence the generalized shift operator is given by

The inverse shift operator denoted by is defined as



In a similar manner, second and higher inverse operators are given by
– and –
The more general form ofshiftoperator is given by

where is a nonzero rational number (that is, is positive as well as negative rationals).

Example4.1.: Let . Find the first three shift operators.

Solution: the first three shift operators are . Thus

76
Numerical Method for Engineering

And

Average operator, :

The average operator is defined as

That is

4.2. Forward difference operators

Objectives:

At the end of his topic students will be able to:

 Define forward difference operator


 Identify relationship between shift operators and forward difference operators

Definition4.2.: The forward difference or simply difference operator is denoted by and is


defined as –

or writing in terms of , at , this above equation becomes


– or

The differences of the first differences are called the second differences and they are denoted by
.

77
Numerical Method for Engineering

Hence

– – – – –
– – – – –
– – – – – –
– – etc.
In general, we have

Also,

– –

and

Where is call an identity operator. That is .

The tabular representation for forward difference is put as follow.

78
Numerical Method for Engineering

Table 4.1. Forward difference table

x y

The forward differences for the arguments are shown in Table 4.1. Table 4.1 is
called a diagonal difference table or forward difference table. The first term in Table 4.1 is
and is called the leading [Link] differences , are called the leading
differences. Similarly, the differences with fixedsubscript are called forward differences.
Example4.2.

1. Construct a forward difference table for the following data

Solution: The forward difference table for the given data is shown below.

79
Numerical Method for Engineering

Table4.2. Forward difference table for the above data

2. Draw the forward difference table for .


Solution: The forward difference table is given below.
Table4.3. Forward difference table for (2)

80
Numerical Method for Engineering

Exercise4.1: Construct the forward difference table for the following.


1.
x 0 1 2 3 4 5 6

y 1 2 33 254 1054 3126 7777

2.
4.3. Backward difference operators
Objectives:
At the end of this topic students should be able to:
 Define backward difference operator
 Differentiate backward difference from forward difference
 Identify the tabular representation of backward difference
Activity4.2: Let . Find

81
Numerical Method for Engineering

Definition4.3:The backward difference operator denoted by is defined as


– – .
This equation can be written as
– – .
or – – – (4.2)
The differences in equation (4.2) are called first differences. The second differences are
denotedby

Hence
– – – – – – .
Similarly,
– – , and so on.

In general, we have

Where
The backward differences written in a tabular form is shown in Table 4.4 below. In Table 4.4,
the differences with a fixed subscript „ ‟ lie along the diagonal upward sloping.

82
Numerical Method for Engineering

Table 4.4: Backward difference table

Table 4.4 is called the backward difference or horizontal table.


Example 4.3:
1. Construct the backward difference table of the following and find .

Solution: The backward difference of this problem is given as follow.

83
Numerical Method for Engineering

Table 4.5: backward difference table

Here .
2. Obtain the backward differences for the function from to to two
decimals chopped and find .
Solution:
The backward difference table is computed as below.

84
Numerical Method for Engineering

Table 4.6: backward difference table

Here,
3. Find the missing term in the table below.

Solution: Let the missing term be , then using backward difference table, we have;

85
Numerical Method for Engineering

Table 4.7: backward difference

From the table we see that and hence the missing term.
Exercise4.3:
1. Construct a backward difference table for the following data.

2. If is a positive integer and the interval of differencing is , show that


.
3. Find the missing term in the table below.

86
Numerical Method for Engineering

4.4 Central difference operators


Objectives
At the end of this topic students should be able to;
 Define central difference operator
 Differentiate central difference operator from forward and backward difference
operators
Activity 4.4
Let . Compute for .
Definition 4.4: The central difference operator is denoted by the symbol and is defined by
– –
where h is the interval of differencing.
In terms of , the first central difference is written as

where – .
Hence
.
The second central differences are given by

In general
.
The central difference table for the seven arguments is given in table 4.7.

87
Numerical Method for Engineering

Table 4.8 central difference table

It is noted in table 4.7 that all the odd differences have fraction suffices and all the even
differences are integral suffices.
Exercise 4.4:
1. Construct the central difference table for

88
Numerical Method for Engineering

2. Let . Formulate the central difference table for .


4.5. Properties of the operators
Objectives
At the end of this topic the students will be able to;
 Identify relationships of the operators
 Prove properties of the operators
 Solve different related problems
Activity 4.5:
1. Let , find .
2. Let . Compute .
Properties of .
1. If is a constant then .
2.
3. , for a constant .
4. If and are positive integers, then
5.

6. * +

Proof (1):
Let
Hence , is the interval of differencing.
Then or

Proof (2):

Similarly

89
Numerical Method for Engineering

and hence

Proof (3):

Proof (4) (⏞ + (⏞ +

(⏞ +

Similarly we can prove (5) and (6).


Relations between the operators
1. For the operators and , we have the following.
and
Proof: and
This implies that

And
2.

90
Numerical Method for Engineering

Hence

Example 4.5: Show that .

Solution: Let be the interval of differencing

Taking logarithms on both sides we get

* + * +

* +

* +

Example 4.5: Evaluate

Solution: Let be the interval of differencing

( )

(Since )

Note: If , then ( )

Example 4.6:Prove that , the interval of differencing being .

Solution: We know that


, then

91
Numerical Method for Engineering

Again

Hence ( )

Therefore, the right hand side ( )

Relation between and :

Example 4.7:Provethat (a) (b)


Solution:
a)

Thus .
b)

And

Therefore .
3.
Proof:
We know that

( )
Which implies that .
4.

92
Numerical Method for Engineering

Proof:

Thus --------------------------------------------------------- (1)


Again

Hence we have ---------------------------------------------------------- (2)


Also

Which implies -------------------------------------------------------------- (3)


From (1), (2) and (3), we have that

5.
Proof:
Since

--------------------------------------------------------------- (1)
Also

------------------------------------------------- (2)
Therefore from (1) and (2), we have;

93
Numerical Method for Engineering

Example 4.8: Find .


Solution:
Let
Here, is a polynomial function of degree three and the coefficient of is .
Therefore .
Exercise 4.5:
1. Show that
a)
b)
c)
2. Find the following
a) c)

b) d)

3. Let . Find .

94
Numerical Method for Engineering

Unit summery
The following are the main points of this chapter.
If the points are taken at equidistance that is,
, for , then the value of y, when , is
denoted by , and is given by
The shift operator of a function is an operator defined as
or

An operator defined by

is called an average operator.


The forward difference or simply difference operator is defined by
– or – .
The backward difference operator is defined as
– – or – – for

An operator which is defined by


– –
is called central difference operator; where h is the interval of differencing.
Review exercise
1. Construct table of forward, backward and central differences of the following.
a)

b) for
c) for
d) for
2. Find the missing term of the following.

95
Numerical Method for Engineering

a)

b)

3. Evaluate the following.


a)
b)

c)

d) (with interval of differencing )

e)

4. Prove the following.


a)
b)

c)

5. Given and . Find .

96
Numerical Method for Engineering

CHAPTER FIVE

INTERPOLATIONS

UNIT OBJECTIVES

At the end of this unit each student should able to:

 Understand the concept of interpolation.


 Understand the concept of Lagrange interpolation formula
 Understand the concept of Newton's forward interpolation formula
 Understand the concept of Newton's back ward interpolation formula
 Understand the concept of Numerical differentiation
 Understand the concept of Numerical integration

INTRODUCTION

Interpolationis the technique of estimating the value of a function for any intermediate value of
the independent variable. The process of computing or finding the value of a function for any
value of the independent variable outside the given range is called extrapolation. Here,
interpolation denotes the method of computing the value of the function for any given
value of the independent variable when a set of values of for certain values of are
known or given.
Hence, are the set of given data points of the function
then the process of finding the value of y corresponding to any value of
Between , is called interpolation.
If the function is known explicitly, then the value of corresponding to any value of can
easily be obtained. On the other hand, if the function is not known, then it is very hard to
find the exact form of with the tabulated values . In such cases, the function
can be replaced by a simpler, function, say which has the same values as for
. The function is called the interpolating or smoothing function and any other
value can be computed from

97
Numerical Method for Engineering

If is a polynomial, then is called the interpolating polynomial and the process of


computing the intermediate values of is called the polynomial interpolation.
Let be a real valued continuous function defined in an interval . Let
be distinct points and the corresponding values of the function are . Our aim
is to construct the unique approximate polynomial which passes through the given points. Since
points are given, we can represent the function is a Polynomial in of degree
with such that . But to construct this polynomial we
follow two different approaches which are interpolation with equal intervals and interpolation
with unequal intervals.

5.1 Linear Interpolation


Here and we want determine a polynomial where are
arbitrary constant which satisfies the interpolating conditions .
we have

Example5.1 find the polynomial which passes through and


approximate .
Solution: since we have

then

Hence, and

5.2 Lagrange Interpolation Formula

Objective

At the end of this lesson students will be able to:

 DefineLagrange Interpolation Formula.

98
Numerical Method for Engineering

 Solve problem using Lagrange Interpolation Formula

Let be a real valued continuous function defined in an interval . Let


be distinct points which are not necessarily equally spaced and the
corresponding values of the function are . Since values of the function
are given corresponding to the values of the independent variable , we can represent
the function as a polynomial in of degree .
Let the polynomial is represented by

To find the values of substitute respectively in the above


formula. That is
Let , the we obtain

Or

If we take , then we obtain

Or

Similarly putting we obtain

Substituting the values of in the above equation we get

or ∑

Where, ∏ .

This formula is called Lagrange interpolation formula


Example 5.2: Using the Lagrange interpolation formula find the polynomial which passes
through – . and approximate .

99
Numerical Method for Engineering

Solution: The polynomial is given by:

,
, where

Therefore,

( ) ( )

( )

Hence, the polynomial is and

Example 5.3: Let is the interpolating polynomial for the data and
. Then find if the coefficient of in is .

100
Numerical Method for Engineering

Solution: The polynomial is given by:

, where

Therefore,

( ) ( )

( * ( *

Now, the coefficient of in the polynomial is ( ).

( *

Therefore, the value of the unknown is .

Exercise: 5.1
1. Using the Lagrange interpolation formula find the polynomial with

and and .

2. Apply Lagrange‟s interpolation formula to find a polynomial which passes through the
points – – – –

101
Numerical Method for Engineering

3. Using Lagrange‟s interpolation formula, find the value of corresponding to


from the following data.

5.3 Newton’s Interpolation Formula


Objective

At the end of this lesson students will be able to:

 DefineNewton's forward and backward Interpolation Formula.


 Solve problem using Newton’s forward and backward Interpolation Formula.

Here, we assume that for function , the set of functional values are
given corresponding to the set of equally spaced values of the independent variable,
, where is the spacing.
5 .3.1Newton’s Forward Interpolation Formula
Let which takes the values that is the set of (n + 1) functional
values are given corresponding to the set of (n + 1) equally spaced values of the
independent variable, where is the spacing. Let be a
polynomial of the degree in taking the same values as corresponding to
Then, (x) represents the continuous function ) such that
for i = 0, 1, 2, …., n and at all other points f (x) =p(x) + R(x) where R(x) is called
the error term (remainder term) of the interpolation formula.
Let
(5.1)
and (5.2
The constants, , , ancan be determined as follows:
Substituting successively in Eq.(5.1), we get

(5.3)

102
Numerical Method for Engineering

(5.4)

(5.5)

Similarly, we obtain (5.6)

Hence, from Eq. (5.1), we have

(5.7)

Let x = x0 + uh or x - x0 = uh

x – x1 = (x – x0) – (x1 – x0) = uh – h = (u – 1)h (5.8)


x – x2 = (x – x1) – (x2 – x1) = (u – 1)h – h = (u – 2)h, etc

Using the values from Eq.(5.8), Eq.(5.7) reduces to

(5.9)

The formula given in Eq. (5.9) is called the Newton’s forward interpolation formula. This
formula is used to interpolate the values of y near the beginning of a set of equally spaced tabular
values.

103
Numerical Method for Engineering

Example 5.4 Given that √ = √ = , √ =


and√ = d the value of√ .

Solution:The difference table is given below:

=√

Here

Newton‟s forward difference formula is

Example 5.5

104
Numerical Method for Engineering

A second degree polynomial passes through the points – – –


Find the polynomial.
Solution: The difference table is constructed with the given values of as shown below:

Here – –

From the Newton‟s forward interpolation formula, we have

60

105
Numerical Method for Engineering

Example 5.6 The values


of are given below
for different values of . Find the value of sin 42º.

Solution: x = 42º is near the starting value x0 = 40º

Hence, we use Newton‟s forward interpolation formula

We have ,

Putting these values in Newton‟s forward interpolation formula we get

106
Numerical Method for Engineering

( )

Example 5.7
The profits of a company (in thousands of rupees) are given below:

Calculate the total profits between –


Solution: The forward difference table is constructed as shown further:

107
Numerical Method for Engineering

To calculate profits at

Let

Using Newton‟s forward interpolation formula we obtain

Or thousand rupees.

Exercise 5.2
1. Find for using the following table.

2. Use forward interpolation formula to find y for given that

5.3.2 Newton’s Backward Interpolation Formula

108
Numerical Method for Engineering

Newton‟s forward interpolation formula is not suitable for interpolation values of y near the end
of a table of values.
Let x) be a function which takes the values corresponding to the values
of the independent variable . Let the values of be equally spaced with as the
interval of differencing. That is
Let be a polynomial of the nthdegree in taking the same values of y corresponding to
That is, ) represents such that f (xi) (xi
Hence we can write (x) as


,

Let

(5.10)

Substituting successively, we obtain

(5.11)

(5.12)

Similarly, we obtain (5.13)

Substituting the values from Esq. (5.11), (5.12) and (5.13) in Eq. (5.10), we get

(5.14)

Now, setting xn we obtain x– n

– n–1

109
Numerical Method for Engineering

– –

Hence, Eq. (5. 14) reduces to

(5.15)

Where

The formula given in Eq. (5.15) is called the Newton’s backward interpolation formula. This
formula is used for interpolating values of near the end of the tabulated values and also used for
extrapolating values of y a little backward of n.

Example 5.8
Calculate the value of f (84) for the data given in the table below:

Solution:
The value of 84 is near the end of Table. Hence, we use the Newton‟s backward interpolation
[Link] difference table is shown below:

110
Numerical Method for Engineering

We have and

From Newton‟s backward formula

Example 5.9
From the following table estimate the number of students who obtained marks in computer
programming between .

Solution: The cumulative frequency table is shown in Table.

111
Numerical Method for Engineering

Marks lessthan No. of students (y

To find the number of students with

Let

Then using Newton‟s backward interpolation formula we obtain

So number of students getting marks in computer programming between


Exercise 5.3

1. The population of a town in the decennial census is given below. Estimate the
population for the year 1925.

Year :

Population:

112
Numerical Method for Engineering

2. If is known at the following data points.

Find using Newton‟s backward difference formula.


5.4 Application interpolation

5.4 .1 Numerical Differentiation

Objective

At the end of this lesson students will be able to:

 Understand the concepts of Derivatives based onNewton's forward a


 Understand the concepts of Derivatives based onbackward Interpolation Formula.
 Understand the concepts of Derivatives based onStirling’s Interpolation Formula
 Solve problem using of Derivatives based on Newton's forward, backward and
Stirling’s Interpolation Formula.

[Link] Derivatives Based on Newton’s Forward Interpolation formula

Numerical differentiation deals with the following problem: given the function
finds one of its derivatives at the point Here, the term given implies that
w e either have an algorithm for computing the function, or possesses a set of discrete data points
In other words, we have a finite number of data points or pairs
from which we can compute the derivative. Numerical differentiation is a method to compute the
derivatives of a function at some values of independent variable when the function is
explicitly unknown; however it is known only for a set of arguments.

113
Numerical Method for Engineering

Suppose the function is known at (n + 1) equispaced points and they


are respectively i.e., f ( ), .

Let and where is the spacing

Since the Newton‟s forward interpolation formula is given by

Differentiating Eq. (5.16) w .r. t. x, we get

Note here that since

Differentiating Eq. (5.17) w .r. t. x, we get

and so on.

Equations (5.17) and (5.18) give the approximate derivatives of f(x) at arbitrary point
x = x0 + uh.
When x = x0, u = 0, Esq. (5.17) and (5.18) become

114
Numerical Method for Engineering

And so on.

Example 5.10: From the following table find the value of at the point x = 1.0

x 1 1.1 1.2 1.3 1.4 1.5

y 5.4680 5.6665 5.9264 6.2551 6.6601 7.1488

Solution:
The forward difference table is

1.0 5.4680

0.1985

1.1 5.6665 0.0614

0.2599 0.0074

1.2 5.9264 0.0688 0.0001

0.3287 0.0075 -0.0002

1.3 6.2551 0.0763 -0.0001

0.4050 0.0074

1.4 6.6601 0.0837

0.4887

1.5 7.1488

115
Numerical Method for Engineering

Here x0 = 1.0 and h = 0.1. Then u = 0 and hence

[ ]

Example 5.11:
Obtain the first and second derivatives of the function tabulated below at the points x = 1.1 and
x = 1.2
x 1 1.2 1.4 1.6 1.8 2.0
y 0 0.128 0.544 1.298 2.440 4.020

Solution: We first construct the forward difference table as shown below

1.0 0

0.128

1.2 0.128 0.288

0.416 0.05

1.4 0.544 0.338 0

0.754 0.05 0

1.6 1.298 0.388 0

116
Numerical Method for Engineering

1.142 0.05

1.8 2.440 0.438

1.580

2.0 4.020

Since x = 1.1 is a non-tabulated point near the beginning of the table, we take
and compute

Hence,

Now, is a tabulated point near the beginning of the table.


For x = x0 = 1.2, p = 0 and

[ ]

I Example 5 .12: Let


and , then find , and .

Solution: First we find the forward differences using forward difference table as follows

117
Numerical Method for Engineering

Then, ( )

( )

( )

( *

( *

( + ( *

Exercise 5.4

1. From the following table of values, estimate :

118
Numerical Method for Engineering

2. From the following table of values, estimate at the points and

5.4.1. 2 Derivatives Based on Newton’s Backward Interpolation formula


IVES BA Here, we assume the function y = f (x) is known at (n + 1) points
i.e., are known. Let
and

Then, the Newton‟s backward interpolation formula from Chapter 4 is given by

When the Eq. (5.21) is differentiated w.r.t. x successively, we obtain

] INTERPOLATI FOULA

Equations (5.22) and (5.23) can be used to determine the approximate differentiation of first,
second, etc. order at any point x, where
If then v = 0. Equations (5.22) and (5.23) become

and so on.
Example 5.13

119
Numerical Method for Engineering

A slider in a machine moves along a fixed straight rod. Its distance x (m) along the rod are given
in the following table for various values of the time t(seconds).
1 2 3 4 5 6

0.0201 0.0844 0.3444 1.0100 2.3660 4.7719

Find the velocity and acceleration of the slider at time t = 6 s


Solution: The backward difference table is

1 0.0201

2 0.0844 0.0643

3 0.3444 0.2600 0.1957

4 1.0100 0.6656 0.4056 0.2100

5 2.3660 1.3560 0.6904 0.2847 0.0748

6 4.7719 2.4059 1.0499 0.3595 0.0748 0.0000

Here

[ ]

120
Numerical Method for Engineering

Exercise 5.5
1. Find the values of ) and ) from the following table

2. Compute the values of and from the following table:

[Link] Derivatives Based on Stirling’s Interpolation formula


Suppose ( are given for equispaced points

The Stirling‟s interpolation polynomial is given by

[ ] * +

* +

Where

When Eq. (5.26) is differentiated with respect to x successively, we obtain

121
Numerical Method for Engineering

* ( )

( ) +

and

* ( ) ( )

At x = x0, u = 0 and Esq. (5.27) and (5.28) become

* ( ) ( ) +

[ ]

Example 5.14: Find for for the given in the following table.

0 0.1 0.2 0.3 0.4 0.5

0 0.10017 0.20134 0.30452 0.41076 0.52115

Solution: Construct the following difference table.

0 0

0.10017

0.1 0.10017 0.001

0.10117 0.00101

122
Numerical Method for Engineering

0.2 0.20134 0.00201 0.00004

0.10318 0.00105 0

0.3 0.30452 0.00306 0.00004

0.10624 0.00109

0.4 0.41076 0.00415

0.11039

0.5 0.52115

* ( )+

[ ( *]

[ ] [ ]

Example 5.15
Compute the values of f '(3.1) and f '(3.2) using the following table.

1 2 3 4 5
0 1.4 3.3 5.6 8.1

Solution: The central difference table is

1.4

123
Numerical Method for Engineering

1.4 0.5

1.9 -0.1

3.3 0.4 -0.1

2.3 -0.2

5.6 0.2

2.5

8.1

Let

* ( ) +

* ( * +

* ( ) +

* ( * +

Exercise 5.7
1. Compute the values of y'(3) and y''(3) from the following table:

2. Compute the values of y'(2) and y''(2) from the following table

124
Numerical Method for Engineering

5.4.2 Numerical Integration

Objective

At the end of this lesson students will be able to:

 Understand the concepts of Numerical integration


 Identifying the techniques of Numerical integration
 Solve problems using Trapezoidal rule, Simpson’s 1/3 rule and Simpson’s 3/8 rule.

If F(x) is a differentiable function whose derivative is f (x), then we can evaluate the definite
integral I as


(5.31)
Equation (5.31) is known as the fundamental theorem of calculus. Most integrals can be
evaluated by the formula given by Eq. (5.31) and there exists many techniques for making such
evaluations. However, in many applications in science and engineering, most integrals cannot be
evaluated because most integrals do not have anti-derivatives F(x) expressible in terms of
elementary functions.
In other circumferences, the integrands could be empirical functions given by certain measured
values. In all these instances, we need to resort to numerical methods of integration. It should be
noted here that, sometimes, it is difficult to evaluate the integral by analytical methods.
Numerical integration (or numericalquadrature, as it is sometimes called) is an alternative
approach to solve such problems. As in other numerical techniques, it often results in
approximate solution. The integration can be performed on a continuous function or a set of data.
The integration given by Eq. (5.31) is called closed since the function values at the two points
(a, b) where the limits of integration are located are used to find the integral.

125
Numerical Method for Engineering

In open integration, information on the function at one or both limits of integration is not
required.
The range of integration (b – a) is divided into a finite number of intervals in numerical
integration. The integration techniques consisting of equal intervals are based on formulas
known as Newton-Cotes closedquadrature formulas.
In this chapter, we present the following methods of integration with illustrative examples:
1. Trapezoidal rule.
2. Simpson‟s 1/3 rule.
3. Simpson‟s 3/8 rule.

Newton-cotes closed Quadrature formula

The general form of the problem of numerical integration may be stated as follows:
Given a set of data points ( n of a function y = f (x), where f (x) is not

explicitly known. Here, we are required to evaluate the definite integral ∫ (5.32)

In what follows, we derive a general formula for numerical integration by using Newton‟s
forward difference formula. Here, we assume the interval (a, b) is divided into n-equal

subintervals such that

(5.33)
With
Where = the internal size
the number of subintervals
and the limits of integration with
Hence, the integral in Eq. (5.31) can be written as
∫ (5.34)

Using Newton‟s forward interpolation formula, we have

∫ [ ] (5.35)

126
Numerical Method for Engineering

Where x = x0 + ph

∫ [ ] (5.36)

Hence, after simplification, we

∫ *

The formula given by Eq.(5.37) is known as Newton-Cotes closed quadrature formula.


From the general formula (Eq. (5.37)), we can derive or deduce different integration formulae by
substituting n = 1, 2, 3, etc

A) Trapezoidal Rule
In this method, the known function values are joined by straight lines. The area enclosed by these
lines between the given end points is computed to approximate the integral as shown in Fig. 1.

Fig.1.

Each subinterval with the line approximation for the function forms a trapezoid as shown in
Fig 1. The area of each trapezoid is computed by multiplying the interval size h by the average
value of the function value in that subinterval. After the individual trapezoidal areas are obtained,
they are all added to obtain the overall approximation to the integral.
Substituting n = 1 in Eq. (5.37) and considering the curve y = f(x) through the points (x0, y0) and

127
Numerical Method for Engineering

(x1, y1) as a straight line (a polynomial of first degree so that the differences of order higher than
first become zero), we get

∫ * + * + (5.38)

Similarly, we have ∫ ∫

and so on. (See Fig.2.)

In general, we have ∫

Fig.2

Adding all the integrals (Eq. (5.38), Eq. (5.39)) and using the interval additive property of the
definite integrals, we obtain
∑ ∫ (5.40)

Where = sum of the end points


= sum of the intermediate ordinates.
Equation (5.40) is known as the trapezoidal rule.

Summarizing, the trapezoidal rule signifies that the curve y = f (x) is replaced by n-straight lines
joining the points ( ), The area bounded by the curve y = f (x), the
ordinates and the x-axis is then approximately equivalent to the sum of the
areas of the n-trapezoids so obtained.

Example 5.16: Evaluate the integral ∫ taking six intervals by using trapezoidal rule up
to three significant figures

128
Numerical Method for Engineering

Solution:

0 0.2 0.4 0.6 0.8 1.0 1.2


0 1.221 1.492 1.822 2.226 2.718 3.320

The trapezoidal rule can be written as

The exact value is ∫

Example 5.17:Evaluate ∫ by using trapezoidal rule, taking n = 6, correct to give

significant figures

Solution:

0 2 4 6 8 10 12
1

1.0000 0.20000 0.05882 0.02703 0.01538 0.0990 0.00690

129
Numerical Method for Engineering

The exact value is ∫ |

Example 5 .18: Evaluate∫ by using trapezoidal rule, taking n = 8, correct to five


decimal places.

Solution:

2 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0


0.30103 0.39794 0.47712 0.54407 0.60206 0.65321 0.69897 0.74036 0.778155

The trapezoidal rule is

The exact value is give by ∫ |

Exercise 5.8

1. Using trapezoidal rule evaluate ∫ with step size and with the tabulated
values of given below.

2. Evaluate the integration of ∫ using trapezoidal rule with

B) Simpson’s Rule

130
Numerical Method for Engineering

In Simpson‟s rule, the function is approximated by a second degree polynomial between


successive points.
Since a second degree polynomial contains three constants, it is necessary toknow three
consecutive function values forming two intervals as shown in Fig. 3.

Fig .3.

Consider three equally spaced points Since the data are equally spaced,

Let – (see Fig.4).

Fig. 4.

Substituting n = 2 in Eq. (5.37) and taking the curve through the points and )
as a polynomial of second degree (parabola) so that the differences of order higher than two vanish,

we obtain ∫ * + ( 5.41)

Similarly ∫

∫ (5.42)

and so on.

In general, we can write ∫ (5.43)

131
Numerical Method for Engineering

Summing up all the above integrals, we obtain

(5.44)

Where = sum of end ordinates


= sum of odd ordinates
= sum of even ordinates
Equation (5.44) is known as Simpson’s 1/3 rule. Simpson‟s 1/3 rule requires the whole range (the
given interval) must be divided into even number of equal subintervals.

Example 5.19: Evaluate the integral∫ , taking n = 6 using Simpson‟s 1/3 rule.

Solution:

0 0.2 0.4 0.6 0.8 1.0 1.2


1.0 1.22140 1.49182 1.82212 2.22554 2.71828 3.32012

The Simpson‟s rule is

The exact value is∫

Example 5.20: Evaluate∫ n = 6.

132
Numerical Method for Engineering

Solution:

0 2 4 6 8 10 12
1.0 0.2 0.05882 0.02703 0.01538 0.0099 0.0069

The Simpson‟s rule is

Example 5.21: Evaluate∫ ,by using Simpson‟s 1/3 rule, taking n = 6.

Solution:

2 ⁄ ⁄ 4 ⁄ ⁄
0.30103 0.42597 0.52288 0.60206 0.66901 0.72700 0.77815

The Simpson‟s rule is

Exercise 5.9
1. Using Simpson‟s 1/3 evaluate∫ with step size and with the tabulated
values of given below.

133
Numerical Method for Engineering

2. Evaluate the integration of ∫ using Simpson‟s 1/3with

C) Simpson’s 3/8 Rule

Putting in Eq. (5.37) and taking the curve through ( ), as a polynomial


of degree three such that the differences higher than the third order vanish, we obtain

∫ * + (5.45)

Similarly, we get ∫

∫ (5.46)

and so on.
Finally, we have ∫ (5.47)

Summing up all the expressions above, we obtain

(5.48)

Equation (5.48) is called the Simpson’s 3/8 rule. Here, the number of subintervals should be
taken as multiples of 3. Simpson‟s 3/8 rule is not as accurate as Simpson‟s 1/3 rule.

Example 5 .22 Evaluate the integral∫ , by using Simpson‟s 3/8 rule and taking seven
ordinates.
Solution:n + 1 = 7  n=6
The points of division are

0 ⁄ ⁄ ⁄ ⁄ ⁄

134
Numerical Method for Engineering

1 1.18136 1.39561 1.64872 1.94773 2.30098 2.71828

The Simpson‟s three-eighth‟s rule is

Example 5.23 Evaluate∫ , by using Simpson‟s 3/8 rule and taking seven ordinates

Solution: n+1=7  n = 6, h = 2
The points of division are 0, 2, 4, 6, 8, 10, and 12.
0 2 4 6 8 10 12
1.0 0.2 0.05882 0.02703 0.01538 0.00990 0.00690

The Simpson‟s three-eighth's rule is

Example 5.24: Evaluate∫ , by using Simpson‟s 3/8 rule, taking n = 6, correct to five
decimal places.
Solution: The points of division are

2 ⁄ ⁄ 4 ⁄ ⁄
0.30103 0.42597 0.52288 0.60206 0.66901 0.72700 0.77815

135
Numerical Method for Engineering

Exercise 5.10

1. Using Simpson‟s 3/8 Rule evaluate ∫ with step size and with the
tabulated values of given below.

1. Evaluate the integration of ∫ using Simpson‟s 3/8 Rule with

136
Numerical Method for Engineering

Unit Summary
 Interpolation is the method of computing the value of the function y = f (x) for any given
value of the independent variable x when a set of values of y = f (x) for certain values of
x are given.
 The study of interpolation is based on the assumption that there is no sudden jump in the
values of the dependent variable for the period under consideration.
 In this chapter, the study of interpolation was presented based on the calculus of finite
differences. Some important interpolation formulae by means of forward and backward
differences of a function, which are frequently used in scientific and engineering
calculations, were also presented.
 Numerical differentiation is not a particularly accurate process due to a conflict between
round off errors and errors inherent in interpolation. Hence, a derivative of a function
can never be computed with the same precision as the function itself.
 In this chapter we have presented the various techniques on numerical integration.
Integration methods such as the trapezoidal rule, Simpson‟s one-third rule and
Simpson‟s three-eight‟s rule integration were presented with illustrative examples.
These methods use uniformly spaced based points.
Some important formula
 The Lagrange interpolation formula given by

or ∑

Where, ∏ .

 The formula given by

) is called the Newton’s forward interpolation formula.

 The formula given by

is called the Newton’s forward interpolation formula.

137
Numerical Method for Engineering

Derivatives Based on Newton’s forward Interpolation formula

 [ ]

 [ ]

When x = x0, u = 0

 * +

Derivatives Based on Newton’s Backward Interpolation formula

 [ ]

 [ ]

When x = x0, v= 0

Numerical Integration formula

 Trapezoidal rule. ∫

 Simpson‟s 1/3 rule ∫

138
Numerical Method for Engineering

 Simpson‟s 3/8 rule ∫

Review Exercise
1. Find the polynomial of degree three relevant to the following data using Lagrange‟s
interpolation formula

2. Find the polynomial of the least degree which attains the prescribed values at the given
point using Lagrange‟s interpolation formula.

3. Using Lagrange‟s interpolation formula, find the value of corresponding to


from the following table

6 11 13

4. Given that√ √ √
√ Find the value o √ .
5. Evaluate for from the data in the following table.

139
Numerical Method for Engineering

6. A second degree polynomial passes through the points –


Find the polynomial.
7. In an examination the number of students who obtained marks between certain limits was
as follows.
Marks

No of students

Find the number of students whose scores lie between .

8. The table below gives the values of Find and


).

9. The population (in thousands) of a small town is given in the following table. Estimate the
population in the years 1965 and 1995.

10. From the following table of values, estimate y'(1.0) and y''(1.0).

X 1 2 3 4 5 6

Y 6 25 104 309 730 1481

11. A particle is moving along a straight line. The displacement at some time instance are
given below. Find the velocity and acceleration of the particle

140
Numerical Method for Engineering

12. Find the values of and from the following table:

13. Find the values of y'(6.0) and y''(6.0) from the following table:

14. Evaluate ∫ by taking eight subintervals using trapezoidal rule.

15. Compute the following integral numerically using the trapezoidal rule: ∫
Use (a) 1, (b) , (c) and (d) The exact value of
Compare your computed results in each case with the exact result.
16. Determine the area bounded by the curve x and the -axis between and
using the trapezoidal rule with an interval size of (a) , (b)

17. Evaluate ∫ , taking n = 6, correct to five significant figures by Simpson‟s 1/3 rule.

18. Evaluate ∫ by taking seven grid points and using the Simpson‟s 1/3 rule.

19. Evaluate∫ √ correct to two decimal places using Simpson‟s 3/8 rule
with

20. Evaluate∫ by using Simpson‟s 3/8 rule.

141
Numerical Method for Engineering

Reference
 Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
 Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
 Allen, M. and Iaacson, E., Numerical Analysis for Applied Science, Wiley, New York,
1998.
 Atkinson, K.E., An Introduction to Numerical Analysis, 2nd ed., Wiley, New York, NY,
1993.
 Atkinson, K.E. and Han, W., Elementary Numerical Analysis, 3rd ed. Wiley, New York,
2004.
 [Link] , Numerical Methods ,New Age International Publisher, New Delhi, 2010

142
Numerical Method for Engineering

Chapter six
First order initial value problems
UNIT OBJECTIVES

At the end of this unit each student should able to:


 Define DE, ODE and Initial value problems.
 Identifying homogenous, separable, exact, and non exact equations
 solving ODE problems using numerical methods
INTRODUCTIONNumerical methods are becoming more and more important in engineering
applications, simply because of the difficulties encountered in finding exact analytical solutions
but also, because of the ease with which numerical techniques can be used in conjunction with
modern high-speed digital computers. Several numerical procedures for solving initial value
problems involving first-order ordinary differential equations are discussed in this chapter.
In spite of the fact that the error analysis is an important part of any numerical procedure, the
discussionin this chapter is limited primarily to the use of the procedure itself.
An ordinary differential equation is one in which an ordinary derivative of a dependent variable
y with respect to an independent variable x is related in a prescribed manner to x, y and lower
derivatives
6.1Definition of ODE and Examples
Definition 6.1: An equation involving one or more derivatives of a dependent variable with
respect to one or more independent variables is called a differential equation.
Example 6 1: Consider the following examples
1. is a differential equation with independent variable and dependent
variable .

2. ( ) is a differential equation with independent variable and

dependent variable u.

3. is a differential equation with independent variables and and

dependent variable .
Remark 1: A differential equation is divided into an ordinary differential equation and a partial
differential equation.

143
Numerical Method for Engineering

Definition 6.2: A differential equation involving one or more derivatives of a dependent variable
with respect to only one variable is called an ordinary differential equation(ODE). But, if the
number of independent variables is two or more then it is called a partial differential
equation(PDE).
Example 6. 2: Consider the following examples

1. etc. are ordinary differential equations.

2. etc. are partial differential equations.

Definition 6.3: The order of a differential equation is the order (number) of the highest
derivative appearing in the differential equation.
 An ordinary differential equation of order is an equation of the form:
( )
Where, is a continuous function of variables with .
 An ordinary differential equation of first order has the form:

Where, is a continuous function of variables with .


6.2 Order of differential equations, Linear and non-linear ODE
Definition6. 4: The degree of a differential equation (if it exists) is the highest exponent of the
highest order derivative that occurs in the differential equation after the differential equation is
expressed as a polynomial of the derivatives of the dependent variable.
Example6 3: Assume the following examples
1. is a differential equation of order 1 and degree 1.

2. is a differential equation of order 2 and degree 3.



3. is a differential equation of order 3 and degree 2.
4. √ is a differential equation of order 4 and degree 1.
Remark 2: If degree of the ordinary differential equation is one then it is called a linear
differential equation. Otherwise it is called a non – linear differential equation.
6.3 Nature of solution ODE: particular and general solutions

Definition 6 5: A relation that is free of derivatives and that satisfies identically an ordinary
differential equation on a region is called a solution of the ordinary differential equation.

144
Numerical Method for Engineering

 A solution of an order differential equation with arbitrary constants is called the


general solution.
 A solution that is free of any arbitrary constant is called a particular solution.
Example 6. 4: Justify the following examples
1. is an ordinary differential equation, then the function is a solution
of the ODE on and it is a general solution. and again

} are also solutions and they are particular solutions.

2. is an ordinary differential equation, then is the general solution and

}are particular solutions.

3. Given , then is the general solution and

} are particular solutions.

6.4. Initial value problems

Definition6. 6: Solutions(particular) to differential equations may require satisfied certain


defined conditions and such conditions are called initial conditions if they are given at only one
point of the independent variable.
 Conditions given at more than one point of the independent variable are called boundary
conditions.
 The problem of solving an order ordinary differential equation together with an
initial conditions is called an initial value problem(IVP).
 The problem of solving an order ordinary differential equation together with a
boundary conditions is called a boundary value problem(BVP).
Example 6. 5: Consider the following examples
1. and is an IVP.
2. and is a BVP.

145
Numerical Method for Engineering

 The general first order ordinary differential equation can be written as:

Another form of the ordinary differential equation is

That is

6.5Determination of solutions to first order differential equations


6.6.1. Separable differential equations
The general form of a separable differential equation is given by:
or
Method of solving separable differential equations

∫ ∫ , is the general solution.

Example 6. 6:Solve .
Solution:

∫ ∫

| | | |

Therefore, is the general solution of the differential equation.


Exercise 6.1: solve the following initial value problems

146
Numerical Method for Engineering

1. with .
2. with .

6.5.2. Homogeneous differential equations


Definition 6. 7: The differential equation is said to be homogeneous of degree if
and only if .
Example 6.7: Justify the homogeneity of thefollowing
1.
Solution:

Therefore, the differential equation is homogeneous of degree 2.


2. √

Solution: √

Therefore, the differential equation is homogeneous of degree 1.


3.
Solution:

Therefore, the differential equation is not homogeneous.


Remark 3:

147
Numerical Method for Engineering

1. ( ) is a homogeneous differential equation of degree 0.

2. Any homogeneous differential equation can be reduced to a separable differential


equation.
3. The differential equation is homogeneous if and are
homogeneous of the same degree.
Example 6.8:Solve .
Solution: Here, and
and are both homogeneous of degree 1.
Then, is also homogeneous.

Now, ⁄

Let and

and this shows the differential equation is separable.

∫ ∫

∫ ∫ | |

| |

( ) √ ( )

Therefore, ( ) √ is the general solution of the differential equation.

Exercise 6.2: Solve

6.5.3. Exact differential equations

148
Numerical Method for Engineering

Definition 6. 8: A differential equation is said to be exact if and


only if there is a differentiable (partially) function such that

and

Theorem: Suppose and have continuous first order partial derivatives, then the
differential equation is exact if and only if

Example 6.9: Show the differential equation with is exact.


Solution: Here, and

And

Therefore, and implies the differential equation is exact.

Or

Therefore, the given differential equation is exact.


6.5.4. Steps to determine the function

1.

∫ ∫

and ∫

149
Numerical Method for Engineering

(∫ *

∫( (∫ *+

Therefore, ∫ ∫( ∫ )

2.

∫ ∫

and ∫

(∫ *

∫( (∫ *+

Therefore, ∫ ∫( ∫ *

Remark 4: is the general solution of the differential equation.


Example 6.10:Solve .
Solution: and

Now, and

The differential equation is exact.

Now,

150
Numerical Method for Engineering

And ( )

Therefore, .

Hence, is the solution of the differential equation.

Example 6.11:Solve ( ) .

Solution: and

Now, and

The differential equation is exact.

Now,

and ( )

Therefore, .

Hence, is the solution of the differential equations.

Exercise 6.3: Solve the following differential equations

151
Numerical Method for Engineering

1. .
2. .

Unit Summary
 Differential equations arise in scientific and engineering applications when a dependent
variable y varies with the independent variable either time t or position x.
 A differential equation involving one or more derivatives of a dependent variable with
respect to only one variable is called an ordinary differential equation (ODE).
 But, if the number of independent variables is two or more then it is called a partial
differential equation (PDE).
 The degree of a differential equation is the highest exponent of the differential equation is
expressed as a polynomial of the derivatives of the dependent variable.
 A differential equation is said to be exact if and only if there

is a differentiable (partially) function such that and

 The differential equation is said to be homogeneous of degree if and only


if .

152
Numerical Method for Engineering

Review Exercise

1. Define the following and give two example


A. Differential equation.
B. ordinary differential equation(ODE)
C. Initial value problems
D. Order and degree of differential equation.
2. Find the general solution of .
3. Justify the homogeneity of . And then Solve it.
4. Show the differential equation with is exact.
5. Use Picard‟s method of successive approximation to find the value of when

given that when and

6. Find the general and the particular solution of

Reference
 Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
 Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
 Chui, C., An Introduction to Wavelets, Academic press, Burlington, MA, 1992.
 Collatz, L., Numerical Treatment of Differential Equations,3rd ed., Springer-Verlag, Berlin,
1966.
 Consatantinides, A., Applied Numerical Methods with Personal Computers, McGraw-Hill,
New York, 1987.
 Dukkipati, R.V., Numerical Methods through Solved Problems, New Age International
Publishers (P) Ltd., New Delhi, India, 2009.
 [Link] , Numerical Methods ,New Age International Publisher, New Delhi, 2010.

153
Numerical Method for Engineering

Chapter seven
Numerical Methods for Initial value problems
UNIT OBJECTIVES

At the end of this unit each student should able to:


 Understand the concept ofInitial value problems.
 Understand the Taylor’s method of order formula
 Understand the conceptEuler’s method
 Understand the concepts of Modified Euler’s method

INTRODUCTION: Numerical methods are becoming more and more important in engineering
applications, simply because of the difficulties encountered in finding exact analytical solutions
but also, because of the ease with which numerical techniques can be used in conjunction with
modern high-speed digital computers. Several numerical procedures for solving initial value
problems involving first-order ordinary differential equations are discussed in this chapter.
In spite of the fact that the error analysis is an important part of any numerical procedure, the
discussion in this chapter is limited primarily to the use of the procedure itself. The theory of
errors and error analysis is sometimes fairly complex and goes beyond the intended scope of this
chapter.
Definition:Solutions (particular) to differential equations may require satisfied certain defined
conditions and such conditions are called initial conditions if they are given at only one point of
the independent variable.
 Conditions given at more than one point of the independent variable are called boundary
conditions.
 The problem of solving an order ordinary differential equation together with initial
conditions is called an initial value problem(IVP).
 The problem of solving an order ordinary differential equation together with
boundary conditions is called a boundary value problem(BVP).
Given with in the interval is called an initial value
problem (IVP).

154
Numerical Method for Engineering

7.1. Taylor’s method of order


Given with in , if is the exact solution of the IVP, then
using Taylor‟s series expansion is expanded about as:

∑ (7.1)

Now, (7.2)

is called Taylor‟s method of order .

(7.3)

Now, substituting in Esq.(6.2) we get

( 7.4)

Similarly, if we substituting in Esq.(6.3) we get

(7.5)

Example 7.1: Given and . Then find the approximate solution by Taylor‟s
method of order 3 at .

Solution: The formula is given by

But, , then

( )

155
Numerical Method for Engineering

Then,

Therefore, .

Example 7.2 Use the four order Taylor‟s series method to solve the equation to

approximate when , given that when

Solution:

Hence, the second-order Taylor‟s series method [Eq.(6.4)] becomes

at
at
at
at
Hence, the required Taylor series is

When , we have

Exercise 7.1:
1. Use the second-order Taylor series method on for the initial value

problem Take h = 0.1.

2. Use the fourth order Taylor series method with a single integration step to determine

Given that

156
Numerical Method for Engineering

7.2. Euler’s Method

Euler‟s explicit method (also called the forward Euler method) is a single-step, explicit method
for solving a first-order ordinary differential equation.
Let the differential equation is given by:

To solve the equation given in (6.6 for the values of at


integrate equation with one step size. ∫ (7.7)

Take in the range to , then we get

Similarly, for the range to , then

In general form we have


( 7.8)
This is called Euler’s method.
Example 6.3: Using Euler‟s method solve for of given that

and .

Solution: The values of with the given step size are,


and . then,

, but

, but

157
Numerical Method for Engineering

, but

, but

, but

, but

.
.
Exercise 7.2
1. Use Euler‟s method to solve the differential equation

2. Use Euler‟s method to solve the following differential equation and

7.3. Modified Euler’s method


In case of Euler‟s method we approximate by in the range to , but in this
case we approximate by means of Trapezoidal rule i.e.

(7.9)

Then, (7.10)

Then, we get the iteration formula as:

( ) ( 7.11)

and is the approximation of .


The formula can be starting from by Euler‟s formula.
.

Example 7.4: Using Modified Euler‟s method solve for of given that

and .
Solution: , but .

158
Numerical Method for Engineering

, then

( ),

but and

, but .

. .

( ), but and

, but .

( ), but and

i.e. the solution at is 0.9435942.

Exercise 7.3
1. Using Modified Euler‟s method solve with and .
2. Using Modified Euler‟s method to solve the following differential equation

and

159
Numerical Method for Engineering

Unit Summary

 Differential equations arise in scientific and engineering applications when a dependent


variable y varies with the independent variable either time t or position x.
 In this chapter, the numerical techniques commonly used for solving ordinary differential
equations are presented.
 There are three methods to solve initial value problem for a ordinary differential
equations in this chapter :
 Taylor‟s method of order
 Euler‟s Method .
 Modified Euler‟s method

Review Exercise

1. Using Taylor‟s series method for find correct to four decimal places from the
initial value problem
2. Find the value of y at and using the Taylor‟s series method from

accurate to five decimal places.

3. Using Taylor‟s series method for y(x) given that –x, , find
correct to four decimal places.

4. Use Taylor‟s series method to solve the differential equation to find

and

5. Use Euler‟s method to find y(1) from the differential equation

6. Solve the differential equation using Euler‟s method for x = 0 to 0.4

with y(0)=1 and step size h=0.1


7. Use modified Euler‟s method to find the value of y at , given that and

160
Numerical Method for Engineering

8. Using modified Euler‟s method to find the value of ) in steps of , given that

√ ,

9. Use the modified Euler‟s method to approximate the solution to the following initial value

problem. with step size

10. Solve √ with y(0) = 1 for finding by using modified Euler‟s method

taking

161
Numerical Method for Engineering

Reference
 Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
 Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
 Chui, C., An Introduction to Wavelets, Academic press, Burlington, MA, 1992.
 Collatz, L., Numerical Treatment of Differential Equations,3rd ed., Springer-Verlag, Berlin,
1966.
 Consatantinides, A., Applied Numerical Methods with Personal Computers, McGraw-Hill,
New York, 1987.
 Dukkipati, R.V., Numerical Methods through Solved Problems, New Age International
Publishers (P) Ltd., New Delhi, India, 2009.
 [Link] , Numerical Methods ,New Age International Publisher, New Delhi, 2010.

162
Numerical Method for Engineering

The top left image shows the target hit at high precision and accuracy. The top right image shows the target
hit at a high accuracy but low precision. The bottom left image shows the target hit at a high precision but
low accuracy. The bottom right image shows the target hit at low accuracy and low precision.

More Examples
 If the weather temperature reads 28 °C outside and it is 28 °C outside, then the measurement is said to
be accurate. If the thermometer continuously registers the same temperature for several days, the
measurement is also precise.
 If you take the measurement of the mass of a body of 20 kg and you get 17.4,17,17.3 and 17.1, your
weighing scale is precise but not very accurate. If your scale gives you values of 19.8, 20.5, 21.0, and
19.6, it is more accurate than the first balance but not very precise.

Difference between Accuracy and Precisionሀ


In the previous few sections having discussed what each term means, let us now look at their differences.

163
Numerical Method for Engineering

Accuracy Precision

Precision implies the level of variation that


Accuracy refers to the level of agreement between the
lies in the values of several measurements of
actual measurement and the absolute measurement.
the same factor.

Represents how closely the results agree with the standard Represents how closely results agree with
value. one another.

Single-factor or measurement. Multiple measurements or factors are needed.

It is possible for a measurement to be accurate on Results can be precise without being


occasion as a fluke. For a measurement to be consistently accurate. Alternatively, the results can be
accurate, it should also be precise. precise and accurate.

Practice Questions
Q1) The volume of a liquid is 26 mL. A student measures the volume and finds it to be 26.2 mL, 26.1
mL, 25.9 mL, and 26.3 mL in the first, second, third, and fourth trial, respectively. Which of the
following statements is true for his measurements?
a. They are neither precise nor accurate.
b. They have poor accuracy.
c. They have good precision.
d. They have poor precision.
Answer: They have good precision.
Q2) The volume of a liquid is 20.5 mL. Which of the following sets of measurement represents the value
with good accuracy?
18.6 mL, 17.8 mL, 19.6 mL, 17.2 mL
19.2 mL, 19.3 mL, 18.8 mL, 18.6 mL
18.9 mL, 19.0 mL, 19.2 mL, 18.8 mL
20.2 mL, 20.5 mL, 20.3 mL, 20.1 mL

Answer: The set 20.2 mL, 20.5 mL, 20.3 mL, 20.1 mL represents the value with good accuracy.
Precision and accuracy are two ways that scientists think about error. Accuracy refers to how
close a measurement is to the true or accepted value. Precision refers to how close measurements
of the same item are to each other. Precision is independent of accuracy. That means it is
possible to be very precise but not very accurate, and it is also possible to be accurate without
being precise. The best quality scientific observations are both accurate and precise.

A classic way of demonstrating the difference between precision and accuracy is with a
dartboard. Think of the bulls-eye (center) of a dartboard as the true value. The closer darts land
to the bulls-eye, the more accurate they are.

 If the darts are neither close to the bulls-eye, nor close to each other, there is neither accuracy,
nor precision (SF Fig. 1.5 A).

164
Numerical Method for Engineering

 If all of the darts land very close together, but far from the bulls-eye, there is precision, but not
accuracy (SF Fig. 1.5 B).
 If the darts are all about an equal distance from and spaced equally around the bulls-eye there is
mathematical accuracy because the average of the darts is in the bulls-eye. This represents data
that is accurate, but not precise (SF Fig. 1.5 C). However, if you were actually playing darts this
would not count as a bulls-eye!
 If the darts land close to the bulls-eye and close together, there is both accuracy and precision
(SF Fig. 1.5 D).

 Accuracy is how close a measurement is to the correct value for that measurement. The
precision of a measurement system is refers to how close the agreement is between
repeated measurements (which are repeated under the same conditions). Measurements
can be accurate and precise, accurate but not precise, precise but not accurate, or neither.

 Both accuracy and precision reflect how close a measurement is to an actual value, but
they are not the same. Accuracy reflects how close a measurement is to a known or
accepted value, while precision reflects how reproducible measurements are, even if they
are far from the accepted value. Measurements that are both precise and accurate are
repeatable and very close to true values.

165

You might also like