Module 1 Numerical Computations

You might also like

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

Module 1

Numerical Computations

Engr. Gerard Ang


School of EECE
Introduction to Numerical Methods

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 hence it is sometimes
called as “computer mathematics.” The aim of
numerical methods is therefore to provide systematic
methods for solving problems for which analytical
solutions do not exist, in a numerical form.
Error Consideration
Sources of Errors:
1. Modeling Errors: Mathematical modeling is a
process when mathematical equations are used to
represent a physical system. This modeling
introduces errors and are called modeling error.
2. Blunders and Mistakes: Blunders occur at any stage
of the mathematical modeling process and consist to
all other components of error. Blunders can be
avoided by sound knowledge of fundamental
principles and with taking proper care in approach
and design to a solution. Mistakes are due to the
programming errors.
Error Consideration
Sources of Errors:
3. Machine Representation and Arithmetic Errors:
These errors are inevitable when using floating-point
arithmetic when using computers or calculators.
Examples are rounding and chopping errors.
4. Mathematical Approximation Errors: This error is
also known as a truncation error or discretization
error. These errors arise when an approximate
formulation is made to a problem that otherwise
cannot be solved exactly
Accuracy and Precision
• Accuracy refers to how closely a computed or measured
value agrees with the true value.
• Precision refers to how closely individual computed or
measured values agree with each other.
• Inaccuracy (also known as bias) is the systematic
deviation from the truth.
• Imprecision (uncertainty) refers to the magnitude of the
scatter.
Absolute Error and Relative Error
➢ Absolute error (Ea) – it is the magnitude of the
difference between the exact value and the
approximation.
➢ Relative error (Er) – it is the absolute error divided
by the magnitude of the exact value. The percent
error is a version of the relative error.

Ea = Exact Value − Approximate Value

Exact Value − Approximate Value


Er =
Exact Value
Types of Errors
1. Inherent errors are the errors that pre-exist in the problem
statement itself before its solution is obtained. Inherent
errors exist because the data being approximate or due to
the limitations of the calculations using digital computers.
2. Round-off error are error introduced by the omission of
significant figures due to computer imperfection.
3. Truncation errors are defined as those errors that result
from using an approximation in place of an exact
mathematical procedure.
4. The total numerical error is the summation of the
truncation and round-off errors.
5. Model errors relate to bias that can be ascribed to
incomplete mathematical models.
Taylor’s Theorem
Taylor’s theorem allows us to represent, exactly, and fairly general
functions in terms of polynomials with a known, specified, and boundable
error. Taylor’s theorem is stated as follows:
Let f(x) have n + 1 continuous derivatives on [a, b] for some n ≥ 0, and let
x, x0 ∈ [a, b]. Then
f x = pn x + Rn(x)

n
Where: x − xo k (k) 1 x
pn x = ෍ f (xo) Rn x = න x − t nf n+1 t dt
k! n! x
k=0 0

Also, there exists a point ξx, between x and x0 such that

x − xo n+1 (n+1)
Rn x = f (ξ) Rn(x) is the remainder
n+1 !
Taylor’s Series
Taylor’s series gives us a means to predict a function value at
one point in terms of the function value and its derivatives at
another point. Taylor’s series is an associated formula of Taylor’s
theorem.
Taylor’s series expansion is defined by

f(xi+1 )
′′ ′′′ n x
f x i f x i f i
= f xi + f ′ xi h + h2 + h3 + ⋯ + hn + R n
2! 3! n!

f n+1
(ξ) n+1
Rn x = h h = xi+1 − xi
n+1 !
Sample Problems for Taylor Series
1. Use zero- through fourth-order Taylor series
expansions to approximate f(1) for the function
f(x) = -0.1x4 – 0.15x3 – 0.5x2 – 0.25x + 1.2
Using a base point at x = 0. Compute the true
percent error for each approximation.

2. Use zero- through third-order Taylor series


expansions to approximate f(3) for the function
f(x) = 25x3 – 6x2 + 7x - 88
Using a base point at x = 1. Compute the true
percent error for each approximation.

You might also like