Fi it diff
Finite difference method(FDM)
th d(FDM)
y f (x )
y i 1
yi
y i 1
dy yi 1 yi
( ) lim
d
dx x 0 x
x h
x i 1 x i x i 1
dy y i y i 1 y i
dx h
i h
dy
y i y i 1 y i h ﺗﻔﺎﺿﻞ ﭘﻴﺸﺮو
dx i
dy
y i y i y i 1 h ﺗﻔﺎﺿﻞ ﭘﺴﺮو
dx i
1 dy
y i (y i 1 y i 1) h
2 dx i
ﺗﻔﺎﺿﻞ ﻣﺮﻛﺰي
d 2
y
2
h 2
h2
y i h yi
2 2
ﻣﺸﺘﻖ دوم
dx
d 2
y
2 y i y i 1 2y i y i 1 h
2
2
dx
2
d y dy
2
p(x ) q(x )y r(x )
dx dx
a x b
y (a) & y (b)
ba
h
n 1
a x0 x1 x2 xi xn xn1 b
dy y i 1 y i 1
( )i
dx 2h
d 2y y i 1 2y i y i 1
2
2
dx i h
y i 1 2y i y i 1
2
h
y i 1 y i 1
p(x i ) q(x i )y i r(x i )
2h
h
(1 p(x i ))y i 1 (2 h q(x i ))y i
2
2
h
(1 p(x i ))y i 1 h r(x i )
2
y 0 & y n 1
2 h2q(x1) 1
h
p(x1) 0 0
1
h
p(x 2)
2
2 h q(x2)
2
1
h
p(x 2)
y1
2
h
2
y2
1 p(x n )
0 2
0
h
0 0 2 h2q(x n 1) 1
2
p(x n 1)
yn1
0 0 0 1
h
p(x 3)
2 h2q(x n )
2
yn
h
h2r(x1) (1 p(x1))y 0
2
h2r(x 2)
h2r(x 3)
h2r(x n 1)
h
h2r(x n ) (1 p(x n ))y n 1
2
2
d y 4 dy 2 2 ln(x )
2
2 y 2
dx x dx x x
1 x 2
y (1) 0.5 & y (2) ln(2)
2 1
h 0.25 n 1 4
0.25
x0 1, x1 1.25, x 2 1.5, x 3 1.75, x 4 2
y 0 0.5 y1 ? y2 ? y 3 ? y 4 ln(2)
2 h2q(x1) 1
h
2
p(x1) 0 y1
h
1
h
2
p(x 2) 2 h2q(x2) 1
2
p(x 2)
y2
h
1 p(x 3) 2 h2q(x3)
0 2
y3
h
h2r(x1) (1 p(x1))y 0
2
h2r(x 2)
h
h2r(x 3) (1 p(x 3))y 4
2
y1 0.1769
0 1769
y2 00.4642
4642
y 3 0.6104
0 6104
Solution of PDE by
Fi it diff
Finite difference method(FDM)
th d(FDM)
2 2 2
A B C D(x , y , . , ) 0
x 2
x y y 2
x y
2
u 2
u
u 2 2 0
2
x y
x 2
u xi , y j 1 2u xi , y j u xi , y j 1
y 2
ui 1, j ui , j ui 1, j
yj
ui , j 1
y j 1
xi 1 xi xi 1
1
1
2u x , y 2 1 4 1 uij 0
h
1
2
2
2G
x 2
y 2
2
ab 2
x 2
y 2
2
2 1
2(a b ) a
2 2
b
2G 800 & b 10cm & a 20cm
h 4cm
4 8 12 15 18 20 19 0
y
2a
x
2b
1 1
(22 25 41) 2G
h2
1
2
(26 3 1 41) 2G 2
h
6
1
2
(2 10 7 5 46) 2G
h
1
2
(13 16 217 416) 2G
h
2 27 4 2 3
2
( 31) 2G
h 2 0.75 1.5
17
2 14 20 18 4
2
( 3.721) 2G
h 1.583 0.921 0.75 1.5
11
2 7 15 12 10
2
( 3.4311) 2G
h 2 2 0 375
0.375 1
1.291
291
7
2 3 11 8 6
2
( 3.2211) 2G
h 2 2 0.625 1.45