Professional Documents
Culture Documents
Numerical Methods - An Introduction
Numerical Methods - An Introduction
- An Introduction -
Chapter 1
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 systems properties or composition
Forcing functions: external influences acting upon the
system
Chapter 1
F=ma
F =net force acting on the body (N)
m=mass of the object (kg)
a =its acceleration (m/s2)
Chapter 1
dt m
F FD FU
FD mg
FU cv
dv mg cv
dt
m
6
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
gm
( c / m ) t
v(t )
1 e
c
Dependent variable
Forcing function
Chapter 1
Parameters
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
5.380 x 104
5.3800 x 104
3
4
5
Zeros are sometimes used to locate the decimal point not significant
figures.
0.00001753
0.0001753
0.001753
4
4
4
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
Approximate error
a
100%
Approximation
Iterative approach, example Newtons method
a s
s (0.5 10 (2-n) )%
you can be sure that the result is correct to at least n significant
figures.
Chapter 3
14
Round-off Errors
Numbers such as , e, or 7 cannot 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
m.be
mantissa
exponent
Base of the number system
used
Figure 3.3
Chapter16
3
Chapter 3
17
Figure 3.5
Chapter 3
18
156.78
10 system
1
Suppose only 4
0.029411765
34
decimal places to be stored
1
0
0.0294 10
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
Chapter19
3
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.
Chapter20
3
Chopping
Example:
=3.14159265358 to be stored on a base-10 system carrying 7
significant digits.
=3.141592 chopping error
et=0.00000065
If rounded
=3.141593
et=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.
Chapter 3
21
Figure 4.1
Chapter23
4
Example:
To get the cos(x) for small x:
x2 x4 x6
cos x 1
2! 4! 6!
If x=0.5
cos(0.5) =1-0.125+0.0026041-0.0000127+
=0.877582
From the supporting theory, for this series, the error is
no greater than the first omitted term.
x8
8!
for
x 0.5 0.0000001
24
Chapter 4
25
( xi 1 xi ) n Rn
n!
(xi+1-xi)= h
f
( ) ( n 1)
Rn
h
(n 1)!
( n 1)
26
27
Chapter28
4
Chapter 4
29
Figure 4.8
Chapter 4
30