Error Estimation in Numerical Methods
Error Estimation in Numerical Methods
Chapter one
Objectives:
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.
Objectives:
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
Example1. 2
2
Numerical Method for Engineering
Objectives:
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:
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
̃ Sign ̃
̃ Sign ̃
̃ Sign ̃
In both cases the resulted error in this process is given by the formula | ̃|.
4
Numerical Method for Engineering
Therefore, the number becomes, ̃ and the resulted error is given by:
| ̃| | |
Therefore, the number becomes, ̃ and the resulted error is given by:
| ̃| | |
Objectives:
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: | |
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, ⁄ ⁄ ⁄
Solution:
| | | |
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.
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
̃ | ̃ | ̃
Solution: ̃ | ̃ | ̃ | ̃ | ̃
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
Computations
Decision making
For loops
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
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
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.
13
Numerical Method for Engineering
Chapter Two
Objectives:
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.
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.
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:
16
Numerical Method for Engineering
True solution
True solution
In order to find a root of lying in the interval we divide the interval into half. i.e.
then
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 .
and
17
Numerical Method for Engineering
and
and
and
and
| |
and
| |
and
| |
18
Numerical Method for Engineering
| |
| |
| |
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).
most
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
Exercise 2.1 Solve the following equations using the bisection method
21
Numerical Method for Engineering
Objectives:
At the end of this chapter the students will be able to:
The curve is not generally a straight line. Assume that is continuous in the interval
and .
Approximate solution
Exact solution
Now, the equation of the straight line which passes through the points and is
given by:
( )
( )
22
Numerical Method for Engineering
Suppose that and , then as in the Bisection method we follow three cases.
Example 2.3 Solve the equation using False position method in the interval
with .
̃ ,
̃ ,
and| | .
and | | .
23
Numerical Method for Engineering
and | | .
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.
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.
Exercise 2.3Solve the following equations using the method of successive approximation.
25
Numerical Method for Engineering
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
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 .
and | | | |
28
Numerical Method for Engineering
and | | | |
and | | | |
and | | | |
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
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
.
30
Numerical Method for Engineering
| | | |
| | | |
| | | |
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
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
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.
33
Numerical Method for Engineering
Chapter Three
Systems of linear equations
Objectives:
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)
. . . .
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)
Objectives:
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
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
A linear system of equations which has a lower triangular coefficient matrix has the form
is written as:
as follows:
36
Numerical Method for Engineering
(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
38
Numerical Method for Engineering
( +
Step 1:
( + ( ) [ ]
Step 2:
( ) ( )
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. ( ,( ) ( ,
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)
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
[ ( *]
* ( )+ .
Exercise 3.2 Use Gauss elimination with partial pivoting method to solve the system
41
Numerical Method for Engineering
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.
( )( ) ( )
Step 1: Assume that , then replace by 1 in the augmented matrix and this is
⁄ , for all
Now, we make the non – diagonal elements of the first column of to become zero. That is
, for all .
⁄ , 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 .
⁄ , for all .
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:
( +( + ( +
( +
Step 1: Eliminate the coefficients of the first column below the diagonal element.
( + ( +
( + ( )
43
Numerical Method for Engineering
Once again eliminate the non – diagonal elements of the second column. i.e.
( )
( )
( ) ( )
Then, eliminate the non – diagonal elements of the third column. i.e.
( ) ( )
( )
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
c.
45
Numerical Method for Engineering
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 ,
46
Numerical Method for Engineering
. . .. . .
. . . .
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.
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
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
| ( | +
( | + [ ]
( | + [ ]
( | + [ ]
( | + [ ]
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
[ ]
[ ][ ] [ ]
[ ]
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
( +
( +
Transform the elements below the diagonal element in the first column of to zero,
i.e.
49
Numerical Method for Engineering
( + ( +
( + ( )
Then, eliminate the non – diagonal elements of the second column, 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
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.
Therefore, ( +( + ( +
51
Numerical Method for Engineering
( *
( +( + ( +
( +( + ( +
52
Numerical Method for Engineering
Example 3.8 Using matrix decomposition method solve the following system of linear
equations.
( +( ) ( +
Let
( +( + ( +
Then, solve the unknowns by equating the two matrices and we get
and
Then, we have
( +( + ( +
Then, ( +( ) ( )
53
Numerical Method for Engineering
[ ]
, . 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)
[ ][ ] [ ] (iii)
Where,
[ ][ ] [ ] (iv)
54
Numerical Method for Engineering
, , and .
Exercise 3.5 Solve the following system of linear equations using matrix decomposition method.
a. b.
[ ][ ] [ ] (1)
(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
55
Numerical Method for Engineering
⌈ ⌉
⌈ ⌉
⌈ ⌉
⌈ ⌉
⁄
⁄
⁄
⁄
⁄
⁄
56
Numerical Method for Engineering
Exercise 3.6
Solve the following set of tridiagonal set of algebraic equations using Thomas‟s method.
Objectives
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
The first iterative technique is called the Jacobi method, after Carl Gustav Jacob Jacobi
57
Numerical Method for Engineering
( )
58
Numerical Method for Engineering
∑( )
[ ]
Continue the iterations until two successive approximations are identical when rounded to three
significant digits.
Solution: To begin, write the system in the form
Initial approximation
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
Now that we have a new value for however, use it to compute a new value for . That is,
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.
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
* +
[ ]
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
[ ]
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
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)
Objectives:
66
Numerical Method for Engineering
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
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)
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
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:
Solution: let
[ ]
[ ]
and
* + 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
* +
( )
Using Newton‟s method for about three iterations with an initial approximation
.
3. Solve the system of linear equations
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
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.
( )
Using Newton‟s method for about three iterations with an initial approximation
.
10. Solve the system of linear equations
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.
74
Numerical Method for Engineering
Chapter Four
Finite Differences
Objectives:
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)
75
Numerical Method for Engineering
Objectives
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
where is a nonzero rational number (that is, is positive as well as negative rationals).
76
Numerical Method for Engineering
And
Average operator, :
That is
Objectives:
77
Numerical Method for Engineering
Hence
– – – – –
– – – – –
– – – – – –
– – etc.
In general, we have
Also,
– –
and
78
Numerical Method for Engineering
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.
Solution: The forward difference table for the given data is shown below.
79
Numerical Method for Engineering
80
Numerical Method for Engineering
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
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
83
Numerical Method for Engineering
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
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
From the table we see that and hence the missing term.
Exercise4.3:
1. Construct a backward difference table for the following data.
86
Numerical Method for Engineering
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
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
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) (⏞ + (⏞ +
(⏞ +
And
2.
90
Numerical Method for Engineering
Hence
* + * +
* +
* +
( )
(Since )
Note: If , then ( )
91
Numerical Method for Engineering
Again
Hence ( )
Thus .
b)
And
Therefore .
3.
Proof:
We know that
( )
Which implies that .
4.
92
Numerical Method for Engineering
Proof:
5.
Proof:
Since
--------------------------------------------------------------- (1)
Also
------------------------------------------------- (2)
Therefore from (1) and (2), we have;
93
Numerical Method for Engineering
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
b) for
c) for
d) for
2. Find the missing term of the following.
95
Numerical Method for Engineering
a)
b)
c)
e)
c)
96
Numerical Method for Engineering
CHAPTER FIVE
INTERPOLATIONS
UNIT OBJECTIVES
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
then
Hence, and
Objective
98
Numerical Method for Engineering
Or
Or
or ∑
Where, ∏ .
99
Numerical Method for Engineering
,
, where
Therefore,
( ) ( )
( )
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
, where
Therefore,
( ) ( )
( * ( *
( *
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
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)
(5.7)
Let x = x0 + uh or x - x0 = uh
(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
=√
Here
Example 5.5
104
Numerical Method for Engineering
Here – –
60
105
Numerical Method for Engineering
We have ,
106
Numerical Method for Engineering
( )
Example 5.7
The profits of a company (in thousands of rupees) are given below:
107
Numerical Method for Engineering
To calculate profits at
Let
Or thousand rupees.
Exercise 5.2
1. Find for using the following table.
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)
(5.11)
(5.12)
Substituting the values from Esq. (5.11), (5.12) and (5.13) in Eq. (5.10), we get
(5.14)
– n–1
109
Numerical Method for Engineering
– –
(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
Example 5.9
From the following table estimate the number of students who obtained marks in computer
programming between .
111
Numerical Method for Engineering
Let
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
Objective
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
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
Solution:
The forward difference table is
1.0 5.4680
0.1985
0.2599 0.0074
0.4050 0.0074
0.4887
1.5 7.1488
115
Numerical Method for Engineering
[ ]
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
1.0 0
0.128
0.416 0.05
0.754 0.05 0
116
Numerical Method for Engineering
1.142 0.05
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,
[ ]
Solution: First we find the forward differences using forward difference table as follows
117
Numerical Method for Engineering
Then, ( )
( )
( )
( *
( *
( + ( *
Exercise 5.4
118
Numerical Method for Engineering
] 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
1 0.0201
2 0.0844 0.0643
Here
[ ]
120
Numerical Method for Engineering
Exercise 5.5
1. Find the values of ) and ) from the following table
[ ] * +
* +
Where
121
Numerical Method for Engineering
* ( )
( ) +
and
* ( ) ( )
* ( ) ( ) +
[ ]
Example 5.14: Find for for the given in the following table.
0 0
0.10017
0.10117 0.00101
122
Numerical Method for Engineering
0.10318 0.00105 0
0.10624 0.00109
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
1.4
123
Numerical Method for Engineering
1.4 0.5
1.9 -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
Objective
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.
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
(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)
∫ [ ] (5.35)
126
Numerical Method for Engineering
Where x = x0 + ph
∫ [ ] (5.36)
∫ *
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 ∫ ∫
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)
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:
significant figures
Solution:
0 2 4 6 8 10 12
1
129
Numerical Method for Engineering
Solution:
Exercise 5.8
1. Using trapezoidal rule evaluate ∫ with step size and with the tabulated
values of given below.
B) Simpson’s Rule
130
Numerical Method for Engineering
Fig .3.
Consider three equally spaced points Since the data are equally spaced,
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.
131
Numerical Method for Engineering
(5.44)
Example 5.19: Evaluate the integral∫ , taking n = 6 using Simpson‟s 1/3 rule.
Solution:
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
Solution:
2 ⁄ ⁄ 4 ⁄ ⁄
0.30103 0.42597 0.52288 0.60206 0.66901 0.72700 0.77815
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
∫ * + (5.45)
Similarly, we get ∫
∫ (5.46)
and so on.
Finally, we have ∫ (5.47)
(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
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
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.
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, ∏ .
137
Numerical Method for Engineering
[ ]
[ ]
When x = x0, u = 0
* +
[ ]
[ ]
When x = x0, v= 0
Trapezoidal rule. ∫
138
Numerical Method for Engineering
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.
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
No of students
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
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
13. Find the values of y'(6.0) and y''(6.0) from the following table:
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
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
dependent variable u.
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
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:
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
145
Numerical Method for Engineering
The general first order ordinary differential equation can be written as:
That is
Example 6. 6:Solve .
Solution:
∫ ∫
| | | |
146
Numerical Method for Engineering
1. with .
2. with .
Solution: √
147
Numerical Method for Engineering
Let and
∫ ∫
∫ ∫ | |
| |
( ) √ ( )
148
Numerical Method for Engineering
and
Theorem: Suppose and have continuous first order partial derivatives, then the
differential equation is exact if and only if
And
Or
1.
∫ ∫
and ∫
149
Numerical Method for Engineering
(∫ *
∫( (∫ *+
Therefore, ∫ ∫( ∫ )
2.
∫ ∫
and ∫
(∫ *
∫( (∫ *+
Therefore, ∫ ∫( ∫ *
Now, and
Now,
150
Numerical Method for Engineering
And ( )
Therefore, .
Example 6.11:Solve ( ) .
Solution: and
Now, and
Now,
and ( )
Therefore, .
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
152
Numerical Method for Engineering
Review Exercise
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
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)
Now, (7.2)
(7.3)
( 7.4)
(7.5)
Example 7.1: Given and . Then find the approximate solution by Taylor‟s
method of order 3 at .
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
Solution:
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
2. Use the fourth order Taylor series method with a single integration step to determine
Given that
156
Numerical Method for Engineering
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:
and .
, but
, but
157
Numerical Method for Engineering
, but
, but
, but
, but
.
.
Exercise 7.2
1. Use Euler‟s method to solve the differential equation
(7.9)
Then, (7.10)
( ) ( 7.11)
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
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
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
3. Using Taylor‟s series method for y(x) given that –x, , find
correct to four decimal places.
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
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.
163
Numerical Method for Engineering
Accuracy Precision
Represents how closely the results agree with the standard Represents how closely results agree with
value. one another.
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