Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lesson 2-Error Estimation

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

CHE 358

Numerical Methods
for Engineers

Dr. Martinson Addo Nartey


Credit: Dr. K. Mensah-Darkwa

Lesson-02
Error Estimation
Objectives

• Understanding the distinction between accuracy and precision.

• Learning how to quantify error.

• Learning how error estimates can be used to decide when to


terminate an iterative calculation.

• Understanding roundoff errors and recognize truncation


errors
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.

a) Inaccurate and imprecise


b) Accurate and imprecise
c) Inaccurate and precise
d) Accurate and precise
Accuracy and Precision
Inaccuracy (bias): systematic deviation from the truth.

Imprecision (uncertainty): magnitude of scatter.

(a) & (c) are equally biased


(b) & (d) are equally accurate, d is
more precise

Numerical methods should be sufficiently


accurate or unbiased to meet the requirements
of a particular problem. They also should be
precise enough for adequate design.
Error Definitions
• True error (Et): the difference between the true value and the
approximation.
𝐸𝑡 = 𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 − 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛

• Absolute error (|Et|): the absolute difference between the true


value and the approximation.

• True fractional relative error: the true error divided by the true
value.

• Relative error (𝜀 t): the true fractional relative error expressed as


a percentage.

𝜀𝑡 = 𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒−𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
×100%
Error Definitions
• The previous definitions of error relied on knowing a true value.
If that is not the case, approximations can be made to the error.

• The approximate percent relative error can be given as the


approximate error divided by the approximation, expressed as

𝜀𝑎 = 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑒𝑟𝑟𝑜𝑟
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 ×100%

• For iterative processes, the error can be approximated as the


difference in values between successive iterations.

𝜀𝑎 = 𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛−𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛


𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
×100%
Using Error Estimates
• Often, when performing calculations, we may not be concerned
with the sign of the error but are interested in whether the
absolute value of the percent relative error is lower than a
prespecified tolerance 𝜀 s.

• For such cases, the computation is repeated until 𝜀𝑎 < 𝜀𝑠

This relationship is referred to as a stopping criterion.


Using Error Estimates
It can be shown (Scarborough, 1966) that if the following criterion
is met, we can be assured that the result is correct to at least n
significant figures.

 s   0.5 10 2 n
%
Roundoff Errors
• Roundoff errors arise because digital computers cannot represent
some quantities exactly. There are two major facets of roundoff
errors involved in numerical calculations:

 Digital computers have size and precision limits on their


ability to represent numbers.
 Certain numerical manipulations are highly sensitive to
roundoff errors.
Truncation Errors
• Truncation errors are those that result from using an
approximation in place of an exact mathematical procedure.

• Example
Approximation to a derivative using a finite-difference equation:

dv v v(ti 1 )  v(ti )
 
dt t ti 1  ti
Truncation Errors
• Taylor theorem states that any smooth function can
approximated as a polynomial.
Examples
Given that 𝑓 𝑥 = 9𝑥 2 find 𝑓′(3) at ∆𝑥 = 0.3

Solution:
Approximate value= 56.7
Exact value = 54
Error = 2.7
Relative percentage error = 5%
Examples
Starting with e  1 estimate e
x 0.5
by adding terms one at a time.
Compute the true and approximate percent relative errors after each term
addition. Add terms until the absolute value of the approximate error  a
estimate
falls below a prespecified error criterion 𝜀𝑠 conforming to three
significant figures. Use the Maclaurin series expansion
Examples
Use Taylor series expansion with n= 0 to 6 to approximate f(x) = 𝑐𝑜𝑠𝑥 at
𝑥𝑖+1 = 𝜋/3 on the basis of the value of 𝑓 𝑥 and its derivative at 𝑥𝑖 =
𝜋/4

You might also like