0% found this document useful (0 votes)
17 views53 pages

MATH 5 Lesson 1

Numerical methods are techniques used to solve mathematical problems that cannot be solved analytically. Numerical solutions are approximations that can be very accurate when calculations are executed iteratively until a desired accuracy is achieved. Significant figures and various types of errors in numerical solutions are discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views53 pages

MATH 5 Lesson 1

Numerical methods are techniques used to solve mathematical problems that cannot be solved analytically. Numerical solutions are approximations that can be very accurate when calculations are executed iteratively until a desired accuracy is achieved. Significant figures and various types of errors in numerical solutions are discussed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

MATH 5

Kim Marinelle C. Tiamson, REE


MATH 5

Numerical methods are mathematical techniques used for solving


mathematical problems that cannot be solved or are difficult to
solve analytically.

An analytical solution is an exact answer in the form of a


mathematical expression in terms of the variables associated with
the problem that is being solved.
MATH 5

A numerical solution is an approximate numerical value (a number)


for the solution. Although numerical solutions are an approximation,
they can be very accurate. In many numerical methods, the
calculations are executed in an iterative manner until a desired
accuracy is achieved.
MATH 5

Numerical techniques for solving mathematical problems were


developed and used hundreds and even thousands of years ago.
Imple mentation of the numerical techniques was difficult since the
calcula tions had to be carried out by hand or by use of simple
mechanical computing devices, which limited the number of
calculations that could be carried out, as well as their speed and
accuracy. Today numerical methods are used with fast electronic
digital computers that make it possible to execute many tedious and
repetitive calculations that pro duce accurate (even though not
exact) solutions in a very short time.
MATH 5

Since numerical solutions are an approximation, and since the


computer program that executes the numerical method might have
errors (or bugs), a numerical solution needs to be examined closely.
This can be done in several ways, depending on the problem.

For example, if the numerical method is used for solving a nonlinear


algebraic equation, the validity of the solution can be verified by
substituting the solution back in the equation.
MATH 5

In more complicated problems, like a solution of a differential


equation, the numerical solu tion can be compared with a known
solution of a similar problem, or the problem can be solved several
times using different boundary (or ini tial) conditions, and different
numerical methods, and examining the subsequent differences in the
solutions.
MATH 5
MATH 5

• Physical Meaning of Derivatives and Integrals


• Taylor Series Expansion
• Definition of Matrix and Vector; Matrix Algebra -
Summation, Subtraction and Multiplication of
Matrices; Transpose, Determinant and Rank of a
Matrix
MATH 5

The significant digits or significant figures of a number are those


digits that take a meaning that contributes to its accuracy.

The concept of significant figures is often used in connection with


rounding off. Rounding off to significant figures is a more general-
purpose technique than rounding off to n decimal places, since it
handles numbers of different scales in a uniform manner.
MATH 5

These are the rules for identifying significant figures when writing
the numbers:

1. All non-zero digits are considered significant.


Ex. 2.745 has four significant digits: 2, 7, 4, 5

2. Zeros appearing anywhere between two non-zero digits are


significant.
Ex. 20.003 has five significant digits: 2, 0, 0, 0, 3
MATH 5

These are the rules for identifying significant figures when writing
the numbers:

3. Leading zeros are not significant.


Ex. 0.0021 has two significant digits: 2, 1

4. Trailing zeros in a number containing a decimal point are significant.


Ex. 0.002100 has four significant digits 2, 1, 0, 0

5. The number 0 has one significant digit.


MATH 5

These are the rules for identifying significant figures when writing
the numbers:

6. The significance of trailing zeros in a number not containing a


decimal point can be indefinite. Thus, the following conditions are
given:
- A bar may be placed over the last significant figure; any trailing
zeros following this are not significant.
- The last significant digit of a number may be underlined.
- A decimal point may be placed after the number.
MATH 5

These are the rules for identifying significant figures when writing
the numbers:

Ex.
20000 has three significant digits: 2, 0, 0
0.201000 has five significant digits: 2, 0, 1, 0, 0
1.05 x 10^5 has three significant digits: 1, 0, 5
2.0300 x 10^7 has five significant digits: 2, 0, 3, 0, 0
MATH 5

Errors are deviations, discrepancies, inaccuracies and imprecision


from the true or real value.

Accuracy – refers to how closely a computed or measured value


agrees with the true value.
Inaccuracy – also known as bias, refers to the systematic deviation
from the truth.
Precision – refers to how closely individual or measured values agree
with each other.
Imprecision – also known as uncertainty, refers to the scatter of
individual or measured values.
MATH 5

The figure on the left side is an


example from marksmanship
illustrating the concepts of
accuracy and precision:

(a) inaccurate and imprecise,


(b) accurate and imprecise,
(c) inaccurate and precise,
(d) accurate and precise.
MATH 5

Measuring Errors

Errors are normally encountered during the calculation of the


numerical analysis. Since we cannot avoid this, we must learn to deal
with this issue. In dealing with the errors, we must first consider the
following factors:

1. Identifying where the error comes from


2. Quantifying the error
3. Minimizing the error as per the needs
MATH 5

Measuring Errors

One of the most common errors that we encountered during


numerical calculation is true error which is just the deviation between
the true or exact value and the approximate value, i.e.,

True Error = True Value – Approximate Value


MATH 5

Example 1

Find the true error of the derivative of the function f(x) = e^2x at x=1
when h=0.01.

* Set the calculator to: Shift – SETUP – 6:Fix - 4


MATH 5

Example 1
𝒇 𝒙+𝒉 −𝒇(𝒙)
The approximate value of 𝑓’(𝑥) is 𝒇′(𝒙) ≈
𝒉
for 𝑥 = 1 and ℎ = 0.01,
2(1.01) 2(1)
𝑓 1 + 0.01 − 𝑓(1) 𝑒 −𝑒
𝑓′(1) ≈ 𝑓′(1) ≈
0.01 0.01
7.5383 − 7.3891
𝑓 1.01 − 𝑓(1) 𝑓′(1) ≈
𝑓′(1) ≈ 0.01
0.01

𝑓 1.01 − 𝑓(1) 𝒇′(𝟏) ≈ 𝟏𝟒. 𝟗𝟐00


𝑓′(1) ≈
0.01
MATH 5

Example 1

while the exact value of f’(1) can be calculated by


using our knowledge of differential calculus

𝑓 𝑥 = 𝑒 2𝑥
𝑓 ′ 𝑥 = 2𝑒 2𝑥
𝑓 ′ 𝑥 = 2𝑒 2(1)

𝒇 𝟏 = 𝟏𝟒. 𝟕𝟕𝟖𝟏
MATH 5

Example 1

Now, the true error is


True Error = True Value – Approximate Value
True Error = 14.7781 – 14.9200
True Error = - 0.1419 or 14.19%
MATH 5

Relative True Error

From there, we can now compute the relative true error which is the
ratio between the true error and the true value, i.e.,
MATH 5

Example 2

What is the relative true error of the derivative of the function f(x) =
e^2x at x=1 when h=0.01.
MATH 5

Example 2

From Example 1, the true error is - 0.1419 and the true value is
14.7781. Thus, the relative true error is

with the absolute relative true error of |-0.9602| = 0.9602%


MATH 5

Approximate Error

Aside from true error, there is another error known as approximate


error. This error is calculated only if true values are known. This is
very useful when we are interested in checking if a program is in
working order and we know some examples where true error is
known. But mostly we will not have the luxury of knowing true
values as we wouldn’t need to find approximate values if we know
the true values. So when we are solving a problem numerically, we
will only have access to approximate values. We need to know how
to quantify error for such cases.
MATH 5

Approximate Error

Approximate error is defined as the deviation between the present


approximation and previous approximation, i.e.,

Approximate Error = Present Approximation – Previous Approximation


MATH 5

Example 3

Find the approximate error of the derivative of the function f(x) = e^2x
at x=1 when h=0.005 given that the previous h=0.01.
MATH 5

Example 3

In Example 1, the approximate value of f(x) = e^2x at x=1 when h=0.01


is 14.9200. Now, we need to compute the present approximate value
for the f’(x) using
MATH 5
MATH 5

Example 3

Now, the approximate error is

Approximate Error = Present Approximation – Previous Approximation


Approximate Error = 14.8400 – 14.9200
Approximate Error = -0.0800 or -8.0000%
MATH 5

Relative Approximate Error

As for the relative approximate error, it is defined as the ratio between


the approximate error and the present approximation. That is
MATH 5

Example 4

Find the relative approximate error of the derivative of the function


f(x) = e^2x at x=1 when h=0.005 given that the previous h=0.01.
MATH 5

Example 4

From Example 3, the approximate error is -0.0800 and the present


approximation is 14.8400.

Thus, the relative approximate error given by the above formula is

Relative Approximate Error = -0.0054 or -0.5391%


with absolute relative approximate error of |-0.5391| or 0.5391%
MATH 5

We can use the relative approximate error to minimize the error


when solving mathematical models using numerical methods by
calculating the relative approximate error at the end of every
iteration. We can pre-specify a minimum acceptable tolerance
called the pre-specified tolerance.
MATH 5

If the value of absolute relative approximate error is at most the


pre-specified tolerance then the acceptable error has been
reached and no more iteration would be needed. Otherwise, we
may pre-specify how many significant digits we would like in
our answer. In that case, if we want at least m significant in the
answer, then we would need to have the absolute relative
approximate error.
MATH 5

The Round-Off and Truncation Error

An error in solving an engineering or science problem can arise to


several factors. First the error may be in modelling technique. A
mathematical model may be based on using assumptions that are not
acceptable. Second, an error may arise from mistakes in programs
themselves or in the measurement of physical quantities. But in
applications of numerical methods itself, the two errors we need to
focus are
1. Round-off error
2. Truncation Error
MATH 5

Round-Off Error
• occurs because digital computers cannot represent some
quantities exactly. Its value can be calculated by deviating the
rounded digits and the exact value.

• There are two major components of round off error involved in


numerical calculations:
a. the digital computers have size and precision limits in their
ability to represent the numbers
b. certain numerical manipulations are highly sensitive to round-off
errors.
MATH 5

Example 5

Find the round-off error of the following if each number represented


using 5 significant digits
a. e
b. 2.003458764
c. 2/3

*Note: Clear the Fix Setup from the calculator


MATH 5

Example 5

a. Since we are just interested in 5 significant digits,


e = 2.7183
Round-off Error = e – 2.7183
Round-off Error = -0.000018171

b. Round-off Error = 2.003458764 – 2.0035 = -0.000041236

c. Round-off Error = (2/3) - 0.66667 = -0.000003


MATH 5

Truncation Error
• is caused by truncating a mathematical procedure; that is,
replacing an infinite process by a finite one. Its value can also be
calculated by getting the deviation between the exact value and
its approximate value.
MATH 5

Example 6

Find the truncation error of the following:


a. The Maclaurin series ex given that it is truncated into 3 terms.
b. The Maclaurin series cos x given that it is truncated into 3 terms.
MATH 5
MATH 5

Truncation Error

Generally, the Maclaurin series is used as an example to illustrate


truncation error. This may lead us to believe that truncation errors are
just chopping parts of the series. However, truncation errors can take
place in other mathematical procedures as well.
MATH 5

Taylor series expansion of a function is a way to find the value of a


function near a known point, that is, a point where the value of the
function is known. The function is represented by a sum of terms of
a convergent series. In some cases (if the function is a polynomial),
the Taylor series can give the exact value of the function. In most
cases, however, a sum of an infinite number of terms is required for
the exact value. If only a few terms are used, the value of the
function that is obtained from the Taylor series is an approximation.
Taylor series expansion of functions is used extensively in numerical
methods
MATH 5
MATH 5
MATH 5
MATH 5
MATH 5
MATH 5

• Unique and Multiple Solutions, Trivial and Non-


trivial Solutions, No Solution
• Direct Methods
• Gauss Elimination Method
• Gauss Elimination with Row Pivoting
• Iterative Methods
• Jacobi Method
• Gauss-Seidel Method
MATH 5

• Incremental Search method


• Bisection Method
• Regula Falsi and Secant Methods
• Newton-Raphson Method
MATH 5

Equations need to be solved in all areas of science and engineering.


An equation of one variable can be written in the form:

f(x) = 0

A solution to the equation (also called a root of the equation) is a


numerical value of x that satisfies the equation. Graphically, as
shown in Fig. 4.1, the solution is the point where the function /(x)
crosses or touches the x-axis. An equation might have no solution or
can have one or several (possibly many) roots.
MATH 5

Figure 4.1 Illustration of equations with no, one, or several solutions.

You might also like