You are on page 1of 17

Numerical Methods

ETB/ETE/ETG/ETM/ETT 2092
Dr. N.A. Weerasekara
Dept of Civil and Environmental Technology

1
From last week lecture

2
Numerical Approach
𝑑𝑣 𝑐
=𝑔 − 𝑣
𝑑𝑡 𝑚
𝑔𝑚
𝑣(𝑡) = (1 − 𝑒 −(𝑐Τ𝑚)𝑡 )
𝑐

3
Example: parachutist of mass 68.1 kg jumps out of a stationary hot air
balloon. Use equation derived to compute velocity prior to
opening the chute. The drag coefficient is equal to 12.5 kg/s.

4
Errors
Numerical errors arise from the use of approximations to represent exact
mathematical operations and quantities.
𝑔𝑚
𝑣(𝑡) = (1 − 𝑒 −(𝑐Τ𝑚)𝑡 )
𝑐

Error

5
Approximations and Errors

6
Significant Figures
• The concept has been developed to formally
designate the reliability of a numerical value
• The significant digits of a number are those
that can be used with confidence
• They correspond to the number of certain
digits plus one estimated digit
• It is conventional to set the estimated digit
at one-half of the smallest scale division on
the measurement device
7
Significant Figures
0.00700
➢ Nonzero numbers are always significant
0.052
➢ In between zeros are always significant
370.
➢ Leading zeros are never significant
10.0
➢ Trailing zeros are sometimes significant
608.002

56,000
8
Accuracy and Precision
Accuracy: how closely a computed
or measured value agrees with the
true value.
Precision: how closely individual
computed or measured values agree
with each other.

9
Errors
Numerical errors arise from the use of approximations to represent exact
mathematical operations and quantities.

10
Types of Errors
There are two major forms of numerical error: round-off error and
truncation error

• Round-Off Error: originate from the fact that computers retain only a
fixed number of significant figures during a calculation

• Truncation Error: discrepancy introduced by the fact that numerical


methods may employ approximations to represent exact
mathematical operations and quantities
11
True Error
𝐸𝑡 = 𝑇𝑟𝑢𝑒 𝑉𝑎𝑙𝑢𝑒 − 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛

A shortcoming of this definition is that it takes no account of the order of


magnitude of the value under examination

𝑇𝑟𝑢𝑒 𝐸𝑟𝑟𝑜𝑟
True Percent Relative Error (𝜀𝑡 ) = %
𝑇𝑟𝑢𝑒 𝑉𝑎𝑙𝑢𝑒

12
Approximate Error
➢ For numerical methods, the true value will be known only when we
deal with functions that can be solved analytically
➢ When we investigate the theoretical behavior of a simple system, this
is usually the case.
➢ For real-world applications, we will obviously not know the true
answer a priori.
➢ In these cases, error is normalized by utilizing the best available
estimate of the true value.
13
Approximate Error
𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝐸𝑟𝑟𝑜𝑟
Approximate Percent Relative Error (𝜀𝑎 ) = %
𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛

𝐶𝑢𝑟𝑟𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 − 𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛


𝜀𝑎 = %
𝐶𝑢𝑟𝑟𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
Perform iterations till
𝜺𝒂 < 𝜺𝒔

𝜺𝒔 = 𝟎. 𝟓 × 𝟏𝟎𝟐−𝒏 %
14
Example 1: Student who measured the length of rivet and a bridge
came up with 9 and 9999 cm, respectively. If the true
values are 10 and 10000 cm, respectively, compute the
true error and true percent relative error for each case

15
Example 2: Use the Maclaurin series to determine the value of e0.5.
Make sure to employ the error criterion that ensures a
result is correct to at least three significant figures

𝑴𝒂𝒄𝒍𝒂𝒖𝒓𝒊𝒏 𝑺𝒆𝒓𝒊𝒆𝒔

𝑛
𝑥 𝑛
𝑒𝑥 ≅ ෍
𝑛!
𝑛=0

16
Example 3:

17

You might also like