Docsity

Example Of Differnce Operator-Numerical Analysis-Lecture Handouts, Lecture notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Numerical Analysis –MTH603 VU
© Copyright Virtual University of Pakistan 1
E
Ex
xa
am
mp
pl
le
e
1
1;
;
W
Wr
ri
it
te
e
f
fi
ir
rs
st
t
d
de
er
ri
iv
va
at
ti
iv
ve
e
o
of
f
f
f
(
(x
x)
)
a
at
t
x
x
=
=
0
0.
.1
1,
,
0
0.
.2
2,
,
0
0.
.3
3
w
wh
he
er
re
e
f
f
(
(x
x)
)
i
is
s
g
gi
iv
ve
en
n
b
by
y
X
X
0
0.
.1
1
0
0.
.2
2
0
0.
.3
3
0
0.
.4
4
0
0.
.5
5
0
0.
.6
6
F
F(
(x
x)
)
0
0.
.4
42
25
5
0
0.
.4
47
75
5
0
0.
.4
40
00
0
0
0.
.4
45
52
2
0
0.
.5
52
25
5
0
0.
.5
57
75
5
s
so
ol
lu
ut
ti
io
on
n;
;
U
Us
si
in
ng
g
t
th
he
e
t
tw
wo
o
p
po
oi
in
nt
t
e
eq
qu
ua
at
ti
io
on
n
w
we
e
h
ha
av
ve
e
(0.2) (0.1) 0.475 0.425 0.050
(0.1) 0.5.
0.1 0.1
ff
fh
−
−
′====
(0.3) (0.2) 0.400 0.475 0.075
(0.2) 0.75.
0.1 0.1
ff
fh
−
−−
′====−
(0.4) (0.3) 0.450 0.400 0.05
(0.3) 0.5.
0.1 0.1
ff
fh
−
−
′====
E
Ex
xa
am
mp
pl
le
e
2
2:
:
F
Fi
in
nd
d
t
th
he
e
2
2n
nd
d
d
de
er
ri
iv
va
at
ti
iv
ve
e
a
at
t
0
0.
.3
3,
,
0
0.
.4
4,
,
0
0.
.5
5
f
fo
or
r
t
th
he
e
f
fu
un
nc
ct
ti
io
on
n
g
gi
iv
ve
en
n
i
in
n
t
th
he
e
e
ex
xa
am
mp
pl
le
e
a
ab
bo
ov
ve
e.
.
S
So
ol
lu
ut
ti
io
on
n;
;
2
(0.4) 2 (0.3) (0.2) 0.125
(0.3) 12.5
0.01 0.01
fff
fh
−+
′′ ===
=
2
(0.5) 2 (0.4) (0.3) 0.025
(0.4) 2.5
0.01 0.01
fff
fh
−+
′′ ===
=
(0.6) 2 (0.5) (0.4) 0.075
(0.5) 7.5
0.01 0.01
fff
f−+
′′ ===
D
DI
IF
FF
FE
ER
RE
EN
NT
TI
IA
AT
TI
IO
ON
N
U
US
SI
IN
NG
G
I
IN
NT
TE
ER
RP
PO
OL
LA
AT
TI
IO
ON
N
I
If
f
t
th
he
e
g
gi
iv
ve
en
n
t
ta
ab
bu
ul
la
ar
r
f
fu
un
nc
ct
ti
io
on
n
y
y(
(x
x)
)
i
is
s
r
re
ea
as
so
on
na
ab
bl
ly
y
w
we
el
ll
l
a
ap
pp
pr
ro
ox
xi
im
ma
at
te
ed
d
b
by
y
a
a
p
po
ol
ly
yn
no
om
mi
ia
al
l
P
Pn
n(
(x
x)
)
o
of
f
d
de
eg
gr
re
ee
e
n
n,
,
i
it
t
i
is
s
h
ho
op
pe
ed
d
t
th
ha
at
t
t
th
he
e
r
re
es
su
ul
lt
t
o
of
f
()
n
Px
′
w
wi
il
ll
l
a
al
ls
so
o
s
sa
at
ti
is
sf
fa
ac
ct
to
or
ri
il
ly
y
a
ap
pp
pr
ro
ox
xi
im
ma
at
te
e
t
th
he
e
c
co
or
rr
re
es
sp
po
on
nd
di
in
ng
g
d
de
er
ri
iv
va
at
ti
iv
ve
e
o
of
f
y
y(
(x
x)
).
.
However, even if Pn(x) and y(x) coincide at the tabular points, their derivatives or slopes
may substantially differ at these points as is illustrated in the Figure below:
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Example Of Differnce Operator-Numerical Analysis-Lecture Handouts and more Lecture notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

ExExaammppllee 1 1;;

WrWriittee ffiirrsstt ddeerriivvaattiivvee ooff (^) ff ((xx)) aatt xx == 00..11,, 00..22,, 00..3 3

whwheerree ff ((xx)) iiss ggiivveenn bbyy

XX^0 0..1^1 0. 0 .2^2 0 0..3^3 0. 0 .4^4 0 0..5^5 0 0..6^6

FF((xx)) 0 0..4 42255 0. 0 .4 47755 0 0..4 40000 0. 0 .4 45522 0 0..5 52255 0 0..5 57755

so solluuttiioonn;;

UUssiinngg tthhee ttwwoo ppooiinntt eeqquuaattiioonn wwee hhaavvee

f f f h

f f f h

f f f h

Ex Exaammppllee 22::

FFiinndd tthhee 2^2

ndnd ddeerriivvaattiivvee^ atat 00..33,, 00..44,, 00..55 ffoorr tthhee ffuunnccttiioonn ggiivveenn iinn tthhee

eexxaammppllee aabboovvee..

So Solluuttiioonn;;

2

f f f f h

2

f f f f h

f f f f

DI DIFFFFEERREENNTTIIAATTIIOONN UUSSIINNGG IINNTTEERRPPOOLLAATTIIOONN

IIff tthhee ggiivveenn ttaabbuullaarr ffuunnccttiioonn yy((xx)) iiss rreeaassoonnaabbllyy wweellll aapppprrooxxiimmaatteedd bbyy aa ppoollyynnoommiiaall PP nn

((xx))

ooff ddeeggrreeee nn,, iitt iiss hhooppeedd tthhaatt tthhee rreessuulltt ooff^ Pn^ ′( )^ x wiwillll aallssoo ssaattiissffaaccttoorriillyy aapppprrooxxiimmaattee tthhee

ccoorrrreessppoonnddiinngg ddeerriivvaattiivvee ooff yy((xx))..

However, even if P n

( x ) and y ( x ) coincide at the tabular points, their derivatives or slopes

may substantially differ at these points as is illustrated in the Figure below:

FFoorr hhiigghheerr oorrddeerr ddeerriivvaattiivveess,, tthhee ddeevviiaattiioonnss mmaayy bbee ssttiillll wwoorrsstt.. HHoowweevveerr,, wwee ccaann eessttiimmaattee

tthhee eerrrroorr iinnvvoollvveedd iinn ssuucchh aann aapppprrooxxiimmaattiioonn..

FFoorr nnoonn--eeqquuiiddiissttaanntt ttaabbuullaarr ppaaiirrss ((xx ii

,, yy ii

),), ii == 00,, ……,, nn wwee ccaann ffiitt tthhee ddaattaa bbyy uussiinngg eeiitthheerr

LLaaggrraannggee’’ss inintteerrppoollaattiinngg ppoollyynnoommiiaall oorr byby uussiinngg NNeewwttoonn’’ss ddiivviiddeedd didiffffeerreennccee

iinntteerrppoollaattiinngg ppoollyynnoommiiaall.. IInn vviieeww ooff eeccoonnoommyy ooff ccoommppuuttaattiioonn,, wwee pprreeffeerr tthhee uussee ooff tthhee

llaatttteerr ppoollyynnoommiiaall..

TThhuuss,, rreeccaalllliinngg tthhee NNeewwttoonn’’ss ddiivviiddeedd ddiiffffeerreennccee iinntteerrppoollaattiinngg ppoollyynnoommiiaall ffoorr ffiittttiinngg tthhiiss

ddaattaa aass

0 0 0 1 0 1 0 1 2 1

0 1 0

( ) [ ] ( ) [ , ] ( )( ) [ , , ]

( ) [ , ,..., ]

n n

i n i

P x y x x x y x x x x x x y x x x

x x y x x x

−

=

AAssssuummiinngg tthhaatt PP nn

(x(x)) iiss aa ggoooodd aapppprrooxxiimmaattiioonn ttoo yy((xx)),, tthhee ppoollyynnoommiiaall aapppprrooxxiimmaattiioonn ttoo

ccaann bbee y ′( )^ x oobbttaaiinneedd bbyy ddiiffffeerreennttiiaattiinngg PP nn

((xx)).. UUssiinngg pprroodduucctt rruullee ooff ddiiffffeerreennttiiaattiioonn,,

tthhee ddeerriivvaattiivvee ooff tthhee pprroodduuccttss iinn PP nn

((xx)) ccaann bbee sseeeenn aass ffoolllloowwss::

Y( Y(xx))

OO XX^ ii^ XX

DeDevviiaattiioonn ooff ddeerriivvaattiivveess

PP (^) nn (x(x))

FFiinndd^ f^ ′(0.25)^ aanndd^ f^ ′(0.22)^ frfroomm tthhee ffoolllloowwiinngg ddaattaa uussiinngg tthhee mmeetthhoodd bbaasseedd oonn ddiivviiddeedd

ddiiffffeerreenncceess::

XX^0 0..1^155 0 0..2^211 0 0..2^233

YY==ff((xx))^0 0..1^1776611 0 0..3^3222222 0 0..3^3661177

XX^0 0..2^277 0. 0 .3^322 0. 0 .3^355

YY==ff((xx)) 0 0..4 4331144 0. 0 .5 5005511 0. 0 .5 5444411

So Solluuttiioonn WWee ffiirrsstt ccoonnssttrruucctt ddiivviiddeedd ddiiffffeerreennccee ttaabbllee ffoorr tthhee ggiivveenn ddaattaa aass sshhoowwnn

bbeellooww::

X Y 1

st D.D 2

nd D.D 3

rd D.D

UUssiinngg ddiivviiddeedd ddiiffffeerreennccee ffoorrmmuullaa

1 0 1 1

0

0 1

[ , , , ]

n n

i (^) i

n

x x x x x x

x x

y x x x

= −

=

ffrroomm aa qquuaaddrraattiicc ppoollyynnoommiiaall,, wwee hhaavvee

y ( ) x P 3 (^) ( ) x y x [ 0 (^) , x 1 (^) ] {( x x 1 (^) ) ( x x 0 (^) )} [ y x 0 (^) , x 1 (^) , x 2 ]

  • {( x − x 1 (^) )( x − x 2 (^) ) + ( x − x 0 (^) )( x − x 2 (^) ) + ( x − x 0 (^) )( x − x 1 (^) )} [ y x 0 (^) , x 1 (^) , x 2 (^) , x 3 ]

TThhuuss,, uussiinngg ffiirrsstt,, sseeccoonndd aanndd tthhiirrdd ddiiffffeerreenncceess ffrroomm tthhee ttaabbllee,, tthhee aabboovvee eeqquuaattiioonn yyiieellddss

y ′(0.25) = 2.4350 + (0.25 − 0.21) + (0.25 − 0.15)−

[(0.25 0.21)(0.25 0.23) (0.25 0.15)(0.25 0.23)

(0.25 0.15)(0.25 0.21)](15.625)

TThheerreeffoorree

(0.25) 2.4350 0.805 0.

f ′ = − +

SSiimmiillaarrllyy wwee ccaann sshhooww tthhaatt

f ′(0.22)^ =1.

Ex Exaammppllee

The following divided difference table is for y=1/x.use it to find

/ y (0.75) from a

quadratic polynomial

Fit.

Solution:

Using divided difference formula

1 0 1 1

0

0 1

[ , , , ]

n n

i (^) i

n

x x x x x x

x x

y x x x

= −

=

If we find the values for quadratic fit then we use the following formula,

3

0 1 1 0 0 1 2

1 2 0 2 0 1 0 1 2 3

[ , ] {( ) ( )} [ , , ]

{( )( ) ( )( ) ( )( )} [ , , , ]

y x P x

y x x x x x x y x x x

x x x x x x x x x x x x y x x x x

Thus, using first, second, third differences from the table, we get

3

3

y x P x x x

x x x x x x

Put x

y P

3

3

y P

y P

3

3

y P

y P

x Y=1/x 1

st divided

difference

nd divided

difference

rd divided

difference

.25 4.0000 -8.

.50 2.0000 -2.6668 10.

.75 1.3333 -1.3332 2.6672 (^) -14.

1.00 1.0000 -.8000 1.0664 -2.

1.25 .8000 -.5332 0.5336 -0.

1.50.