Anda di halaman 1dari 25

Solution of ODE by

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 

 yi yi yi 1  (yi 1  yi)  (yi  yi 1)


2

 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)  
ba
h
n 1
a  x0  x1  x2    xi    xn  xn1  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)
yn1
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

y 0  0.5 & y 4  ln(2)


‫از ﺣﻞ دﺳﺘﮕﺎﻩ ﻓﻮق دارﻳﻢ‪:‬‬

‫‪y1  0.1769‬‬
‫‪0 1769‬‬
‫‪y2  0‬‬‫‪0.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

The second order derivative can be expressed


in finite difference form from the Taylor series expansion
f ''  xi  2 f ''' xi  3 f 4  i  4
f xi  h   f  xi   f xi h 
'
h  h  h
2 6 24

f xi  h   f  xi   f ' xi h 


f ''
 xi  h2 
f '''
 xi  h3 
f 4 
i  h 4
2 6 24
f xi  h   2 f xi   f xi  h  f 4    2
2
 f xi  
''
h
h 12
This can be expressed
p in a concise form :
u xi 1 , y j   2u xi , y j   u xi 1 , y j 
 u  xi , yi  
2

x 2
u xi , y j 1   2u xi , y j   u xi , y j 1 

y  2

 uij  2 ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j 


2 1
h
ui , j 1
y j 1

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
(22  25  41)  2G 
h2
1
2
(26  3  1  41)  2G  2
h
6
1
2
(2  10  7  5  46)  2G 
h

1
2
(13  16  217  416)  2G 
h
2 27 4 2 3
2
(    31)  2G 
h 2 0.75 1.5
17
2 14 20 18 4
2
(     3.721)  2G 
h 1.583 0.921 0.75 1.5
11
2 7 15 12 10
2
(     3.4311)  2G 
h 2 2 0 375
0.375 1
1.291
291

7
2 3 11 8 6
2
(     3.2211)  2G 
h 2 2 0.625 1.45

Anda mungkin juga menyukai