Math 130 Numerical Solution To Ce Problems
Math 130 Numerical Solution To Ce Problems
Math 130 Numerical Solution To Ce Problems
PRELIM
I. INTRODUCTION
Numerical Methods yield approximate results, results that are close to the exact analytical
solution. We cannot exactly compute the errors associated with numerical methods.
- Only rarely given data are exact, since they originate from measurements. Therefore,
there is probably error in the input information.
- Algorithm itself usually introduces errors as well
- The output information will then contain error from both of these sources.
Definition of Terms:
Numerical errors arise from the use of approximation to represent exact mathematical operations
and quantities.
Round-off errors result when numbers having limited significant figures are used to represent
exact numbers
Truncation errors is the discrepancy introduced by the fact that numerical methods may employ
approximations to represent exact mathematical operations and quantities.
Accuracy refers to how closely a computed or measured value to the true value.
Precision refers to how closely individual computed or measured values to previously computed
or measured values
Inaccuracy (also called bias) is defined as systematic deviation from the actual (true) value.
Significant figure
Number of significant figures indicates precision. Significant digits of a number are those that
can be used with confidence
Relationship between the exact, or true, result and the approximation can be formulated
as:
Rearranging:
true error
True fractional relative error =
true value
For numerical methods, the true value will be known only when we deal with functions that can
be solved analytically (simple systems). In real world applications, we usually not know the true
answer a priori. For these situations, an alternative is to normalize the error using the best
available estimate of the true value. Then,
εa < εs
if the following criterion is met, we can assured that the result is correct to at least n significant
figures
εs = (0.5 x 102-n)%
Example 3.2. in mathematics, functions can be often represented by infinite series. Example, the
exponential function can be computed using:
𝑥2 𝑥3 𝑥𝑛
ⅇ𝑥 = 1 + 𝑥 + + …+
2 3! 𝑛!
Thus, as more terms are added in sequence, the approximation becomes a better and better
estimate of the true value ⅇ 𝑥 . Starting with the simplest version, ⅇ 𝑥 = 1, add terms one at a time
to estimate ⅇ 0.5 . after each term is added, compute the true and approximate percent relative
errors εa and εt, respectively. Note that the true value is ⅇ 0.5 = 1.648721… Add terms until the
absolute value of the approximate error estimate εa falls below a prespecified error criterion εs
conforming to three significant figures.
Solution:
ⅇ𝑥= 1 + x
Or for x = 0.5,
εt = 1.648721−1.5
1.648721
x 100%
= 9.02%
εa = 1.5−1
1.5
x 100% = 33.3%
Because εa is not less than the required value εs, we would continue the computation by adding
another term x2/2! And repeating the error calculations. The process is continued until εa < εs.
In summarized form,
Thus, after six terms are included, the approximate error falls below εs = 0.05% and the
computation is terminated. However, rather than three significant figures, the result is accurate to
five! That is, they ensure that the result is at least as good as they specify.
Fractional quantities are typically represented in computers using floating-point form. The
number is expressed as a fractional part, called mantissa or significand, and an integer part,
called an exponent or characteristic, as in
m•be
where m – mantissa, b = the base of the number system being used, and e = the exponent.
For instance, the number 156.78 could be represented as 0.15678 x 10 3 in a floating-point
base-10 system.
Floating-point representation allows both fractions and very large numbers to be expressed on
the computer.
Truncation errors are those that result from using an approximation in place of an exact
mathematical procedure.
Taylor series provides a means to predict a function value at one point in terms of the function
value and its derivatives at another point. A useful way to gain insight into Taylor series is to
build it term by term. For example,
This relationship, called the zero-order approximation indicates that the value of f at the new
point is the same as its value at the old point. This result makes intuitive sense because if xi and
xi+1 are close to each other, it is likely that the new value is probably similar to the old value.
However, if the function changes at all over the interval, additional terms of the Taylor series are
required to provide a better estimate. For example, the first-order approximation is developed by
adding another term to yield
The additional first-order term consists of a slope f (xi) multiplied by the distance between
xi and xi+1. Thus, the expression is now in the form of a straight line and is capable of
predicting an increase or decrease of the function between xi and xi+1.
Although eq. 4.3 can predict a change, it is exact only for a straight-line, or linear, trend.
Therefore, a second-order term is added to the series to capture some of the curvature that the
function might exhibit:
𝑓"(𝑥𝑖)
f (xi+1) >= f (xi) + f ‘(xi)(xi+1 - xi)+ (xi+1 - xi)2 (4.4)
2!
In a similar manner, additional terms can be included to develop the complete Taylor series
expansion: It is often convenient to simplify the Taylor series by defining a step size h = xi+1 - xi
and expressed as:
𝑓"(𝑥𝑖) 𝑓3 (𝑥𝑖) 𝑓𝑛 (𝑥𝑖)
f (xi+1) = f (xi) + f ‘(xi)h + h2 + h3 + …. hn + Rn (4.7)
2! 3! 𝑛!
𝑓(𝑛+1)(𝜉)
Rn = hn+1
(𝑛+1)!
𝜉 is a value of x that lies between xi and xi+1
Example:
PROBLEM: Use zero through fourth-order Taylor series expansions to approximate the function
From xi = 0 with h=1. That is, predict the function’s value at xi+1=1
SOLUTION: Because we are dealing with a known function, we can compute values for f(x)
between 0 and 1. The results (in figure 4.1) indicate that the function starts at f(0) = 1.2 and then
curves downward to f(1)=0.2. thus, the true value that we are trying to predict is 0.2
At x = 1.
For n=1, the first derivative must be determined and evaluated at x = 0:
𝑓"(𝑥𝑖)
Therefore, according to eq. 4.4 (f (xi+1) >= f (xi) + f ‘(xi)(xi+1 - xi) + (xi+1 - xi)2 )
2!
f (xi+1) = 1.2 - 0.25h - 0.5h2
and substituting h=1, f(1) = 0.45. the inclusion of the second derivative now adds some
downward curvature resulting in an improved estimate. The truncation errors is reduced further
to 0.2 – 0.45 = - 0.25
Additional terms would improve the approximation even more. In fact, the inclusion of the third
and the fourth derivatives results in exactly the same equation we started with:
𝑓5 (𝜉)
Rn = h5
5!
=0
V. ASSIGNMENT N0. 3
INSTRUCTION: Write your solution in 1 whole coupon bond (any size). Write your name,
course and section at the upper left; date at upper right and title (Assignment No. 1) at center top.
All solution must be hand written and submit it through LMS Moodle / Canvas Platform.
(Deadline will be 1st week after posting of this lesson)
1. Convert the following base-2 numbers to base-10: a) 101101, b) 101.011 and c) 0.01101
2. Convert the following base-8 numbers to base-10: 71,263 and 3.147
3. Use zero- through third-order Taylor series expansions to predict f (3) for
f (x) = 25x3 - 6x2 + 7x - 88
using a base point at x = 1. Compute the true percent relative error εt for each
approximation.