Professional Documents
Culture Documents
M KSU: Numerical Analysis (MATH-254)
M KSU: Numerical Analysis (MATH-254)
Fall 2021
Lecture No. 2 (Basic Concepts of Numerical methods and Analysis)
Focus
SU
- Numerical Analysis vs Numerical Methods
K
a. Numerical Methods
b. Numerical Analysis
Sh
1
methods for solving PDEs. As the name suggests, numerical analysis ana-
lyzes these methods and tells us how accurate they are. Obviously it’s a little
more complicated, but that’s the basic gist. I doubt we will have a course
that looks at one and not the other though, so we wouldn’t really stress the
difference at this point.
SU
1. Stability: Numerical analysts are concerned with stability, a concept
referring to the sensitivity of the solution of a problem to small changes in
the data or the parameters of the problem. Consider the following example.
The polynomial
K
p(x) = x7 − 28x6 + 322x5 − 1960x4 + 6769x3 − 13132x2 + 13068x − 5040
2
input, and output. In mathematics, numbers have infinite precision, but
numerals (representations of number) have finite precision. One third ( 13 ) can
not be represented precisely in decimals or it would require an infinite number
of digits, which is impossible. Finite precision is decimal representation of
a number which has been rounded or truncated. Finite precision arithmetic
is important in the field of computing because computers can only work with
(operate) numbers of fixed sizes (finite lengths).
SU
e. Applications of Numerical Methods/Analysis:
(1) Numerical analysis and mathematical modeling are essential in many ar-
eas of modern life. Sophisticated numerical analysis softwares are commonly
K
embedded in popular software packages (e.g., spreadsheet programs) and al-
lows fairly detailed models to be evaluated, even when the user is unaware
of the underlying mathematics. Attaining this level of user transparency re-
quires reliable, efficient, and accurate numerical analysis softwares, and it
M
requires problem-solving environments (PSE) in which it is relatively easy
to model a given situation. PSEs are usually based on excellent theoreti-
cal mathematical models, made available to the user through a convenient
graphical user interface. Best known of these PSEs is MATLAB, a commercial
ah
package that is arguably the most popular way to do numerical computing.
Two popular computer programs for handling algebraic-analytic mathemat-
ics (manipulating and displaying formulas) are Maple and Mathematica.
Sh
3
improving weather forecasts, such models are crucial for understanding the
possible effects of human activities on the Earth’s climate. Many types of
numerical analysis procedures are used in atmospheric modeling, including
computational fluid mechanics and the numerical solution of differential equa-
tions. Researchers strive to include ever finer detail in atmospheric models,
primarily by incorporating data over smaller and smaller local regions in the
atmosphere and implementing their models on highly parallel supercomput-
SU
ers.
K
turing and storage facilities, and investment strategies.
f. Scientific Notation
M
It is defined as a standardized way to represent any real number b as the
product of a real number and an integer power of 10 as follows.
Examples:
– Distance between the moon and the earth = 3.844 × 105 Km (4 s.d.)
4
one person to tell another person both the measurement of something AND
the level of accuracy of that measurement.
SU
(2) Any zeros between two non-zero significant digits are significant.
(3) Leading zeros are NEVER significant and trailing zeros are significant
ONLY when appear in decimal form.
K
Alternatively, use the scientific notation representation of a given number. It
is the easiest way to determine the number of S.D. in a measurement. The
term significant figures refers to the number of important single digits (0
through 9 inclusive) in the coefficient of an expression in scientific notation.
M
The number of significant figures in an expression indicates the confidence or
precision with which an engineer or scientist states a quantity.
There are 3 main steps: (1) Problem formulation, (2) Development of Nu-
Sh
Next Lecture: Types and Sources of Errors, Graphical Method for Locat-
ing Roots of Nonlinear Equations
r.
D
5
Numerical Analysis (MATH-254)
Spring 2021
Lecture No. 3 (Types and Sources of Errors, Graphical Method for
Locating Roots of Nonlinear Equations)
Focus
SU
- Types and sources of errors
K
Errors in Numerical Methods: Errors, their size, and their analytic forms
are a fundamental concern in numerical analysis. When approximating the
solution of a problem, it is prudent to understand the nature of the error in
M
the computed solution. Moreover, understanding the form of the error allows
creation of extrapolation processes to improve the convergence behavior of
the numerical method.
|α − p|
RE = , |α| =
6 0.
|α|
D
1
Explanatory Example: Let α = 3 and p = 0.333, then
1
Absolute Error = |α − p| = × 10−3
3
and
|α − p|
Relative Error = = 10−3
α
6
Note: Generally, RE is a better measure of the extent of error than the ab-
solute error. However, it is not defined when the actual/exact value is zero.
Absolute vs Relative Error: The absolute error tells us how much exactly
the measured value differs from the actual value, or it is the difference b/w
what we have measured and what we should have measured which is not a
very useful information in practical applications. On the other hand, the RE
SU
tells us whether the error is big or small, compared to the actual/real value
which is more useful information. For instance, two students measure two
objects with a meter stick. One student measures the height of a room and
gets a value of 3.125 meter with ±0.001 meter (±1 mm) as the range of uncer-
tainty (error) in the measurement. The other student measures the height of
K
a small cylinder and measures 0.075 meter with the same uncertainty range.
Obviously, the overall accuracy of the ceiling height is much better than that
of 7.5 cm long cylinder. The comparative accuracy of these measurements
can be determined by looking at their REs.
Sources of Errors The common sources of errors are: Human Errors, Ma-
chine/Apparatus errors, Truncation/Chopping Errors, and Round-off Errors
D
7
tion (a polynomial equation of degree n) is defined as:
an xn + an−1 xn−1 + · · · + a1 x + a0 = 0, an 6= 0; n > 1,
where an , an−1 , · · · a1 , and a0 are constants. For example, the following equa-
tions are nonlinear.
x2 + 5x + 6 = 0, x3 = 2x + 1, x200 − 2x + 1 = 0.
SU
Nonlinear Non-Polynomial Algebraic Equations: The nonlinear Al-
gebraic Equations where power of the unknown variable is not a positive
integer number are called non-polynomial. For example, the following non-
polynomial equations are nonlinear.
K
√ 2 2
x−1 + 2x = 1, x + x = 2, x3 + + 4 = 0.
x
Transcendental Equations: An equation which involves trigonometric
M
functions, exponential functions and/or logarithmic functions is called a tran-
scendental equation. For example, all the following transcendental equations.
These equations are always nonlinear.
x = cos x, ex + x − 10 = 0, x + ln x = 10, 2x + tan x − 10 = 0.
ah
Definition (Root of a Nonlinear Equation): Assume that f (x) is a
continuous function. A number α for which f (α) = 0 is called a root of the
equation
Sh
f (x) = 0,
or a zero of the function f (x).
(S-II) Computation of the values of the roots with the specified degree of
accuracy.
8
we can use graphical method and an analytical method called the tabulation
method.
SU
– The abscissas (x-coordinate) of the points where graph intersects/crosses or
touches the x-axis are the required roots of the nonlinear equation f (x) = 0.
K
of the equation and the other on the right-hand side, that is, the given equa-
tion can be represented as f1 (x) = f2 (x). In this case, the abscissas of the
points of intersection of the graphs of y = f1 (x) and y = f2 (x) are the roots
of the nonlinear equation.
M
– The manual sketching the graphs of of the functions y = f (x) is not an
easy task. However, with the help of softwares like MATLAB, Maple, etc.
we can draw the graphs very easily.
ah
Example 1: Given x2 + 4x + 2 = 0. Locate the roots of this equation.
Sh
2
Graph of f(x)=x +4x+2
20
20
10
y=f(x)
15
y=f(x), y=g(x)
5
r.
10
0 5
0
D
-5
-5 -4 -3 -2 -1 0 1 2 3 -4 -3 -2 -1 0 1 2 3 4 5
x x
9
3 2
Graph of f(x)=x -3x +2
3 2
Graph of f(x)=x and g(x)=3x -2
30
0
25
-2
20
y=f(x)
10
-6
SU
-8
0
-10
-5
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3
x x
(a) Graph of f (x) = x3 − 3x2 + 2 (b) Graph of f (x) = x3 and g(x) = 3x2 − 2
K
Next Lecture: Root Location Methods for Nonlinear Equations: M-II.
Tabulation Method
M
ah
Sh
r.
D
10