0% found this document useful (0 votes)
29 views

Assignment 5 Physics

The document describes code for solving various transport problems using the finite volume method. It includes code for 1) convection-diffusion with constant properties, 2) convection-diffusion with variable properties, 3) a hybrid scheme, and 4) a power law scheme. The code is tested for both positive and negative flow cases and numerical solutions are compared to analytical solutions. Graphs of numerical vs analytical solutions are presented.

Uploaded by

Pankaj Dohale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Assignment 5 Physics

The document describes code for solving various transport problems using the finite volume method. It includes code for 1) convection-diffusion with constant properties, 2) convection-diffusion with variable properties, 3) a hybrid scheme, and 4) a power law scheme. The code is tested for both positive and negative flow cases and numerical solutions are compared to analytical solutions. Graphs of numerical vs analytical solutions are presented.

Uploaded by

Pankaj Dohale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Assignment-5

1.) CDS

Code:
clc;
clear;
n=input("Number of control volumes = ");
l=input("Length = ");
den=input("Density = ");
gam=input("Diffusion Coefficient = ");
u=input("Velocity = ");
dx=l/n;
F=den*u;
D=gam/dx;
if u>0
phi(1)=1;
phi(n+2)=0;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=2:n+2
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
c(1)=1;
b(2)=2*D+F;
a(2)=D-(F/2);
d(2)=-(3*D+(F/2));
for i=3:n
b(i)=D+(F/2);
a(i)=D-(F/2);
d(i)=-2*D;
end
b(n+1)=D+(F/2);
a(n+1)=2*D-F;
d(n+1)=-(3*D-(F/2));
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
else
phi(1)=0;
phi(n+2)=1;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=1:n+1
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
b(2)=2*D+F;
a(2)=D-(F/2);
d(2)=-(3*D+(F/2));
for i=3:n
b(i)=D+(F/2);
a(i)=D-(F/2);
d(i)=-2*D;
end
b(n+1)=D+(F/2);
a(n+1)=2*D-F;
d(n+1)=-(3*D-(F/2));
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
c(n+2)=1;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
end

Input:
(a) Positive flow
(b) Negative flow
Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 0.9421 0.9387 0.1578 0.1505
3 0.3 0.8006 0.7963 0.4162 0.4100
4 0.5 0.6276 0.6224 0.6276 0.6224
5 0.7 0.4162 0.4100 0.8006 0.7963
6 0.9 0.1578 0.1505 0.9421 0.9387
7 1 0 0 1 1
Graph:
(a) Positive flow (Numerical vs Analytical)

(b) Negative flow (Numerical vs Analytical)

2.) UDS
Code:
clc;
clear;
n=input("Number of control volumes = ");
l=input("Length = ");
den=input("Density = ");
gam=input("Diffusion Coefficient = ");
u=input("Velocity = ");
dx=l/n;
F=den*u;
D=gam/dx;
if u>0
phi(1)=1;
phi(n+2)=0;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=2:n+2
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
c(1)=1;
b(2)=2*D+F;
a(2)=D;
d(2)=-(3*D+F);
for i=3:n
b(i)=D+F;
a(i)=D;
d(i)=-(2*D+F);
end
b(n+1)=D+F;
a(n+1)=2*D;
d(n+1)=-(3*D+F);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
else
phi(1)=0;
phi(n+2)=1;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=1:n+1
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
b(2)=2*D+F;
a(2)=D;
d(2)=-(3*D+F);
for i=3:n
b(i)=D+F;
a(i)=D;
d(i)=-(2*D+F);
end
b(n+1)=D+F;
a(n+1)=2*D;
d(n+1)=-(3*D+F);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
c(n+2)=1;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
end

Input:
(a) Positive flow

(b) Negative flow


Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 0.9337 0.9387 0.1496 0.1505
3 0.3 0.7879 0.7963 0.4190 0.4100
4 0.5 0.6130 0.6224 0.6345 0.6224
5 0.7 0.4030 0.4100 0.8069 0.7963
6 0.9 0.1511 0.1505 0.9448 0.9387
7 1 0 0 1 1
Graph:
(a) Positive flow (Numerical vs Analytical)

(b) Negative flow (Numerical vs Analytical)

3.) Hybrid
Code:
clc;
clear;
n=input("Number of control volumes = ");
l=input("Length = ");
den=input("Density = ");
gam=input("Diffusion Coefficient = ");
u=input("Velocity = ");
dx=l/n;
F=den*u;
D=gam/dx;
P=F/D;
if P>2
phi(1)=1;
phi(n+2)=0;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=2:n+2
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
c(1)=1;
b(2)=2*D+F;
a(2)=0;
d(2)=-(2*D+F);
for i=2:n+1
b(i)=max(F,D+F/2,0);
a(i)=max(-F,D-F/2,0);
d(i)=-(b(i)+a(i));
end
b(n+1)=F;
a(n+1)=2*D;
d(n+1)=-(F+2*D);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
else
phi(1)=0;
phi(n+2)=1;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=1:n+1
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
b(2)=2*D+F;
a(2)=0;
d(2)=-(2*D+F);
for i=2:n+1
b(i)=max(F,D+F/2,0);
a(i)=max(-F,D-F/2,0);
d(i)=-(b(i)+a(i));
end
b(n+1)=F;
a(n+1)=2*D;
d(n+1)=-(F+2*D);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
c(n+2)=1;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
end

Input:

(a) Positive flow


(b) Negative flow

Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 1 1 1 0.9179
3 0.3 1 1 1 0.9994
4 0.5 1 0.9999 1 0.9999
5 0.7 1 0.9994 1 1
6 0.9 0.7142 0.9179 1 1
7 1 0 0 1 1
Graph:

(a) Positive flow (Numerical vs Analytical)

(b) Negative flow (Numerical vs Analytical)


4.) Power law

Code:
clc;
clear;
n=input("Number of control volumes = ");
l=input("Length = ");
den=input("Density = ");
gam=input("Diffusion Coefficient = ");
u=input("Velocity = ");
dx=l/n;
F=den*u;
D=gam/dx;
P=F/D;
if P>10
phi(1)=1;
phi(n+2)=0;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=2:n+2
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
c(1)=1;
b(2)=2*D+F;
a(2)=0;
d(2)=-(2*D+F);
for i=3:n
b(i)=D*max(0,(1-0.1*abs(P)^5))+max(F,0);
a(i)=D*max(0,(1-0.1*abs(P)^5))+max(-F,0);
d(i)=-(b(i)+a(i));
end
b(n+1)=F;
a(n+1)=2*D;
d(n+1)=-(F+2*D);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
elseif P>0&&P<10
phi(1)=1;
phi(n+2)=0;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=2:n+2
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
c(1)=1;
b(2)=2*D+F;
a(2)=0;
d(2)=-(2*D+F);
for i=2:n+1
b(i)=max(F,D+F/2,0);
a(i)=max(-F,D-F/2,0);
d(i)=-(b(i)+a(i));
end
b(n+1)=F;
a(n+1)=2*D;
d(n+1)=-(F+2*D);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
else
phi(1)=0;
phi(n+2)=1;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp(len);
for i=1:n+1
c(i)=0;
end
d(1)=1;
b(1)=0;
a(1)=0;
b(2)=2*D+F;
a(2)=0;
d(2)=-(2*D+F);
for i=2:n+1
b(i)=D*max(0,(1-0.1*abs(P)^5))+max(F,0);
a(i)=D*max(0,(1-0.1*abs(P)^5))+max(-F,0);
d(i)=-(b(i)+a(i));
end
b(n+1)=F;
a(n+1)=2*D;
d(n+1)=-(F+2*D);
d(n+2)=1;
b(n+2)=0;
a(n+2)=0;
c(n+2)=1;
dd(1)=d(1);
cc(1)=c(1);
for i=2:n+2
dd(i)=d(i)-((b(i)*a(i-1))/dd(i-1));
cc(i)=c(i)-((b(i)*cc(i-1))/dd(i-1));
end
phi(n+2)=(cc(n+2)/dd(n+2));
for i=n+1:-1:1
phi(i)=(cc(i)-(a(i)*phi(i+1)))/dd(i);
end
disp(phi);
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp(sig);
plot((len,phi),(len,sig));
end

Input:

(a) Positive flow


(b) Negative flow

Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 1 1 1 0.9179
3 0.3 1 1 1 0.9994
4 0.5 1 0.9999 1 0.9999
5 0.7 1 0.9994 1 1
6 0.9 0.7142 0.9179 1 1
7 1 0 0 1 1
Graph:

(a) Positive flow (Numerical vs Analytical)

(b) Negative flow (Numerical vs Analytical)


5.) QUICK

Code:
clc;
clear;
n=input("Number of control volumes = ");
l=1;
den=1;
gam=0.1;
u=input("What is the velocity in m/s? ");
dx=l/n;
F=den*u;
D=gam/dx;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp("Lengths:", len);
if F>0
p(1)=1;
p(n+2)=0;
epsilon=0.00001;
N=0;
Error=1;
pm=p';
while Error>=epsilon
p_old=p;
N=N+1;
p(1)=1;
p(2)=((2*D+4*F/3)*p(1)+(D-F/3)*p(3))/(3*D+F);
p(3)=((D+9*F/8)*p(2)+(D-3*F/8)*p(4)-(F/3)*p(1))/(2*D+5*F/12);
for i=4:n
p(i)=((D+7*F/8)*p(i-1)+(D-3*F/8)*p(i+1)-(F/8)*p(i-2))/(2*D+3*F/8);
end
p(n+1)=((D+6*F/8)*p(n)+(2*D-F)*p(n+2)-(F/8)*p(n-1))/(3*D-3*F/8);
p(n+2)=0;
Error=max(abs(p-p_old));
pm=[pm;p'];
end
disp("Gauss Seidel Iterations", pm)
disp("Number of Iterations for Convergence:", N)
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp("Analytical Results:", sig);
plot((len,p),(len,sig));
else
p(1)=0;
p(n+2)=1;
epsilon=0.00001;
N=0;
Error=1;
pm=p';
while Error>=epsilon
p_old=p;
N=N+1;
p(1)=0;
p(2)=((2*D+4*F/3)*p(1)+(D-F/3)*p(3))/(3*D+F);
p(3)=((D+9*F/8)*p(2)+(D-3*F/8)*p(4)-(F/3)*p(1))/(2*D+5*F/12);
for i=4:n
p(i)=((D+7*F/8)*p(i-1)+(D-3*F/8)*p(i+1)-(F/8)*p(i-2))/(2*D+3*F/8);
end
p(n+1)=((D+6*F/8)*p(n)+(2*D-F)*p(n+2)-(F/8)*p(n-1))/(3*D-3*F/8);
p(n+2)=1;
Error=max(abs(p-p_old));
pm=[pm;p'];
end
disp("Gauss Seidel Iterations", pm)
disp("Number of Iterations for Convergence:", N)
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp("Analytical Results:", sig);
plot((len,p),(len,sig));
end
Input:
(a) Positive flow
(b) Negative flow
Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 0.9686 0.9653 0.2318 0.2096
3 0.3 0.8769 0.8713 0.5320 0.5218
4 0.5 0.7398 0.7310 0.7372 0.7310
5 0.7 0.5356 0.5218 0.8751 0.8713
6 0.9 0.2313 0.209 0.9680 0.9653
7 1 0 0 1 1

Graph:

(a) Positive flow (Numerical vs Analytical)


(b) Negative flow (Numerical vs Analytical)
6.) SOU

Code:
clc;
clear;
n=input("Number of control volumes = ");
l=1;
den=1;
gam=0.1;
u=input("What is the velocity in m/s? ");
dx=l/n;
F=den*u;
D=gam/dx;
len(1)=0;
len(2)=dx/2;
len(n+2)=l;
for i=3:n+1
len(i)=len(i-1)+dx;
end
disp("Lengths:", len);
if F>0
p(1)=1;
p(n+2)=0;
epsilon=0.00001;
N=0;
Error=1;
pm=p';
while Error>=epsilon
p_old=p;
N=N+1;
p(1)=1;
p(2)=((2*D+F/2)*p(1)+D*p(3))/(3*D+F/2);
p(3)=((D+2*F)*p(2)+D*p(4)-(F/2)*p(1))/(2*D+3*F/2);
for i=4:n
p(i)=((D+2*F)*p(i-1)+(D)*p(i+1)-(F/2)*p(i-2))/(2*D+3*F/2);
end
p(n+1)=((D+2*F)*p(n)+(2*D)*p(n+2)-(F/2)*p(n-1))/(3*D+3*F/2);
p(n+2)=0;
Error=max(abs(p-p_old));
pm=[pm;p'];
end
disp("Gauss Seidel Iterations", pm)
disp("Number of Iterations for Convergence:", N)
sig(1)=1;
sig(n+2)=0;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp("Analytical Results:", sig);
plot((len,p),(len,sig));
else
p(1)=0;
p(n+2)=1;
epsilon=0.00001;
N=0;
Error=1;
pm=p';
while Error>=epsilon
p_old=p;
N=N+1;
p(1)=0;
p(2)=((2*D+F/2)*p(1)+D*p(3))/(3*D+F/2);
p(3)=((D+2*F)*p(2)+D*p(4)-(F/2)*p(1))/(2*D+3*F/2);
for i=4:n
p(i)=((D+2*F)*p(i-1)+(D)*p(i+1)-(F/2)*p(i-2))/(2*D+3*F/2);
end
p(n+1)=((D+2*F)*p(n)+(2*D)*p(n+2)-(F/2)*p(n-1))/(3*D+3*F/2);
p(n+2)=1;
Error=max(abs(p-p_old));
pm=[pm;p'];
end
disp("Gauss Seidel Iterations", pm)
disp("Number of Iterations for Convergence:", N)
sig(1)=0;
sig(n+2)=1;
for i=2:n+1
sig(i)= ((%e^(den*u*len(i)/gam)-1)/(%e^(den*u*l/gam)-1))*(sig(n+2)-
sig(1))+sig(1);
end
disp("Analytical Results:", sig);
plot((len,p),(len,sig));
end
Input:
(a) Positive flow
(b) Negative flow
Output:
Sr ϕ(numerical) ϕ(analytical) ϕ(numerical) ϕ(analytical)
Length
No. (+ve) (+ve) (-ve) (-ve)
1 0 1 1 0 0
2 0.1 0.9578 0.9653 0.1964 0.2096
3 0.3 0.8651 0.8713 0.5499 0.5218
4 0.5 0.7253 0.7310 0.7306 0.7310
5 0.7 0.5201 0.5218 0.8736 0.8713
6 0.9 0.2197 0.209 0.9670 0.9653
7 1 0 0 1 1

Graph:

(a) Positive flow (Numerical vs Analytical)


(b) Negative flow (Numerical vs Analytical)

You might also like