0% found this document useful (0 votes)
14 views28 pages

Lecture 2 Intro Error

Uploaded by

sakilviper18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views28 pages

Lecture 2 Intro Error

Uploaded by

sakilviper18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

CSE 209: Numerical Methods

Dr. M. Jahirul Islam


Associate Professor, CSE Dept., SUST

Email: jahir‐cse@sust.edu

1
Engineering Problem Solving

• Requires understanding of engineering systems


–By observation and experiment
–Theoretical analysis and generalization

• Computers are great tools, however, without


fundamental understanding of engineering
problems, they will be useless.

2
How do We Solve an Engineering Problem?

Problem Description

Mathematical Model

Solution of Mathematical Model

Using the Solution


Fig. 1.1

4
Mathematical Modeling
• A mathematical model is represented as a functional
relationship of the form

Dependent independent forcing


Variable =f variables, parameters, functions

• Dependent variable: Characteristic that usually reflects the


state of the system
• Independent variables: Dimensions such as time and space
along which the systems behavior is being determined
• Parameters: reflect the system’s properties or composition
• Forcing functions: external influences acting upon the system 5
Newton’s 2nd law of Motion
• States that “the time rate change of momentum of a body is
equal to the resulting force acting on it.”
• The model is formulated as
F = m a(1.2)
F=net force acting on the body (N)
m=mass of the object (kg)
a=its acceleration (m/s2)

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:

– It describes a natural process or system in mathematical


terms

– It represents an idealization and simplification of reality

– Finally, it yields reproducible results, consequently, can be


used for predictive purposes

7
Observations (2)
• Some mathematical models of physical phenomena may be
much more complex.

• Complex models may not be solved exactly or require more


sophisticated mathematical techniques than simple algebra
for their solution

– Example, modeling of a falling parachutist:

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

• New Value= Old Value + Slope* Step Size


⎡ c ⎤
v ( t i +1 ) = v ( t i ) + ⎢ g − v ( t i ) ⎥ ( t i +1 − t i )
⎣ m ⎦
dv i
v i +1 = vi + Δt Euler’s Method
dt
Conservation Laws and Engineering

• Conservation laws are the most important and


fundamental laws that are used in engineering.
Change = increases – decreases (1.13)
• Change implies changes with time (transient).
If the change is nonexistent (steady-state), Eq.
1.13 becomes
Increases =Decreases

12
Fig 1.6

• For steady-state incompressible fluid flow in pipes:


Flow in = Flow out
or
100 + 80 = 120 + Flow4
Flow4 = 60

13
Approximations and
Round off Errors
Chapter 3

14
Approximations and Round‐Off Errors

• For many engineering problems, we cannot obtain analytical


solutions.
• Numerical methods yield approximate results, results that are
close to the exact analytical solution. We cannot exactly
compute the errors associated with numerical methods.
– Only rarely given data are exact, since they originate from
measurements. Therefore there is probably error in the input
information.
– Algorithm itself usually introduces errors as well, e.g., unavoidable
round‐offs, etc …
– The output information will then contain error from both of these
sources.
• How confident we are in our approximate result?
• The question is “how much error is present in our calculation
and is it tolerable?”
15
Terminology
• Accuracy. How close is a computed or
measured value to the true value
• Precision (or reproducibility). How close is a
computed or measured value to previously
computed or measured values.
• Inaccuracy (or bias). A systematic deviation
from the actual value.
• Imprecision (or uncertainty). Magnitude of
scatter.
16
Fig. 3.2

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.

53,800 How many significant figures?

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

Et = True value – Approximation (+/‐)

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

Current approximation - Previous approximation


εa = ×100%
Current approximation
(+ / -)

20
• Use absolute value.
• Computations are repeated until stopping criterion is
satisfied.

ε a 〈ε s Pre-specified % tolerance based on


the knowledge of your solution

• If the following criterion is met

ε 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

Additional significant figure is


retained 26
1
≤ m <1
b
Therefore
for a base‐10 system 0.1 ≤m<1
for a base‐2 system 0.5 ≤m<1
• Floating point representation allows both fractions
and very large numbers to be expressed on the
computer. However,
– Floating point numbers take up more room.
– Take longer to process than integer numbers.
– Round‐off errors are introduced because mantissa holds
only a finite number of significant figures.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy