Professional Documents
Culture Documents
CE 205: Numerical Methods: Dr. Tanvir Ahmed Assistant Professor
CE 205: Numerical Methods: Dr. Tanvir Ahmed Assistant Professor
Addition (+)
(+), Subtraction(
Subtraction(-),
) Division (/)
(/), Multiplication (*)
dv cd 2
= g− v
dt m
cd = drag coefficient
m = mass of the jumper
g = gravitational acceleration
dv cd 2 gm ⎛ gc ⎞
= g− v v(t) = tanh⎜ d
t⎟
dt m cd ⎝ m ⎠
Considering
m = 68.1 kg
cd = 0.25
0 25 kkg/m
/
dv Δv v(ti+1) − v(ti )
≈ =
dt Δt ti+1 − ti
dv cd 2
=g− v
dt m
cd
v(ti+1) = v(ti) + g − v(ti)2 (ti+1 − ti)
m
CE 205: Numerical Methods Dr. Tanvir Ahmed
Comparison with analytical solution
cd
v(ti+1) = v(ti) + g − v(ti)2 (ti+1 − ti)
m
•Systems
y of linear algebraic
g equations
q
•Interpolation and Curve-fitting
•Roots of Equations
•Numerical differentiation
•Numerical integration
•Initial value problems
•Two-point boundary value problems
Roundoff
R d ff errors arise
i b because di
digital
it l computers
t cannott
represent some quantities exactly.
remainder term is
of the order hn+1
Problem 2.
The Mclaurin series expansion for sinx is the following:
x3 x5 x7
sin x = x − + − + ...
3! 5! 7!
Starting from sinx = x, add terms one at a time to estimate sin(π/3).
Compute the true
true, approximate % relative errors at each step after
a new term is added.
CE 205: Numerical Methods Dr. Tanvir Ahmed
Truncation errors
f ( xi +1 ) = f ( xi ) + f ' ( xi )h +
f ''
( xi ) h2 +
f ( 3)
( xi ) h3 + L +
f (n)
(xi ) h n + R
n
2! 3! n!
The first order Taylor series is used to approximate the derivative
(e.g. the bungee jumper problem)
Forward:
( i+1 ) − f (x
f (x ( i)
f (x i ) =
'
+ O(h)
h
Backward:
f (x i ) − f (x i−1 )
f (x i ) =
'
+ O(h)
h
Centered
Centered:
f (x i+1 ) − f (x i−1 )
f (x i ) =
'
+ O(h 2 )
2h