Mathematical Modeling
Mathematical Modeling
Mathematical Modeling
March 2, 2023
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 1 / 14
Approximations and Round-Off Errors
The error that is produced when a calculator or computer is used to
perform real number calculations is called round-off error.
Numerical round-off errors are directly related to the manner in which
numbers are stored in a computer.
Numbers on the computer are represented with a binary, or base-2,
system.
Real numbers are typically represented in computers using floating-
point form.
Floating point number is stored in computer in following manner: The
first bit is reserved for the sign, the next series of bits for the integer
part,called an exponent or characteristic and the last bits for the
fractional part, called a mantissa or significand.
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 2 / 14
In 64-bit (binary digit) representation, the first bit is a sign indicator,
denoted s, followed by an 11-bit exponent, c, and a 52-bit binary
fraction, f . The base for the exponent is 2.
The floating-point number is of the form
(−1)s 2c−1023 (1 + f )
Example
The machine number
0100000000111011100100010000000000000000000000000000000000000000
27.56640625
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 3 / 14
The smallest normalized positive number that can be represented has
s = 0, c = 1, and f = 0 and is equivalent to
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 4 / 14
Machine Numbers
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 5 / 14
chopping: chop off the digits dk+1 dk+2 . . . to produce the floating-
point form
fl(y ) = 0.d1 d2 . . . dk × 10n .
rounding: when dk+1 ≥ 5, add 1 to dk to obtain fl(y ); when dk+1 < 5,
chop off all but the first k digits. Here the floating-point has the form
Example
Determine the five-digit (a) chopping and (b) rounding values of the
irrational number π.
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 6 / 14
Measuring Errors
p − p∗
≤ 5 × 10−t
p
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 7 / 14
Finite-Digit Arithmetic
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 9 / 14
Example
The quadratic formula states that the roots of ax 2 + bx + c = 0, when
a 6= 0, are
√ √
−b + b 2 − 4ac −b − b 2 − 4ac
x1 = , x2 =
2a 2a
Consider this formula applied to the equation x 2 + 62.10x + 1 = 0, whose
roots are approximately x1 = −0.01610723 and x2 = −62.08390.
(a) Use quadratic formula and four-digit rounding arithmetic to find the
roots.
(b) Find an equivalent formula for the quadratic formula to avoid loss of
significance.
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 10 / 14
Truncation Errors and the Taylor Series
Truncation errors are the errors that result from using approximation
in place of an exact mathematcal procedure.
The mathematical formulation that is used extensively in numerical
methods to approximate functions is the Taylor series.
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 11 / 14
Theorem (Taylor’s Theorem)
Suppose f ∈ C n [a, b], that f (n+1) exists on [a, b], and x0 ∈ [a, b]. For
every x ∈ [a, b], there exists a number ξ(x ) between x0 and x with
f (x ) = Pn (x ) + Rn (x ),
where
f 00 (x0 ) f (n)
Pn (x ) = f (x0 ) + f 0 (x0 )(x − x0 ) + (x − x0 )2 + · · · + (x0 )(x − x0 )n
2! n!
n
X f (k) (x0 )
= (x − x0 )k
k=0
k!
and
f (n+1) (ξ(x ))
Rn (x ) = (x − x0 )n+1
(n + 1)!
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 13 / 14
References
Department of Mathematics, UoM Modeling, Computers, and Error Analysis March 2, 2023 14 / 14