You are on page 1of 23

# ENGINEERING MATHEMATICS 4

(BWM 30603)

## Lecture Module 5: Numerical Differentiation

Universiti Tun Hussein Onn Malaysia

Topics

First derivative
Basic first derivative
(2 point forward, 2 point backward, 3 point central)
Other first derivative formulations
(3 point forward, 3 point backward, 5 point)

Second derivative
3 point central
5 point

## Lecture Module 5 BWM 30603 2

First derivative
Using Taylor's series

## Taylor series expansion

h2 h3 hn n
f ( x+h)= f ( x)+h f ' ( x)+ f ' ' ( x)+ f ' ' ' ( x)+ + f ( x)
2! 3! n!

Considering only the first derivative (do not have higher derivatives or very small)

f ( x+h) f ( x)
f ' ( x)=
h

First derivative
2-point forward

## y The derivative can be expressed as

y ( x+h)
dy
y ' ( x)=
dx
y ( x) dy

dx y( x+h) y ( x)
y ' ( x)=
h
h
x
x ( x+h) Forward : using the point data
after the the point of concern

First derivative
2-point backward

## y The derivative can be expressed as

dy
y ' ( x)=
dx
y ( x)

y ( xh) dy y( x) y( xh)
y ' ( x)=
dx h
h
x
( xh) x Backward : using the point data
before the the point of concern

First derivative
3-point central

y ( x+h)
dy
y ' ( x)=
dx
y ( x) dy

## y ( xh) y( x+h) y ( xh)

y ' ( x)=
dx 2h
h h
x
( xh) x ( x+h) Central : using the points data
before and after
the the point of concern

## Lecture Module 5 BWM 30603 6

Example 5-1
The motion of an particle follows an exponential function s (t)=e t

a. Calculate the velocity of the particle when the time t = 1 as you have learned in
Dynamics

## b. Do the same thing, but the derivative must be conducted using

Numerical differential
> 2-point forward
> 2-point backward
> 3-point central

motion s (t)=e t
ds
velocity v(t)=
dt

## Since in mathematics d t t If the function is complicated

e =e perhaps you will find it
dt
difficult to derive mathematically
t
then velocity v(t)=e

v(1)=2.7182818285

## Lecture Module 5 BWM 30603 8

2-point forward Using small increment h=105

## Lecture Module 5 BWM 30603 9

2-point backward Using small increment h=105

## Lecture Module 5 BWM 30603 10

3-point central Using small increment h=105

## Lecture Module 5 BWM 30603 11

First derivative
other higher formulations

## 3-point forward difference

y ( x+2 h) + 4 y ( x+h) 3 y ( x)
y ' ( x)=
2h

## 3-point backward difference

3 y ( x) 4 y( xh) + y( x2 h)
y ' ( x)=
2h

5-point difference

y ' ( x)=
12 h

## Lecture Module 5 BWM 30603 12

Second Derivative
3-point central difference

y ( x+h) 2 y ( x) + y( xh)
y ' ' ( x)=
h2

5-point difference

y ' ' ( x)=
12 h2

## Lecture Module 5 BWM 30603 13

Example 5-2
The displacement of a particle which moves along the s-axis follows a motion equation

s (t)=(2+3t )e 0.5 t

## Find the velocity of the particle at 10 seconds and 20 seconds

Use the following numerical derivative methods:
> 2 point forward difference
> 2 point backward difference
> 3 point central difference

## Lecture Module 5 BWM 30603 14

Lecture Module 5 BWM 30603 15
Lecture Module 5 BWM 30603 16
Lecture Module 5 BWM 30603 17
Lecture Module 5 BWM 30603 18
Example 5-3
The displacement of a particle which moves along the s-axis follows a motion equation

s (t)=(2+3t )e 0.5 t

## Find the acceleration of the particle at 10 seconds and 20 seconds

Use the following numerical derivative methods:
> 3 point central difference
> 5 point difference

## Lecture Module 5 BWM 30603 19

Lecture Module 5 BWM 30603 20
Lecture Module 5 BWM 30603 21
Lecture Module 5 BWM 30603 22
Lecture Module 5 BWM 30603 23