Lecture 3 - Errors in Numerical Computation
Lecture 3 - Errors in Numerical Computation
Lecture 3 - Errors in Numerical Computation
Error
• For many engineering problems, we cannot obtain analytical solutions.
• Numerical methods yield approximate results, results that are close to the
analytical solution.
• If there's something that comes with an approximation, it's an error.
Error
•Analytical approach example:
Find the root of f(x)=x−5.
Analytical solution: f(x)=x−5=0, add +5 to both sides to get the answer x=5
•Numerical solution:
let's guess x=1: f(1)=1−5=−4. A negative number. Let's guess x=6:
f(6)=6−5=1. A positive number. The answer must be between 1 and 6.
•There are different types of errors
•Absolute error
•Relative Error
•Approximation error
Absolute Error
• Absolute error or Absolute true error is a measure of how far 'off’ an estimated
value is from a true value.
Absolute Error = Actual Value - Estimated Value
Relative Error
• You first need to determine absolute error to calculate relative error. Relative
error expresses how large the absolute error is compared with the total size of
the object you are measuring. Relative error is expressed as a fraction or is
multiplied by 100 and expressed as a percent.
Relative Error = (Absolute Error / Known Value)*100
Problem - Absolut Error and Relative Error
• But the problem with absolute error and relative error is that we
don't know what the exact true value is when we solve real life
problems. The true value will be known only when we deal with
functions that can be solved analytically (simple systems). So instead
we use Approximation error.
Approximation Error
The signs of these errors can be either positive or negative dependent on the
situation, so it is customary to take the absolute value of the error calculations as it’s
only the magnitude of error that we are concerned with.
Approximation Error
• There are 2 types of approximation error:
4
Round-off Error
Symmetric Round-off Error
• For example let x=72.918671 and y=18.63421 be two given numbers to be rounded to five
digit numbers. The normalized form x and y are 0.7291867*10^2 and 0.1863421*10^2. On
rounding these numbers to five digits we get 0.72919*10^2 and 0.18634*102 respectively.
x = 72.918671 = 0.7291867*10^2
= (0.72919+0.0000067)*10^2
= (0.72919 + 0.67*10^-5)*10^2
= (0.67 – 1) * 10^2-5
Round-off Error
Symmetric Round-off Error
y = 18.63421 = 0.1863421*10^2
= (0.18634+0.0000021)*10^2
= (0.18634 + 0.21*10^-5)*10^2
= (0.21) * 10^2-5