INTRODUCTION TO NUMERICAL ANALYSIS
Numerical methods are the methods used to find an approximation solution to problems
the problem that have no analytical solutions.
Numerical methods are methods for solving problems on computers by numerical
calculations,
Numerical methods yield approximate results, that is results, which are close to the exact
analytical solution
To provide systematic methods for solving problems in a numerical form
Why we use Numerical Methods?
To solve problems that cannot be solved exactly
To solve problems that are difficult to manipulate or solve
What Numerical analysis?
Numerical analysis area of mathematics and computer science that creates, analyzes, and
implements algorithms for obtaining numerical solutions to the problem.
Analytic versus numerical methods
What is a numerical solution and how does such a solution differ from
an exact (true) or analytical solution?
An analytic method for solving a given mathematical problem is any
method based on rigorous mathematical analysis and whose application
leads to the true (exact) solution, also known as analytic solution.
Example 1.1
The exact solutions of the nonlinear equation
can be obtained using the well-known quadratic
formula (analytic method)
Con’t
A numerical method for solving a given mathematical problem is any
method based on rigorous mathematical analysis whose application, in
most cases, can only lead to an approximate (non-exact) solution, also
known as numerical solution.
• Example1.An integral, such as is perfectly defined but the anti-
derivative of the integrand.cannot be expressed using known
mathematical functions.
Remark : Analytical solutions are exact while numerical methods are
only approximate.
Areas of Numerical Analysis
Solving nonlinear equations
Solving sets of equations
Interpolation and curve fitting
Approximation of functions
Numerical differentiation and integration
Numerical solution of differential equations (ordinary and
partial)
Methods of optimization (minimizing/maximizing of a
function)
Basic Concepts on error estimation
Error : a variation b/n true value and a calculated or measured value.
Errors and uncertainty are an unavoidable part of computation
Analysis of errors is the central concern in the study of numerical methods and therefore we
will investigate the source of errors, the type of errors that may be occur in the given problem.
Source of error
1. Model: mathematical models are formulated to describe them and these models do not
describe them exactly and as a result errors are introduced.
2. Method (Numerical): The methods used to solve the mathematical models are often not
exact, hence errors are induced.
3. Data: There may be errors in measuring or estimating values.
4. Representation of numbers: A computer has a finite word length and so only a fixed
number of digits of a number are inserted.
5. Arithmetic: Frequently errors are introduced in carrying out operations such as addition
and multiplication.
Approximations of errors (types of errors)
Numerically computed solutions are subject to certain errors. Mainly
there are three types of errors. They are inherent errors, truncation
errors and errors due to rounding.
A. Inherent errors or experimental errors
Most of numerical computations are inexact either due to
The given data
The limitations of the computing aids.
Limitations of measuring tool
Observer reading output of tool
Due to these limitations numbers have to be rounded causing errors
called inherent 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.
B. Truncation errors
• Truncation error occurs when some infinite process is stopped
(truncated) to a fewer number of terms or iterations in the process. Such
errors are essentially algorithmic errors and one can predict the extent of
the error that will occur in the method.
• Specifically, the solution obtained using some numerical methods may
involve infinite processes. For instance, this is the case with all convergent
iteration methods and convergent infinite series. Since such infinite
processes cannot be carried out indefinitely, one is forced to stop (truncate)
the process and hence accept an approximate solution.
C. Round of errors
When the rational numbers like 1/3; 22/7; 5/9; 8/9 etc,
whose decimal representation involve infinite number
of digits, are involved in our calculations, we are
forced to take only a few number of digits from their
decimal expression and thus an error named round-off
error gets involved.
Rules for Rounding of numbers
While performing any algebraic operation between two or more numbers
written in the decimal number system, it is often required to round-off
these numbers, that is, replace each of them having a smaller of
significant digits. The rule for doing this as follows:
To round off a number to n significant figures, discard all digits to the
right of the nth place;
if the discarded number is less than half a unit in the (n+1)th place, leave the nth
digit unchanged;
if the discarded number is greater than half a unit in the (n+1)th place, add 1 to
the nth digit;
if the discarded number is exactly half a unit in the (n+1)th place, leave the nth
digit unaltered if it is an even number, but increase it by 1 if it is an odd number.
Example
Absolute error and relative error
Absolute error ( ): numerical difference between
the true value ( ) and its approximate value( ).
Relative error: The relative error is defined by:
The percentage relative error is given by
Example 1
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:
Example 2
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 .
Remark 2
If the number is rounded to decimal places, then
the absolute error is given by:
Example 1.7 If and correct to two decimal places,
then find the absolute error.
Solution:
, but in this case
Propagation of 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 between and on the value
of the function. That is we would like to estimate
Con’t,,,
• 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.
Con’t
• For very small dropping the second and higher order derivatives and
rearranging the rest yields
Con’t
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 Stability
An enormous amount of calculations is performed for solving great
number of problems. It’s not unlikely errors to pile up and to grow
infinitely throughout this process. In this case we say that the
calculation process is unstable, i.e. small errors in the initial data lead to
big errors in the result. This may be due to instability of the mathematic
problem itself, to instability of the numerical method or to instability of
calculations
• All calculation involve small error in each calculation ,in this case
the calculation process is stable
Goals for a good algorithm
No matter how good you are… there will always be
errors.
The question is…
How to deal with them?
How much error is present in our calculation and
is it tolerable?
Accuracy.
How close is a computed or measured
value to the true value.
Solution involve small error
Error should be small
Bound on any error so that we have
confident on answer.
Precision . How close is a computed or
measured value to previously computed
or measured values.
Efficiency.
Minimize computational time
Calculation with few second is more efficiency
Representation of number
The digits that are used to express a number are called significant digits or significant figures.
Significant digit of a number c is any given digit of c, except possibly for zeros to the left of the
first nonzero digit that serve only to fix the position of the decimal point. Thus, any other zero
is a significant digit of c
Numerical significant
value figures
1.2 two
0.0012 two
0.001200 four
10. two
10 one
1000 one
12300 three
12300. five
12300.0 six
Note that: Zeros are sometimes used to locate the decimal point not significant figures.
Con’t
0.00001753 4
0.0001753 4
0.001753 4
Most digital computers have two ways of representing numbers
fixed point system: represent numbers by a fixed number of
decimal places for
example 62.358 0.013 1.000
floating point system: represent with a fixed number of
significant digits, for example
2.41×103: three significant digits
2.410×103: four significant digits