You are on page 1of 2

Dr.

Ahmed Al-Jamel
The ODE:

y 00( ) + c(x)y = f (x); x 2 [a; d]; 2 (0; 1); (1)


y(a) = y0 ; y 0 (a) = A: (2)

First we need to approximate the second derivative in (1) using one of the following formulas:
1. Forward di¤ erence approximation,

y(x + 2h) 2y(x + h) + y(x)


y 00 (x) = + O(h) (3)
h2
2. Centered di¤ erence approximation,

y(x + h) 2y(x) + y(x h)


y 00 (x) = + O(h2 ) (4)
h2
3. Five points centered approximation,

y(x + 2h) + 16y(x + h) 30y(x) + 16y(x h) y(x 2h)


y 00 (x) = + O(h4 ) (5)
12h2
Next, we need to approximate the fractional derivative in (1):
i
X
y ( ) (xi ) = wi;k y(xk ) + Error; (6)
k=0

where the error term is roughly of order h2 , or baybe better. Here the weights are given by
8
< ( 1)i (i 1)1 + i1 ; if k = 0;
n 1
wi;k := 2(i k) (i k 1)1 (i k + 1)1 ; if k = 1; :::; i 1;
(2 ):
1; if k = i:

if the derivative is given in the Riemann-Liouville sense, and


8
< ( 1)i (i 1)1 + i1 + ; 1
if k = 0;
n 1
wi;k := 2(i k) (i k 1)1 (i k + 1)1 ; if k = 1; :::; i 1;
(2 ):
1; if k = i:

in the case of Caputo sense.


Remark: I am not sure if this approximations work for an arbitrary interval, but for sure it works for the
interval [a; d] == [0; 1]. I will …gure out later once I have some time, I will inform you!.

Approximation Method
For an integer n > 2, we seek approximations to the exact solution y at a given set of points (called
mesh points) xi 2 (a; d), i = 1; :::; n 1. In this method, we will consider equidistance mesh points. Set
h = (d a)=n, then xi = x0 + ih, with x0 = a. Consequently, xi + jh = xi+j , j is a negative or positive
integer. Next we need the ODE (1) to be satis…ed at the mesh points xi , i.e.:

y 00 (xi ) + b(xi )y ( ) (xi ) + c(xi )y(xi ) = f (xi ); i = 1; :::; n 1:

For notations, let yi := y(xi ), bi := b(xi ), bi := b(xi ), and fi := f (xi ), then using the recipes (4) and (6), we
get
i
X
1 2
(y i+1 2y i + y i 1 ) + O(h ) + b i wi;k yk + O(h2 q ) + ci yi = fi :
h2
k=0

Let y~i be the approximations to yi , i.e. yi y~i , we get (after ignoring the error terms above)
i
X
1
(~
yi+1 2~
yi + y~i 1 ) + bi wi;k y~k + ci y~i = fi :
h2
k=0

1
Re-arranging the terms to get (just a simple algebra, I don’t have time to show all details)
i
X
y~i+1 = h2 fi + w
~i;k y~k ; i = 1; :::; n 1: (7)
k=0

where the new weights are given by


8
< bi h2 wi;k ci h2 + 2; if k = i;
w
~i;k := bi h2 wi;k 1; if k = i 1;
:
bi h2 wi;k ; else:

Notice that (7) de…nes a recurrence relation which needs two initial values, y~0 , and y~1 . But y~0 = y0 = y(a),
so what is needed is to approximate y~1 . From the de…nition of derivative, we have
y1 y0
A := y 0 (a) ;
h
and so (roughly speaking, take) y~1 = Ah + y0 .
Some remarks: Later...
Computer implementation: use your convinient CAS (Computer Algebra System). See the attached Mathe-
matica notebooks for examples and implementations.

You might also like