COMPUTING HIGHER ORDER APPROXIMATIONS USING SKEWED AND SYMMETRIC STENCILS USING TAYLOR TABLE METHOD
AIM:
COMPUTING HIGHER ORDER APPROXIMATIONS USING SKEWED AND SYMMETRIC STENCILS
OBJECTIVE:
Deriving the 4th order approximations of the second order derivative for the following schemes.
- Central difference method
- Skewed right sided difference
- Skewed left sided difference
Writing a program to evaluate the second order derivative of the analytical function exp(x)*cos(x)
And comparing it with the 3 numerical approximations that are derived.
Plotting the comparison between the absolute errors between the above-mentioned schemes.
Plotting the comparison between the above schemes with FDS and BDS approximations.
Describing the Skewed schemes and how does they excel in comparison with Central difference schemes.
DERIVATION:
Considering a second order partial dericvative
`(del^2f(x))/(delx^2)`
Using Taylor table method for fourth order approximations for second order derrivative.
CENTRAL DIFFERENCE METHOD:
Considering `Deltax` as the grid size and `(i-2), (i-1), i, (i+1), (i+2)` as the stencils to derive the fourth order central differencing scheme`
Following will be the equation for Central difference approximation,
`(del^2f(x))/(delx^2) ~= (af(i-2) + bf(i-1) + cf(i) + df(i+1) + ef(i+2))/(delx^2)`
Using Taylor Series Expansion for each term and representing them in a Taylor table format.
`af(i-2)=af(i)-(a2Deltaxf\'(i))/(1!)+(a(2Deltax)^2f\'\'(i))/(2!)-(a(2Deltax)^3f\'\'\'(i))/(3!)+(a(2Deltax)^4f\'\'\'\'(i))/(4!)-(a(2Deltax)^5f\'\'\'\'\'(i))/(5!)+(a(2Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`bf(i-1)=bf(i)-(bDeltaxf\'(i))/(1!)+(bDeltax^2f\'\'(i))/(2!)-(bDeltax^3f\'\'\'(i))/(3!)+(bDeltax^4f\'\'\'\'(i))/(4!)-(bDeltax^5f\'\'\'\'\'(i))/(5!)+(bDeltax^6f\'\'\'\'\'\'(i))/(6!)`
`cf(i)=cf(i)`
`df(i+1)=df(i)+(dDeltaxf\'(i))/(1!)+(dDeltax^2f\'\'(i))/(2!)+(dDeltax^3f\'\'\'(i))/(3!)+(dDeltax^4f\'\'\'\'(i))/(4!)+(dDeltax^5f\'\'\'\'\'(i))/(5!)+(dDeltax^6f\'\'\'\'\'\'(i))/(6!)`
`ef(i+2)=ef(i)+(e2Deltaxf\'(i))/(1!)+(e(2Deltax)^2f\'\'(i))/(2!)+(e(2Deltax)^3f\'\'\'(i))/(3!)+(e(2Deltax)^4f\'\'\'\'(i))/(4!)+(e(2Deltax)^5f\'\'\'\'\'(i))/(5!)+(e(2Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
Taylor table for calculating the values of coefficients.
f(i) f\'(i)∆x f\'\'(i)∆x2 f\'\'\'(i)∆x3 f\'\'\'\'(i)∆x4 f\'\'\'\'\'(i)∆x5 f\'\'\'\'\'\'(i)∆x6
af(i-2) a -2a/1! 4a/2! -8a/3! 16a/4! -32a/5! 64a/6!
bf(i-1) b -b/1! b/2! -b/3! b/4! -b/5! b/6!
cf(i) c 0 0 0 0 0 0
df(i+1) d d/1! d/2! d/3! d/4! d/5! d/6!
ef(i+2) e 2e/1! 4e/2! 8e/3! 16e/4! 32e/5! 64e/6!
0 0 1 0 0 ? ?
a + b + c + d + e = 0
-2a/1! - 2b/1! + 0 + d/1! + 2e/1! = 0
4a/2! + b/2! + 0 + d/2! + 4e/2! = 0
-8a/3! - b/3! + 0 + d/3! + 8e/3! = 0
16a/4! + b/4! + 0 + d/4! + 16e/4! = 0
PROGRAM FOR SOLVING THE EQUATION FOR CENTRAL DIFFERENCE SCHEME USING TAYLOR TABLE METHOD FOR GETTING THE VALUES OF THE COEFFICIENTS.
clear all
clean all
clc
% Solving the equations for central differencing using taylor table for finding the values of a, b, c, d & e
% x = [a ; b ; c ; d ; e]
[A] = [1 1 1 1 1;
-2/factorial(1) -1/factorial(1) 0 1/factorial(1) 2/factorial(1);
4/factorial(2) 1/factorial(2) 0 1/factorial(2) 4/factorial(2);
-8/factorial(3) -1/factorial(3) 0 1/factorial(3) 8/factorial(3);
16/factorial(4) 1/factorial(4) 0 1/factorial(4) 16/factorial(4);]
[C]= inv(A);
[B] = [0;0;1;0;0]
x = C*B
OUTPUT:
>> % Solving the equations for central differencing using taylor table for finding the values of a, b, c, d & e
>> % x = [a ; b ; c ; d ; e]
>> [A] = [1 1 1 1 1;
-2/factorial(1) -1/factorial(1) 0 1/factorial(1) 2/factorial(1);
4/factorial(2) 1/factorial(2) 0 1/factorial(2) 4/factorial(2);
-8/factorial(3) -1/factorial(3) 0 1/factorial(3) 8/factorial(3);
16/factorial(4) 1/factorial(4) 0 1/factorial(4) 16/factorial(4);]
A =
1.00000 1.00000 1.00000 1.00000 1.00000
-2.00000 -1.00000 0.00000 1.00000 2.00000
2.00000 0.50000 0.00000 0.50000 2.00000
-1.33333 -0.16667 0.00000 0.16667 1.33333
0.66667 0.04167 0.00000 0.04167 0.66667
>>
>> [C]= inv(A);
>>
>> [B] = [0;0;1;0;0]
B =
0
0
1
0
0
>>
>> x = C*B
x =
-0.083333
1.333333
-2.500000
1.333333
-0.083333
>>
a = -0.083333
b = 1.333333
c = -2.5
d = 1.333333
e = -0.083333
Substituting the values in the equation of fourth order Central Difference approximation.
`(del^2f(x))/(delx^2) ~= (-0.083333f(i-2) + 1.333333f(i-1) -2.5f(i) + 1.333333f(i+1) -0.083333f(i+2))/(delx^2)`
FUNCTION FOR CENTRAL DIFFERENCE SCHEME
function cd_output = fun_central_differencing(x,dx)
%analytical function = exp(x)*cos(x)
% Second order derivative of analytical function f\'\'(x) = -2*exp(x)*sin(x)
analytical_derivative = -2*exp(x)*sin(x);
%fourth order approximation of second order derivative using central difference scheme
numerical_derivative = (-0.083333*exp(x-2*dx)*cos(x-2*dx) + 1.333333*exp(x-dx)*cos(x-dx) - 2.5*exp(x)*cos(x) +1.333333*exp(x+dx)*cos(x+dx) -0.083333*exp(x+2*dx)*cos(x+2*dx))/(dx)^2;
cd_output = abs(analytical_derivative - numerical_derivative);
endfunction
--------------------------------------------------------------------------------------------------
SKEWED RIGHT SIDED SCHEME:
Considering`Deltax`as the grid size and`i, (i+1), (i+2), (i+3), (i+4)`as the stencils to derive the fourth order skewed right sided scheme
Following will be the equation for skewed right sided approximation,
`(del^2f(x))/(delx^2) ~= (af(i) + bf(i+1) + cf(i+2) + df(i+3) + ef(i+4))/(delx^2)`
Using Taylor Series Expansion for each term and representing them in a Taylor table format.
`af(i)=af(i)`
`bf(i+1)=bf(i)+(bDeltaxf\'(i))/(1!)+(bDeltax^2f\'\'(i))/(2!)+(bDeltax^3f\'\'\'(i))/(3!)+(bDeltax^4f\'\'\'\'(i))/(4!)+(bDeltax^5f\'\'\'\'\'(i))/(5!)+(bDeltax^6f\'\'\'\'\'\'(i))/(6!)`
`cf(i+2)=cf(i)+(c2Deltaxf\'(i))/(1!)+(c(2Deltax)^2f\'\'(i))/(2!)+(c(2Deltax)^3f\'\'\'(i))/(3!)+(c(2Deltax)^4f\'\'\'\'(i))/(4!)+(c(2Deltax)^5f\'\'\'\'\'(i))/(5!)+(c(2Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`df(i+3)=df(i)+(d3Deltaxf\'(i))/(1!)+(d(3Deltax)^2f\'\'(i))/(2!)+(d(3Deltax)^3f\'\'\'(i))/(3!)+(d(3Deltax)^4f\'\'\'\'(i))/(4!)+(d(3Deltax)^5f\'\'\'\'\'(i))/(5!)+(d(3Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`ef(i+4)=ef(i)+(e4Deltaxf\'(i))/(1!)+(e(4Deltax)^2f\'\'(i))/(2!)+(e(4Deltax)^3f\'\'\'(i))/(3!)+(e(4Deltax)^4f\'\'\'\'(i))/(4!)+(e(4Deltax)^5f\'\'\'\'\'(i))/(5!)+(e(4Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
Taylor table for calculating the values of coefficients.
f(i) f\'(i)∆x f\'\'(i)∆x2 f\'\'\'(i)∆x3 f\'\'\'\'(i)∆x4 f\'\'\'\'\'(i)∆x5 f\'\'\'\'\'\'(i)∆x6
af(i) a 0 0 0 0 0 0
bf(i+1) b b/1! b/2! b/3! b/4! b/5! b/6!
cf(i+2) c 2c/1! 4c/2! 8c/3! 16c/4! 32c/5! 64c/6!
df(i+3) d 3d/1! 9d/2! 27d/3! 81d/4! 243d/5! 729d/6!
ef(i+4) e 4e/1! 16e/2! 48e/3! 256e/4! 1024e/5! 4096e/6!
0 0 1 0 0 ? ?
a + b + c + d + e = 0
0 + b/1! + 2c/1! + 3d/1! + 4e/1! = 0
0 + b/2! + 4c/2! + 9d/2! + 16e/2! = 0
0 + b/3! + 8c/3! + 27d/3! + 48e/3! = 0
0+ b/4! + 16c/4! + 81d/4! + 256e/4! = 0
PROGRAM FOR SOLVING THE EQUATION FOR SKEWED RIGHT SIDED DIFFERENCING USING TAYLOR TABLE METHOD FOR GETTING THE VALUES OF THE COEFFICIENTS.
clear all
clean all
clc
% Solving the equations for skewed right sided differencing using taylor table for finding the values of a, b, c, d & e
% x = [a ; b ; c ; d ; e]
[A] = [1 1 1 1 1;
0 1/factorial(1) 2/factorial(1) 3/factorial(1) 4/factorial(1);
0 1/factorial(2) 2^2/factorial(2) 3^2/factorial(2) 4^2/factorial(2);
0 1/factorial(3) 2^3/factorial(3) 3^3/factorial(3) 4^3/factorial(3);
0 1/factorial(4) 2^4/factorial(4) 3^4/factorial(4) 4^4/factorial(4);]
[C]= inv(A);
[B] = [0;0;1;0;0]
x = C*B
OUTPUT:
>> % Solving the equations for skewed right sided differencing using taylor table for finding the values of a, b, c, d & e
>> % x = [a ; b ; c ; d ; e]
>> [A] = [1 1 1 1 1;
0 1/factorial(1) 2/factorial(1) 3/factorial(1) 4/factorial(1);
0 1/factorial(2) 2^2/factorial(2) 3^2/factorial(2) 4^2/factorial(2);
0 1/factorial(3) 2^3/factorial(3) 3^3/factorial(3) 4^3/factorial(3);
0 1/factorial(4) 2^4/factorial(4) 3^4/factorial(4) 4^4/factorial(4);]
A =
1.00000 1.00000 1.00000 1.00000 1.00000
0.00000 1.00000 2.00000 3.00000 4.00000
0.00000 0.50000 2.00000 4.50000 8.00000
0.00000 0.16667 1.33333 4.50000 10.66667
0.00000 0.04167 0.66667 3.37500 10.66667
>>
>> [C]= inv(A);
>>
>> [B] = [0;0;1;0;0]
B =
0
0
1
0
0
>>
>> x = C*B
x =
2.91667
-8.66667
9.50000
-4.66667
0.91667
>>
a = 2.91667
b = -8.66667
c = 9.5
d = -4.66667
e = 0.91667
Substituting the values in the equation of fourth order skewed right sided approximation.
`(del^2f(x))/(delx^2) ~= (2.91667f(i)-8.66667f(i+1) +9.5f(i+2) -4.66667f(i+3) +0.91667f(i+4))/(delx^2)`
FUNCTION FOR SKEWED RIGHT SIDED SCHEME
function srs_output = fun_skewed_right_scheme(x,dx)
%analytical function = exp(x)*cos(x)
% Second order derivative of analytical function f\'\'(x) = -2*exp(x)*sin(x)
analytical_derivative = -2*exp(x)*sin(x);
%fourth order approximation of second order derivative using skewed right sided scheme
numerical_derivative = (2.91667*exp(x)*cos(x) -8.66667*exp(x+dx)*cos(x+dx) +9.5*exp(x+2*dx)*cos(x+2*dx) -4.66667*exp(x+3*dx)*cos(x+3*dx) +0.91667*exp(x+4*dx)*cos(x+4*dx))/(dx)^2;
srs_output = abs(analytical_derivative - numerical_derivative);
endfunction
--------------------------------------------------------------------------------------------------------
SKEWED LEFT SIDED SCHEME:
Considering `Deltax` as the grid size and`(i-4), (i-3), (i-2), (i-1), i`as the stencils to derive the fourth order skewed left sided scheme
Following will be the equation for skewed left sided approximation,
`(del^2f(x))/(delx^2) ~= (af(i-4) + bf(i-3) + cf(i-2) + df(i-1) + ef(i))/(delx^2)`
Using Taylor Series Expansion for each term and representing them in a Taylor table format.
`af(i)=af(i)-(a4Deltaxf\'(i))/(1!)+(a(4Deltax)^2f\'\'(i))/(2!)-(a(4Deltax)^3f\'\'\'(i))/(3!)+(a(4Deltax)^4f\'\'\'\'(i))/(4!)-(a(4Deltax)^5f\'\'\'\'\'(i))/(5!)+(a(4Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`bf(i3)=bf(i)-(b3Deltaxf\'(i))/(1!)+(b(3Deltax)^2f\'\'(i))/(2!)-(b(3Deltax)^3f\'\'\'(i))/(3!)+(b(3Deltax)^4f\'\'\'\'(i))/(4!)-(b(3Deltax)^5f\'\'\'\'\'(i))/(5!)+(b(3Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`cf(i-2)=cf(i)-(c2Deltaxf\'(i))/(1!)+(c(2Deltax)^2f\'\'(i))/(2!)-(c(2Deltax)^3f\'\'\'(i))/(3!)+(c(2Deltax)^4f\'\'\'\'(i))/(4!)-(c(2Deltax)^5f\'\'\'\'\'(i))/(5!)+(c(2Deltax)^6f\'\'\'\'\'\'(i))/(6!)`
`df(i-1)=df(i)-(dDeltaxf\'(i))/(1!)+(dDeltax^2f\'\'(i))/(2!)-(dDeltax^3f\'\'\'(i))/(3!)+(d(3Deltax)^4f\'\'\'\'(i))/(4!)-(dDeltax^5f\'\'\'\'\'(i))/(5!)+(dDeltax^6f\'\'\'\'\'\'(i))/(6!)`
`ef(i)=ef(i)`
Taylor table for calculating the values of coefficients.
f(i) f\'(i)∆x f\'\'(i)∆x2 f\'\'\'(i)∆x3 f\'\'\'\'(i)∆x4 f\'\'\'\'\'(i)∆x5 f\'\'\'\'\'\'(i)∆x6
af(i-4) a -4a/1! 16a/2! -48a/3! 256a/4! -1024a/5! 4096a/6!
bf(1-3) b -3b/1! 9b/2! -27b/3! 81 b/4! -243b/5! 729b/6!
cf(i-2) c -2c/1! 4c/2! -8c/3! 16c/4! -32c/5! 64c/6!
df(i11) d d/1! d/2! -d/3! d/4! -d/5! d/6!
ef(i) e 0 0 0 0 0 0
0 0 1 0 0 ? ?
a + b + c + d + e = 0
-4a/1! - 3b/1! - 2c/1! + d/1! + 0 = 0
16a/2! + 9b/2! + 4c/2! + d/2! + 0 = 0
-48a/3! - 27b/3! - 8c/3! - d/3! + 0 = 0
256a/4! + 81b/4! + 16c/4! + d/4! + 0 = 0
PROGRAM FOR SOLVING THE EQUATION FOR SKEWED LEFT SIDED DIFFERENCING USING TAYLOR TABLE METHOD FOR GETTING THE VALUES OF THE COEFFICIENTS.
clear all
clean all
clc
% Solving the equations for skewed left sided differencing using taylor table for finding the values of a, b, c, d & e
% x = [a ; b ; c ; d ; e]
[A] = [1 1 1 1 1;
-4/factorial(1) -3/factorial(1) -2/factorial(1) -1/factorial(1) 0;
4^2/factorial(2) 3^2/factorial(2) 2^2/factorial(2) 1/factorial(2) 0;
-4^3/factorial(3) -3^3/factorial(3) -2^3/factorial(3) -1/factorial(3) 0;
4^4/factorial(4) 3^4/factorial(4) 2^4/factorial(4) 1/factorial(4) 0;]
[C]= inv(A);
[B] = [0;0;1;0;0]
x = C*B
OUTPUT:
>> % Solving the equations for skewed left sided differencing using taylor table for finding the values of a, b, c, d & e
>> % x = [a ; b ; c ; d ; e]
>> [A] = [1 1 1 1 1;
-4/factorial(1) -3/factorial(1) -2/factorial(1) -1/factorial(1) 0;
4^2/factorial(2) 3^2/factorial(2) 2^2/factorial(2) 1/factorial(2) 0;
-4^3/factorial(3) -3^3/factorial(3) -2^3/factorial(3) -1/factorial(3) 0;
4^4/factorial(4) 3^4/factorial(4) 2^4/factorial(4) 1/factorial(4) 0;]
A =
1.00000 1.00000 1.00000 1.00000 1.00000
-4.00000 -3.00000 -2.00000 -1.00000 0.00000
8.00000 4.50000 2.00000 0.50000 0.00000
-10.66667 -4.50000 -1.33333 -0.16667 0.00000
10.66667 3.37500 0.66667 0.04167 0.00000
>>
>> [C]= inv(A);
>>
>> [B] = [0;0;1;0;0]
B =
0
0
1
0
0
>>
>> x = C*B
x =
0.91667
-4.66667
9.50000
-8.66667
2.91667
>>
a = 0.91667
b = -4.66667
c = 9.5
d = -8.66667
e = 2.91667
Substituting the values in the equation of fourth order skewed left sided approximation.
`(del^2f(x))/(delx^2) ~= (0.91667f(i-4)-4.66667f(i-3) +9.5f(i-2) -8.66667f(i-1) +2.91667f(i))/(delx^2)`
FUNCTION FOR SKEWED LEFT SIDED SCHEME
function sls_output = fun_skewed_left_scheme(x,dx)
%analytical function = exp(x)*cos(x)
% Second order derivative of analytical function f\'\'(x) = -2*exp(x)*sin(x)
analytical_derivative = -2*exp(x)*sin(x);
%fourth order approximation of second order derivative using skewed left sided scheme
numerical_derivative = (0.91667*exp(x-4*dx)*cos(x-4*dx) -4.66667*exp(x-3*dx)*cos(x-3*dx) +9.5*exp(x-2*dx)*cos(x-2*dx) -8.66667*exp(x-dx)*cos(x-dx) +2.91667*exp(x)*cos(x))/(dx)^2;
sls_output = abs(analytical_derivative - numerical_derivative);
endfunction
--------------------------------------------------------------------------------------------------------
FUNCTION FOR FORWARD DIFFERENCE APPROXIMATION(FDS)
function fds_output = fun_fds_approx(x,dx)
%analytical function f(x)= exp(x)*cos(x)
% Second order derivative of analytical function f\'\'(x) = -2*exp(x)*sin(x)
analytical_derivative = -2*exp(x)*sin(x);
%fourth order approximation of second order derivative using forward difference approximation
numerical_derivative = ((exp(x+dx)*cos(x+dx)) - (exp(x)*cos(x)))/(dx);
fds_output = abs(analytical_derivative - numerical_derivative);
endfunction
FUNCTION FOR BACKWARD DIFFERENCE APPROXIMATION(BDS)
function bds_output = fun_bds_approx(x,dx)
%analytical function f(x)= exp(x)*cos(x)
% Second order derivative of analytical function f\'\'(x) = -2*exp(x)*sin(x)
analytical_derivative = -2*exp(x)*sin(x);
%fourth order approximation of second order derivative using backward difference approximation
numerical_derivative = ((exp(x)*cos(x)) - (exp(x-dx)*cos(x-dx)))/(dx);
bds_output = abs(analytical_derivative - numerical_derivative);
endfunction
--------------------------------------------------------------------------------------------------------
MAIN PROGRAM:
clear all
close all
clc
%COMPUTING HIGHER ORDER APPROXIMATIONS USING SKEWED AND SYMMETRIC STENCILS
%FUNCTIONS DERIVED AND SOLVED USING TAYLOR TABLE METHOD
%ANALYTICAL FUNCTION GIVEN f(x) = exp(x)*cos(x)
%SECOND ORDER DERIVATIVE FOR THE ANALYTICAL FUNCTION f\'\'(x) = -2*exp(x)*sin(x)
x = pi/3; %INPUT VARIABLE
dx = linspace(pi/4, pi/2000, 30); %GRID SPACING
for i = 1:length(dx)
error_central_diff(i) = fun_central_differencing(x,dx(i));
error_skewed_right(i) = fun_skewed_right_scheme(x,dx(i));
error_skewed_left(i) = fun_skewed_left_scheme(x,dx(i));
error_forward_diff(i) = fun_fds_approx(x,dx(i));
error_backward_diff(i) = fun_bds_approx(x,dx(i));
endfor
% COMPARISON OF CENTRAL DIFFERENCE SCHEME, SKEWED RIGHT SIDED SCHEME AND SKEWED LEFT SIDED SCHEME
figure(1)
loglog(dx,error_central_diff,\'g\');
hold on
loglog(dx,error_skewed_right,\'b\');
hold on
loglog(dx,error_skewed_left,\'r\');
hold on
grid on
xlabel(\'dx-->\');
ylabel(\'error-->\');
legend(\'central difference\',\'right skewed\',\'left skewed\',\'location\',\'northwest\');
title(\'COMPARISON OF THREE FOURTH ORDER APPROXIMATION SCHEMES\');
saveas(1,\'figure(1).png\');
% COMPARISON OF CENTRAL DIFFERENCE SCHEME, SKEWED RIGHT SIDED SCHEME AND SKEWED LEFT SIDED SCHEME WITH FORWARD DIFFERENCE AND BACKWARD DIFFERENCE APPROXIMATION
figure(2)
loglog(dx,error_central_diff,\'g\');
hold on
loglog(dx,error_skewed_right,\'b\');
hold on
loglog(dx,error_skewed_left,\'r\');
hold on
loglog(dx,error_backward_diff,\'marker\',\'d\',\'markerfacecolor\',\'b\');
hold on
loglog(dx,error_forward_diff,\'marker\',\'o\',\'markerfacecolor\',\'r\');
hold off
grid on
xlabel(\'dx-->\');
ylabel(\'error-->\');
legend(\'central difference\',\'right skewed\',\'left skewed\',\'backward diff\',\'forward diff\',\'location\',\'west\');
title(\'COMPARISON OF THREE FOURTH ORDER APPROXIMATION SCHEMES WITH FDS & BDS\');
saveas(2,\'figure(2).png\');
OUTPUT PLOT FOR COMPARISON OF CENTRAL DIFFERENCE SCHEME, SKEWED RIGHT SIDED SCHEME AND SKEWED LEFT SIDED SCHEME.
1. From the above plot it is observed that the error in Central difference scheme is significantly less as compared to skewed left sided scheme followed by the skewed right sided scheme.
2. The Advantage of Skewed Schemes over Central difference is that they can be applied in any region within or on the boundary of the domain unlike the central difference scheme in which it needs symmetrical stencils on each side of the point considered.
OUTPUT PLOT FOR COMPARISON OF CENTRAL DIFFERENCE SCHEME, SKEWED RIGHT SIDED SCHEME AND SKEWED LEFT SIDED SCHEME WITH FDS AND BDS.
1. The above plot shows that the error observed in FDS & BDS are higher compared to those of Central difference scheme, skewed right sided scheme and skewed left sided scheme.
2. This phenomena occurs because either in FDS or BDS only two consecutive stencils are considered respectively, whereas in the fourth order approximation using the three mentioned schemes allows us to consider number of stencils, thus giving us least possible errors. This happens since more information can be collected from the adjacent points/stencils resulting in high accuracy of the solution as compared to FDS & BDS.