Introduction
In practical use, an engineer would
finally obtain result in a numerical form for example, for a set of tabulated
data derived from an experiment, inferences may have to be drawn: or, a system
of linear algebraic equations is to be solved.
The aim of the Numerical Analysis is to
provide efficient methods for obtaining numerical answers to such problems.
Rounding-off
In Numerical computations, we come
across numbers which have large number of digits and it will be necessary to
cut them to a usable number of figures. This process is called Rounding-off.
It is usual to round off numbers according to the
following rules.
To round off number to n significant digits, discard all digit to the
right of the nth digit, and if this discard number is-
1] Less than half a unit in the nth place, leave the nth digit unaltered.
2] Greater than half a unit in the nth place, increase the nth digit by unity.
3] Exactly half a unit in the nth place, increase the nth digit by unity if it is odd otherwise, leave it unchanged.
2] Greater than half a unit in the nth place, increase the nth digit by unity.
3] Exactly half a unit in the nth place, increase the nth digit by unity if it is odd otherwise, leave it unchanged.
The number thus rounded off said to be
correct to n significant figures.
Errors
Absolute Error, Relative error and Percentage error
Absolute
error :-
Absolute error is the numerical difference between the true value of a quantity
and its approximate value.
Thus, if X is the true value of a
quantity and X1 is its approximate value, then the absolute error EA
is given by
EA = X - X1 = δx ....................... (1)
Relative error :-
The relative error ER is defined by
ER =
EA
/x = δx/x .....................
(2)
Percentage
error :- The percentage error EP
defined by
EP = 100 ER .........................
(3)
Let ∆X be a
number such that
(4)
Then is an upper limit on the magnitude of the
absolute error and is said to measure absolute accuracy. Similarly, the
quantity
∆X /|x| ≈ ∆X /|x1|
Measure the relative
accuracy. It is easy to reduce that if two numbers are added or subtracted,
then the magnitude of the absolute error in the result is the sum of the
magnitudes of the absolute errors in the two numbers. More generally, if EA1,
EA2, EA3.......
EAn are the absolute errors in n numbers, and then
the magnitude of the absolute error in their sum is given by
|EA1|
+| EA2 | + |EA3 |......+ | EAn |
NOTE: While adding up several numbers of different
absolute accuracies, the following procedure is adopted:
1.1) Isolate the number with the greatest
absolute error.
2.2) Round-off all other numbers retaining
in them one digit more than in the isolated number.
3.3) Add up and Round=off the sum by
discarding one digit.
The
Bisection Method
This method states that if a function f(x) is continuous between a and b,
and f(a) and
f(b) are of opposite sign, then there exists at least one root
between a and b.
For definiteness, let f (a)
be negative and f(b) be positive. Then the root lies between a and b let its
approximate value be given by Xo =
(a=b)/2. If f (Xo) = 0, we
conclude that Xo is a root of
equation f(x) = 0 otherwise, the
root lies either between Xo & a
depending on whether f(Xo) is
negative or positive. We designate this new interval as [a1, b1] whose length is |b-a|/2.
As before, this is bisected at X1
and the new interval will be exactly half the length of the previous one. We
repeat this process until the latest interval is as small as desired, say ϵ. It is clear that the interval width
is reduce by a factor of one half at each step and at the end of the nth
step, the new interval will be [an,
bn ] of length |b-a|/ 2n.
We then have
|b-a|/2n <=ϵ
This gives on
simplification
n >= [ loge(|b-a|)/ϵ] / loge2
Inequality
equation (1) gives the number of iterations to achieve an accuracy ϵ. For
example, if |b-a| = 1 and ϵ = 0.001,
Then
it can be seen that
n >= 10 ...................... (2)
The
method is shown graphically in figure (1)
It
should be noted that this method always succeeds. If there are more roots than one
in the interval, bisection finds one of the roots. It can be easily programmed
using the following computational steps.
Steps
for program:-
1) Choose two real numbers a and b such
that f(a) and f(b) <0.
2) Set Xr = (a +b)/2
3) (a): If f(a)*f (Xr) < 0, the root lies in the
interval (a, Xr). Then, set
b = Xr and go to step 2 above.
(b): If f (a)*f (Xr) > 0, the root lies in the
interval ( Xr, b). Then, set
a = Xr and go to step 2
above.
4) If f (a)*f (Xr) = 0, it means that Xr is
a root of a equation f(x) = 0 and the computation may be terminated.
In practical problems,
the root may not be exact so that condition (3) above is never satisfied. In
such a case, we need to adopt a criterion for deciding when to terminate the
computations.
A convenient criterion is to compute the
percentage error
Ep defined by:
ϵr = | Xr' - Xr/ X'r| * 100% ....................... (3)
Where Xr’ is the new
value of Xr.
The computation can be terminated when
Ep becomes less than a prescribed tolerance, say ϵp. In addition, the maximum number of
iterations may also be specified in advance.
The method of False Position
(Bracketing Method/ chord method)
This is the oldest method
for finding the real root of the non-linear equation f(x) = 0 and closely
resemble the Bisection method.
This method is also known as Regular Falsi
Method or method of chords, we choose two points a and b such that f(a) and
f(b) are of opposite sign. Hence, a root must lie in between these points. Now,
the equation of the chord joining the two points [a, f(a)] and[b, f(b)] is
given by:
y - f(a) / (x - a) = ................. (1)
The method consists in
replacing the parts of the curve between the points [a, f(a)] and [b, f(b)] by
means of the chord joining these points, and taking the points of intersection
of the chord with the x- axis as an approximation to the root. The point of
intersection in the present case is obtained by substituting y = 0 in equation
(1), thus we obtain
x1 = a – [f(a) / (f(b) - f(a)] *(b – a) = [a.f(b) - b.f(a)] / (f(b) -f (a)) ...... (2)
Which is the first
approximation to the root of f(x) = 0.
If now f(x1) and f(a) are opposite signs, then the root lies
between a and x1, and we replaced b by x1 in equation (2) and obtained the next
approximation. Otherwise, we replace a by x1 and generate the next
approximation.
The procedure is repeated till the
root is obtained to the desired accuracy. Figure (b) gives a graphical representation
of the method.
The error criterion can
be used in this method is:
ϵr
= | X0' - X0 / X0' | * 100%
Where x0’ is the new value of x0.The
computations can be terminated when ϵr
becomes less than a prescribed tolerance, say ϵp. In advance, the maximum number of iterations may
also be specified in advanced.
Newton Raphson method
This method is used to
improve the result obtained iby one of the previous methods (Bisection and
False position method)
Let x0 be an approximate root
of f(x) = 0 and let x1 = x0 + h be the correct root so that f(x1) = 0.
Expanding f(x0+h) by Taylor’s series, we obtain h2
F(x0) + hf ’(x0) +h2 /2 f ''(x0)+ ......... = 0
Neglecting the second and
higher order derivatives, we have
F(x0) + hf’(x0) = 0
This gives
h = - f(x0)/ f '(x0)
a better approximation
than x0 is therefore given by x1, where
x1 = x0 - [f(x0)/ f '(x0)] ....................... (1)
Successive
approximation are given by x2, x3.... xn + 1, where
Xn +1 =
Xn – [f(xn)/ f '(xn)] ..................... (2)
This is the Newton
Raphson formula.
Graphically the method consists
in replacing the part of the curve between the points [x0, f(x0)] and the
x-axis by means of the tangent to the curve at the point, and is described
graphically in fig.(c). It can be used for solving both algebraic and transcendental
equations and it can also be used when the roots are complex.
Secant Method
We have seen that the
Newton Raphson method requires the evaluation of derivatives of the function
and this is not always possible particularly in the case of functions arising
in practical problems. In the Secant method, the derivatives at xi are
approximated by the formula:
f ’(xi) ≈ {[f(xi) - f(xi-1)]/[xi - (xi-1)]}
This can be written as:
f ’ = {[fi - (fi-1)]/ [xi - (xi-1)]} ............. (1)
Where fi’ = f(xi).
Hence, the Newton Raphson formula becomes
xi+1 =xi - { fi[xi - (xi-1)] / [fi - (fi-1)]
= {[(xi-1)fi] - [xi(fi-1)]/ [fi - (fi-1)] ....... (2)
Or
x0+1 = x0 - { f(x0)[(x0 - (x0-1)] / [f(x0) - f(x0-1)]
= {[(x0-1)f(x0)] - [x0.f(x0-1)]/ [f(x0) - (f(x0)-1)] .... (2)
It
should be noted that this formula requires two initial approximation the
root.
x2= [xo.f(x1) - x1. f(x0)] / [f(x1) -f(x0)]



0 comments:
Post a Comment