Project

Computer higher-order approximations using skewed and symmetric stencils- TAYLOR TABLE METHOD

Central Diffferencing

By refering stencil, hypothesis equation is as follows,

Solving 2nd order derivative using taylor series method. we consider i-2, i-1, i, i+1, i+2 iterations in order to create a taylor table.

We are trying to compute 2nd order derivative. Hence on righ side we should have only f\'\'(x) term. For last term oin coloumn 6 &7 we have taken as blank because we dont know if it is 0 or not.

By solving the matrix we get,

a+b+c+d+e=0

-2a-b+0+d+2e=0

2a+b/2+0+d/2+2e=1

-8a/6-b/6+0+d/6+8e/6=0

16a/24+b/24+0+d/24+16e/24=0

Simplify the table using [A][X]=[B],

By calculating we get,

a = -0.0833

b = 1.3333

c = -2.5000

d = 1.3333

e = -0.0833

From above values a = e, b = d.

Here subistitute above vallues in original hypothesis function :

Hence 4th order approximation of second order derivative is derived.

SKEWED LEFT SIDE

By refering stencil, hypothesis equation is as follows,

Solving 2nd order derivative using taylor series method. we consider i-5, i-4, i-3, i-2, i-1, i iterations in order to create a taylor table.

By solving the matrix we get,

a+b+c+d+e+g=0

-5a-4b-3c-2d-1e+0=0

25a/2+16b/2+9c/2+4d/2+e/2+0=1

-125a/6-64b/6-27c/6-8d/6-1e/6+0=0

625/24a+256b/24+81/24c+16/24d+1/24e+0=0

-3125a/12-1024b/12-243-c/120-32d/120-e/120+0=0

Simplify the table using [A][X]=[B]

By calculating we get,

a = -0.0833

b = 5.0833

c = -13

d = 17.8333

e = -12.8333

g = 3.7

Here subistitute above values in original hypothesis function :

SKEWED RIGHT SIDE

By refering stencil, hypothesis equation is as follows,

Solving 2nd order derivative using taylor series method. we consider i, i+1, i+2, i+3, i+4, i+5 iterations in order to create a taylor table.

By solving the matrix we get,

a+b+c+d+e+g=0

0+b+2c+3d+4e+5g=0

0+b/2+4b/2+9b/2+16b/2+25b/2=1

0+b/6+8c/6+27d/6+64e/6+125g/6=0

0+b/24+16c/24+81d/24+256e/24+625g/24=0

0+b/120+32c/120+243d/120+1024e/120+3125g/120=0

Simplify the table using [A][X]=[B]

By calculating we get,

a = 3.75

b = -12.8333

c = 17.8333

d = -13

e = 5.0833

g = -0.8333

Here subistitute above values in original hypothesis function :

PROGRAM :-

Program for 2nd order derivative for 4th order approximation for CENTRAL APPROXIMATION.

% function for 2nd order derivative for 4th order approximation.

function out = central_approximation(x,dx)

% analytical function
%f(x)= exp(x)*cos(x)
%f\'\'(x) = -(2*exp(x)*sin(x));

analytical_derivative = -(2*exp(x)*sin(x));

%central_difference=(-0.833*f(x-2*dx)+1.3333*f(x-dx)-2.5*f(x)+1.3333*f(x+dx)-0.0833*f((x+2)*dx)/(dx)^2

%fourth order approximation of second order derivative using central difference.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.