Week 2 Numbers and Errors - Spring 2022-23 INS 202E
Week 2 Numbers and Errors - Spring 2022-23 INS 202E
Week 2 Numbers and Errors - Spring 2022-23 INS 202E
Civil Engineering
2022-23 Spring
God gives the nuts, but he/she does not crack them.
Franz Kafka
There is a discrepancy or error between the analytical and numerical solutions, i.e.
Error = True Value – Approximate Value
Understanding the errors and error analysis is important for the effective use of
numerical methods!
So the question is: How accurate the data and the results are?
Main sources of error in modeling of a physical problem:
Errors not directly connected with the numerical methods
themselves:
• Due to mathematical modeling of a physical problem.
• Assumptions, simplications, linearization of non-linear processes,
From http://www.flinders.edu.au
Civil Engineering Faculty INS 202E Numerical Methods in Civil Engineering
Rounding-off rules
Answer: 6.76
From http://www.flinders.edu.au
Civil Engineering Faculty INS 202E Numerical Methods in Civil Engineering
Errors in numerical solutions
Bakioğlu (2011)
Civil Engineering Faculty INS 202E Numerical Methods in Civil Engineering
Truncation error
Truncation errrors occur when the numerical methods used for solving a
mathematical problem utilize an approximate mathematical procedure.
A simple example : For the numerical evaluation of sin(x), Taylor’s seris expansion can be used:
x 3 x 5 x 7 x 9 x 11
sin( x) = x − + − + − + ...
3! 5! 7! 9! 11!
The value of sin(π/6) can be determined exactly with the equation above if an infinite
number of terms are used.
The value can be approximated by using only a finite number of terms.
The difference between the true (exact) value and an approximate value is the
TRUNCATION ERROR (ETR)
The Taylor Series
Taylor theorem states that any smooth function can be approximated as
a polynomial
(The function f and its first n+1
derivatives are continuous on an interval
containing a and x)
Truncation error
x 3 x 5 x 7 x 9 x 11
sin( x) = x − + − + − + ...
3! 5! 7! 9! 11!
Π Π
If only the first term is used: sin( ) = = 0,5235988
6 6
The exact value : Π
sin( ) = 0,5
6
The truncation error ETR= 0,5 – 0,5235988 = - 0,0235988
3
Π
If only the two terms are used: Π Π 6
sin( ) = − = 0,4996742
6 6 3!
This quantity which is non dimensional and scale-independent indicates how large the error is
relative to the true solution.
If expressed in percentage, it is called true percent relative error.
The true error and the true relative error can not actually be
determined in problems that require numerical methods for their
solution since the true solution is not known. These error quantities can
be useful for evaluating the accuracy of different numerical methods.
This is done by using the numerical method for solving problems that
can be solved analytically and evaluating the true errors.
Since the true errors cannot, in most cases, be calculated, other means
are used for estimating the accuracy of a numerical solution. This
depends on the specific method and is discussed in more detail later. In
some methods the numerical error can be bounded, while in others an
estimate of the order of magnitude of the error is determined. In
practical applications, numerical solutions can also be compared to
experimental results, but it is important to remember that experimental
data have errors and uncertainties as well.
true error
True (fractional) relative error: True fractional relative error =
true value
true error
True percent relative error: εt = 100%
true value
approximate error
Approximate percent relative error: εa = 100%
approximation
Error definitions
However, if they are randomly distributed and tightly grouped around the prediction,
then the deviations might be considered negligible and the model deemed adequate.
Numerical approximations also introduce similar discrepancies into the analysis.
Again, the question is: How much the next error is present in our calculations and is
it tolerable?
Error
Represents both inaccuracy and imprecision of predictions
6. Trailing zeros in a whole number with the decimal shown are significant.
Placing a decimal at the end of a number is usually not done. For
example, "2300." indicates that the trailing zero is significant, there are
four significant figures in this value.
This rule provides the opportunity to change the number of significant figures in a
value by manipulating its form.
For example, let's try writing 4500 with three significant figures. By rule 5, 4500 has
two significant figures; its two trailing zeros are not significant. If we add a decimal to
the end, we have 4500., with four significant figures (by rule 6.) But by writing it in
scientific notation: 4.50 x 103, we create a three-significant-figure value.
The 0’s after the number in 0.3453000 matter because it shows the
precision of the instrument used in the measurement.
Any zeros used as a placeholder for the decimal place, like 0.0025,
are insignificant.
Civil Engineering Faculty MAT 202E Numerical Methods
Number Significant figures
• Significant Figures: Digits that carry meaning
0.00001845 contributing to its measurement resolution
0.0001845
• Zeros placed before other digits are not significant. Ex:
0.001845 0.046 2 sig. fig.
0.00001845 4
0.0001845 4
0.001845 4
4.53x104 3
45,300 4.530x104 4
4.5300x104 5