Project

Taylor table

OBJECTIVE:

Computer higher order approximations using skewed and symmetric stencils.

DERIVATION:

1. Central difference:(i-2,i-1,i,i+1,i+2)

2. Skewed right sided difference:(i,i+1,i+2,i+3,i+4)

3. Skewed left sided difference:(i-4,i-3,i-2,i-1,i)

Taylor table expansion,

Now we are going to use this expansion in the central diffrence,skewed right sided difference,and skewed left sided difference

1. Central difference:

------------->(1)

From the above equation we obtain the followinig values

representing the above table in matrix format

We are solving the above matrix in matlab,to get the values of a,b,c,d,and e

a=-0.0833
b=1.3333
c=-2.5000
d=1.3333
e=-0.0833

Now we are substituting the values a,b,c,d,and e in the equation(1)

2. Skewed right sided difference:

-------------->(2)

From the above equation we obtain the followinig values

representing the above table in matrix format

We are solving the above matrix in matlab,to get the values of a,b,c,d,and e

a=2.916
b=-8.667
c=9.500
d=-4.667
e=0.916

Now we are substituting the values a,b,c,d,and e in the equation(2)

3. Skewed left sided difference:

------------->(3)

From the above equation we obtain the followinig values

representing the above table in matrix format

We are solving the above matrix in matlab,to get the values of a,b,c,d,and e

a=0.916
b=-4.667
c=9.500
d=-8.667
e=2.916

Now we are substituting the values a,b,c,d,and e in the equation(3)

MAIN PROGRAM:

clear all
close all
clc

% central diffrencing(x-2,x-1,x,x+1,x+2)
% skewed right order differencing(x,x+1,x+2,x+3,x+4)
% skewed left order differencing(x-4,x-3,x-2,x-1,x)
x=pi/3
dx=linspace(pi/40,pi/4000,50)
%analytical_function=exp(x)*cos(x)
analytical_derivative=-2*exp(x)*sin(x)
for i=1:length(dx)
    b(i)=(exp(x-(4*dx(i)))*cos(x-(4*dx(i))));
    c(i)=(exp(x-(3*dx(i)))*cos(x-(3*dx(i))));
    d(i)=(exp(x-(2*dx(i)))*cos(x-(2*dx(i))));
    e(i)=(exp(x-dx(i))*cos(x-dx(i)))
    f(i)=exp(x)*cos(x);
    g(i)=(exp(x+dx(i))*cos(x+dx(i)));
    h(i)=(exp(x+(2*dx(i)))*cos(x+(2*dx(i))));
    j(i)=(exp(x+(3*dx(i)))*cos(x+(3*dx(i))));
    k(i)=(exp(x+(4*dx(i)))*cos(x+(4*dx(i))));
    
    skewed_right(i)=(2.916*(f(i))-8.667*(g(i))+9.500*(h(i))-4.667*(j(i))+0.916*(k(i)))/(dx(i)^2);
     skewed_left(i)=(0.916*(b(i))-4.667*(c(i))+9.500*(d(i))-8.667*(e(i))+2.916*(f(i)))/(dx(i)^2);
     skewed_central(i)=(-0.0833*(d(i))+1.3333*(e(i))-2.5*(f(i))+1.3333*(g(i))-0.0833*(h(i)))/(dx(i)^2);
     
      %solving value of error
      skewed_right_error(i)=abs(skewed_right(i)-analytical_derivative)
      skewed_left_error(i)=abs(skewed_left(i)-analytical_derivative)
      skewed_central_error(i)=abs(skewed_central(i)-analytical_derivative)
end
%graph plot
loglog(dx,skewed_right_error,\'r\',\'linewidth\',2)
hold on
loglog(dx,skewed_left_error,\'g\',\'linewidth\',2)
hold on
loglog(dx,skewed_central_error,\'y\',\'linewidth\',2)
xlabel(\'dx\')
ylabel(\'error\')
legend(\'skewed_right_error\',\'skewed_left_error\',\'skewed_central_error\')

OUTPUT:

Skewness refers to distortion or asymmetry in a symmetrical bell curve, or normal distribution, in a set of data. If the curve is shifted to the left or to the right, it is said to be skewed. Skewness can be quantified as a representation of the extent to which a given distribution varies from a normal distribution.Skewness is basically defined as the geometric orientation of the mesh.

FDS and BDS require information on the right and left side points respectively. In FDS and BDS it solves the equation with 1st order approximation with 1st order derivatives and the central differencing scheme solve the equation with 2nd order approximation with 1st order derivative both are using same two-point information but CDS provides more accurate results.

Central skewed scheme are used where the information from source to sink and sink to source to solve the system with better accuracy with effective use of computational power so it is used in complicated flow problem.

Skewed central difference are second-order accurate average of right-skewed and left-skewed scheme with un-symmetric in grid.

https://drive.google.com/open?id=1zAeKMSCU9M5LSKRUMZlHC3kowYfYI20m

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.