Lecture 2 Intro Error
Lecture 2 Intro Error
Email: jahir‐cse@sust.edu
1
Engineering Problem Solving
2
How do We Solve an Engineering Problem?
Problem Description
Mathematical Model
4
Mathematical Modeling
• A mathematical model is represented as a functional
relationship of the form
a = F/ m (1.3)
6
Observations
• . Formulation of Newton’s 2nd law has several characteristics
that are typical of mathematical models of the physical world:
7
Observations (2)
• Some mathematical models of physical phenomena may be
much more complex.
8
Determine the Terminal Velocity of a Free
Falling Body Near Earth’s Surface
• FÆ+ve: Accelerate
dv F
= • FÆ‐ve: decelerate
dt m • FÆ0: Velocity will remain at
a constant level
• FD: Downward pull of
F = FD + FU gravity
• FU: Upward force of air
FD = mg resistance
FU = −cv • C= drag coefficients
depends of the shape or
dv mg − cv surface roughness
= • g: gravitational constant 9.8
dt m 9
m/s2
Modeling of a Falling Parachutist
dv c
= g − v
dt m
• This is a differential equation and is written in terms of the
differential rate of change dv/dt of the variable that we
are interested in predicting.
• If the parachutist is initially at rest (v=0 at t=0), using
calculus
Independent variable
v (t ) =
gm
c
(1 − e − (c / m )t )
Dependent variable Parameters
Forcing function
10
Conclusions
• Analytical or exact solution because it satisfies the original
differential equation
• Unfortunately there are many mathematical models that can
not be solved exactly
• Only alternative is to develop the numerical solution that
approximates the exact solution
12
Fig 1.6
13
Approximations and
Round off Errors
Chapter 3
14
Approximations and Round‐Off Errors
17
Significant Figures
• Number of significant figures indicates precision. Significant digits of a
number are those that can be used with confidence, e.g., the number of
certain digits plus one estimated digit.
5.38 x 104 3
5.380 x 104 4
5.3800 x 104 5
Zeros are sometimes used to locate the decimal point not significant
figures.
0.00001753 4
0.0001753 4
0.001753 4
18
Error Definitions
True Value = Approximation + Error
True error
true error
True fractional relative error =
true value
true error
True percent relative error, ε t = ×100%
true value
19
• 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
answer a priori. Then
Approximate error
εa = ×100%
Approximation
• Iterative approach, example Newton’s method
20
• Use absolute value.
• Computations are repeated until stopping criterion is
satisfied.
ε s = (0.5 ×10(2-n) )%
you can be sure that the result is correct to at least n
significant figures.
21
Round‐off Errors
• Numbers such as p, e, or cannot 7 be expressed by a fixed
number of significant figures.
• Computers use a base‐2 representation, they cannot
precisely represent certain exact base‐10 numbers.
• Fractional quantities are typically represented in computer
using “floating point” form, e.g.,
Integer part
exponent
m.be
mantissa Base of the number system
used
22
Figure 3.3
23
Figure 3.4
24
Figure 3.5
25
156.78 0.15678x103 in a floating
point base‐10 system
1
= 0.029411765 Suppose only 4
34 decimal places to be stored
1
0.0294×10 0 ≤ m <1
2
• Normalized to remove the leading zeroes. Multiply
the mantissa by 10 and lower the exponent by 1
0.2941 x 10‐1
27
Chopping
Example:
π=3.14159265358 to be stored on a base-10 system
carrying 7 significant digits.
π=3.141592 chopping error εt=0.00000065
If rounded
π=3.141593 εt=0.00000035
• Some machines use chopping, because rounding adds
to the computational overhead. Since number of
significant figures is large enough, resulting chopping
error is negligible.
28