Tikrit University College of Engineering

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Tikrit University

College of Engineering
Mechanical Engineering department

Third Class

Numerical Analysis Course

Dr. Ibrahim Thamer Nazzal

2018/2019

ϭ

Numerical Analysis
WHAT IS NUMERICAL ANALYSIS?
The study of quantitative approximations to the solutions of
mathematical problems including consideration of and bounds
to the errors involved
TWO ISSUES OF NUMERICAL ANALYSIS:
– How to compute? This corresponds to algorithmic aspects;
– How accurate is it? That corresponds to error analysis aspects
Reasons to study the numerical analysis
y Non-linear equations
y Complex behaviours
y Analytical methods may not exist to solve for the exact roots or
the exact solution
y Use of computers
• Flexibility of making changes
• Powerful software packages are available (special or general
purpose).
• IMPORTANT NOTES:
• Numerical analysis solution is always numerical.
• Results from numerical analysis is an approximation.

Ϯ

Nature of numerical problems
The field of numerical analysis explores the techniques that give
approximate solutions to such problems with the desired
accuracy.
NUMERICAL ERRORS
When we get into the real world from an ideal world and
finite to infinite, errors arise.

SOURCES OF ERRORS:
• Mathematical problems involving quantities of infinite
precision.
• Numerical methods bridge the precision gap by putting
errors under firm control.
• Computer can only handle quantities of finite precision.
TYPES OF ERRORS:
1. Truncation errors are those errors corresponding to the fact that a finite
(or infinite) sequence of computational steps necessary to produce an
exact result is “truncated” prematurely after a certain number of steps.
ϯ

• Truncation error (finite speed and time) - An example:

2. Round of errors are errors arising from the process of rounding off
during computation. These are also called chopping, i.e. discarding all
decimals from some decimals on.
• Round-off error (finite word length): All computing
devices represent numbers with some imprecision, except
for integers.
3. Inherent errors or experimental errors
• Human errors: (a) Mathematical equation/model. (b)
Computing tools/machines. (c) Error in original data. (d)
Propagated error.
Measure of errors

ϰ

Example, if ܽ෤ = 10.52 is an approximation to a = 10.5, then
the error is ε = 0.02.
Example: Let the true value of p be 3.1415926535898 and
its approximation be 3.14 as usual. Compute the absolute
error and relative error of such an approximation.
The absolute error:

which implies that the approximation is accurate up to 2


decimal places.

The relative error:

STABILITY AND CONVERGENCE


STABILITY in numerical analysis refers to the trend of
error change iterative scheme. It is related to the concept of
convergence.
It is stable if initial errors or small errors at any time remain
small when iteration progresses. It is unstable if initial
errors or small errors at any time get larger and larger, or
eventually get unbounded.
CONVERGENCE: There are two different meanings of
convergence in numerical analysis:

ϱ

a. If the discretized interval is getting finer and finer after
dicretizing the continuous problems, the solution is
convergent to the true solution.
b. For an iterative scheme, convergence means the iteration
will get closer to the true solution when it progresses.

Solving Nonlinear Equations


If we have
f (x)=0
means to find such points that f (r)=0.
We call such point roots of function f (x). A number r that
satisfies an equation is called a root of the equation.

f (x) = 0 is called an algebraic equation if the corresponding f


(x) is a polynomial.
An example is 7x2 + x - 8 = 0.
f (x) = 0 is called transcendental equation if the f (x) contains
trigonometric, or exponential or logarithmic functions.
Examples of transcendental equations are sin x – x = 0, tan x - x
= 0 and 7x3 + log (3x - 6) + 3ex cos x + tan x = 0.
How find the values roots of the equation f(x) = 0, or the zeroes
of the function f (x).

ϲ

The equation has two simple roots ( -1 and -3) and a
repeated root (3) with multiplicity = 2.
Graphical Interpretation of Zeros

There are methods to find the roots of algebraic and


transcendental equations of the form f (x) = 0.
Solution Methods
Several ways to solve nonlinear equations are possible:
1. Analytical Methods
Analytical Solutions are available for special equations
only.

ϳ

No analytical solution is available for : x – e-x = 0

2. Graphical Methods
Graphical methods are useful to provide an initial
guess to be used by other methods.

3. Numerical Solutions
Finding Roots of Equations using numerical solutions

Numerical methods of finding roots of zeros function are


Bracketing Methods
•Bisection Method
•False-Position Method
Open Methods
• Fixed point Iteration

ϴ

•Newton-Raphson Method (Needs the derivative of the function.)
•Secant Method

Bracketing Methods
In bracketing methods, the method starts with an interval
that contains the root and a procedure is used to obtain a
smaller interval containing the root.
Examples of bracketing methods:
• Bisection method
• False position method
General Idea of Bracketing Methods

Open Methods
• In the open methods, the method starts with one
or more initial guess points. In each iteration, a
new guess of the root is obtained.

ϵ

• Open methods are usually more efficient than
bracketing methods.

Fixed point Iteration Method


We have seen the non-linear equation is f(x) =0
The idea of the fixed point iteration methods is to first
reformulate a equation to an equivalent fixed point
problem:
f(x) = 0 ļ x = ‫(׋‬x)
and then to use the iteration: with an initial guess x0 chosen,
compute a sequence
xn+1 = ‫(׋‬xn), n •0

There are infinite many ways to introduce an equivalent


fixed point problem for a given equation.
EŽǁŝŶƚŚŝƐŵĞƚŚŽĚƚŚĞƉƌŽĐĞƐƐŝƐ
• To solve f(x) = 0.
• Rearrange f(x) in such a way that x = ‫(׋‬x)
ĺProvide initial guess for x say xi
ĺEvaluate g(xi)
ĺIf not equal then, xi+1= g(xi)
ĺEvaluate g(xi+1)
ĺContinue till some tolerance İi.e., |xi+1–xi| ” İ

Example Solve f (x) = x2 + 3x +1= 0, by fixed-point


iteration method.
ϭϬ

Solution
Write the given equation as
x2 = 3x −1 or x = 3 −1/ x .
Choose g(x) = 3 −1/ x

The iterative formula is given by

Example Find a real root of the equation x3 + x2 -1 = 0


on the interval [0, 1] with an accuracy of 10-4.
To find this root, we rewrite the given equation in the form

Hence the iteration method gives:

ϭϭ

which is less than 0.0004. The iteration is therefore terminated
and the root to the required accuracy is 0.7549
Example : Use the method of iteration to find a positive root,
between 0 and 1, of the equation x ex = 1 .
Writing the equation in the form
x = e-x.

Example Find the root of the equation 2x = cos x + 3 and


correct to three decimal places.

We rewrite the equation in the form


ϭϮ


You might also like