PIPELINE STIMULATION LAB ANALYSIS notes for m.tech pipeline engineering Jawaharlal Nehru technological university Kakinada.
Download Lab observation here
https://mega.nz/#!i0cUTQzD!jOS89yB4wp9X5l9wqPgGvSsFD370KbSsl-OhIuPbY04
download record here
Aim: To solve the Q-Equations and obtain required flow rates
q(1)+q(2)-q(3)-0.06=0
[1469*(q(1)^1.974)]-[2432*(q(2)^1.927)]-15=0
[1469*(q(1)^1.974)]+[5646*(q(3)^1.971)]-40=0
Software required: Matlab
Matlab Code:
Clc
clear
syms q1 q2 q3
q=[q1 q2 q3];
f(1)=q(1)+q(2)-q(3)-0.06;
f(2)=[1469*(q(1)^1.974)]-[2432*(q(2)^1.927)]-15;
f(3)=[1469*(q(1)^1.974)]+[5646*(q(3)^1.971)]-40;
for i=1:3
for j=1:3
d(i,j)=diff(f(i),q(j));
end
end
x=0.1;
y=0.05;
z=0.09;
for i=1:10
D=subs(d,q,[x(i) y(i) z(i)]);
F=subs(f,q,[x(i) y(i) z(i)]);
Q=subs(q,q,[x(i) y(i) z(i)]);
X=inv(D)*F';
M=Q'-X;
x(i+1)=M(1);
y(i+1)=M(2);
z(i+1)=M(3);
end
fprintf('required flow rates are')
M1=eval(M)
Output:
Command Window
Required flow rates are
M1 =
0.1022
0.0200
0.0622
Aim: To solve the Q-Equations and obtain required flow rates
q(1)-q(2)-q(4)-0.06=0
q(2)-q(3)-0.08=0
q(3)+q(4)-q(5)-0.05=0
[196*(q(1)^1.819)]+[3520*(q(2)^1.955)]+[2380*(q(3)^1.895)]+[192*(q(5)^1.834)]-60=0
[748.56*(q(4)^1.892)]+[192*(q(5)^1.834)]-5=0
Software required: Matlab
Matlab Code:
clc
clear all
syms q1 q2 q3 q4 q5
q=[q1 q2 q3 q4 q5];
f(1)=q(1)-q(2)-q(4)-0.06;
f(2)=q(2)-q(3)-0.08;
f(3)=q(3)+q(4)-q(5)-0.05;
f(4)=[196*(q(1)^1.819)]+[3520*(q(2)^1.955)]+[2380*(q(3)^1.895)]+[192*(q(5)^1.834)]-60;
f(5)=[748.56*(q(4)^1.892)]+[192*(q(5)^1.834)]-5;
for i=1:5
for j=1:5
d(i,j)=diff(f(i),q(j));
end
end
x=0.2;
y=0.1;
z=0.02;
r=0.04;
s=0.01;
for i=1:10
D=subs(d,q,[x(i) y(i) z(i) r(i) s(i)]);
F=subs(f,q,[x(i) y(i) z(i) r(i) s(i)]);
Q=subs(q,q,[x(i) y(i) z(i) r(i) s(i)]);
X=inv(D)*F';
M=Q'-X;
x(i+1)=M(1);
y(i+1)=M(2);
z(i+1)=M(3);
r(i+1)=M(4);
s(i+1)=M(5);
end
fprintf('required flow rates are')
M1=eval(M)
Output:
Command Window
Required flow rates are
M1 =
0.2320
0.1056
0.0256
0.0664
0.0420
Aim: To solve the H-Equations and obtain required heads
[[(500-h1)/k(1)]^(1/n(1))]-[[(h1-h2)/k(2)]^(1/n(2))]-[[(h1-h3)/k(4)]^(1/n(4))]-0.5=0
[[(h1-h2)/k(2)]^(1/n(2))]-[[(h2-h4)/k(3)]^(1/n(3))]-0.35=0
[[(h1-h3)/k(4)]^(1/n(4))]-[[(h3-h4)/k(5)]^(1/n(5))]-0.5=0
[[(h2-h4)/k(3)]^(1/n(3))]+[[(h3-h4)/k(5)]^(1/n(5))]-[[(h4-h5)/k(6)]^(1/n(6))]-0.5=0
[[(h4-h5)/k(6)]^(1/n(6))]-0.25=0
Software required: Matlab
Matlab Code
clc
clear all
k=[5.6845 16.4967 24.3685 24.7450 19.0411 126.3843];
n=[1.9381 1.9185 1.8858 1.9185 1.8611 1.8970];
syms h1 h2 h3 h4 h5
h=[h1 h2 h3 h4 h5];
f(1)=[[(500-h1)/k(1)]^(1/n(1))]-[[(h1-h2)/k(2)]^(1/n(2))]-[[(h1-h3)/k(4)]^(1/n(4))]-0.5;
f(2)=[[(h1-h2)/k(2)]^(1/n(2))]-[[(h2-h4)/k(3)]^(1/n(3))]-0.35;
f(3)=[[(h1-h3)/k(4)]^(1/n(4))]-[[(h3-h4)/k(5)]^(1/n(5))]-0.5;
f(4)=[[(h2-h4)/k(3)]^(1/n(3))]+[[(h3-h4)/k(5)]^(1/n(5))]-[[(h4-h5)/k(6)]^(1/n(6))]-0.5;
f(5)=[[(h4-h5)/k(6)]^(1/n(6))]-0.25;
for i=1:5
for j=1:5
d(i,j)=diff(f(i),h(j));
end
end
p=476;
q=465;
r=460;
s=458;
t=450;
for i=1:10
D=subs(d,h,[p(i) q(i) r(i) s(i) t(i)]);
F=subs(f,h,[p(i) q(i) r(i) s(i) t(i)]);
H=subs(h,h,[p(i) q(i) r(i) s(i) t(i)]);
X=inv(D)*F';
M=H'-X;
p(i+1)=M(1);
q(i+1)=M(2);
r(i+1)=M(3);
s(i+1)=M(4);
t(i+1)=M(5);
end
fprintf('Required Heads are:')
M1=eval(M)
Output:
Command Window
Required flow rates are
M1 =
476.0566
464.7825
460.6951
458.9139
449.8025
Exp. No: Date
Aim: To solve the H-Equations and obtain required heads
[[(100-h1)/k(1)]^(1/n(1))]-[[(h1-h2)/k(2)]^(1/n(2))]-[[(h1-h3)/k(4)]^(1/n(4))]-1.0=0
[[(h1-h2)/k(2)]^(1/n(2))]+[[(h3-h2)/k(3)]^(1/n(3))]-1.5=0
[[(h1-h3)/k(4)]^(1/n(4))]-[[(h3-h2)/k(3)]^(1/n(3))]+[[(90-h3)/k(5)]^(1/n(5))]-0.8=0
Software required: Matlab
Matlab Code
clc
clear all
k=[7.59 9.63 48.6 39.7 16.5];
n=[1.936 1.901 1.882 1.768 1.935];
syms h1 h2 h3
h=[h1 h2 h3];
f(1)=[[(100-h1)/k(1)]^(1/n(1))]-[[(h1-h2)/k(2)]^(1/n(2))]-[[(h1-h3)/k(4)]^(1/n(4))]-1.0;
f(2)=[[(h1-h2)/k(2)]^(1/n(2))]+[[(h3-h2)/k(3)]^(1/n(3))]-1.5;
f(3)=[[(h1-h3)/k(4)]^(1/n(4))]-[[(h3-h2)/k(3)]^(1/n(3))]+[[(90-h3)/k(5)]^(1/n(5))]-0.8;
for i=1:3
for j=1:3
d(i,j)=diff(f(i),h(j));
end
end
p=68;
q=56;
r=67;
for i=1:10
D=subs(d,h,[p(i) q(i) r(i)]);
F=subs(f,h,[p(i) q(i) r(i)]);
H=subs(h,h,[p(i) q(i) r(i)]);
X=inv(D)*F';
M=H'-X;
p(i+1)=M(1);
q(i+1)=M(2);
r(i+1)=M(3);
end
fprintf('Required Heads are:')
M1=eval(M)
Output:
Command Window
Required flow rates are
M1 =
67.5171
56.7927
67.2361
Aim: To solve the Delta Q-Equations and obtain required Delta Qs are
K(1)*((q0(1)+dq(1)+dq(2))^n(1))-K(2)*((q0(2)-dq(1))^n(2))-ws1+ws2=0
K(1)*((q0(1)+dq(1)+dq(2))^n(1))+K(3)*((q0(3)+dq(2))^n(3))-ws1+ws3=0
Software required: Matlab
Matlab Code
clc
clear all
syms dq1 dq2
dq=[dq1 dq2];
K=[1469 2432 5646];
n=[1.974 1.927 1.971];
q0=[0.10 0.05 0.09];
ws1=100;
ws2=85;
ws3=60;
f(1)=K(1)*((q0(1)+dq(1)+dq(2))^n(1))-K(2)*((q0(2)-dq(1))^n(2))-ws1+ws2;
f(2)=K(1)*((q0(1)+dq(1)+dq(2))^n(1))+K(3)*((q0(3)+dq(2))^n(3))-ws1+ws3;
for i=1:2
for j=1:2
d(i,j)=diff(f(i),dq(j));
end
end
x=0;
y=0;
for i=1:10
D=subs(d,dq,[x(i) y(i)]);
F=subs(f,dq,[x(i) y(i)]);
Q=subs(dq,dq,[x(i) y(i)]);
X=inv(D)*F';
M=Q'-X;
x(i+1)=M(1);
y(i+1)=M(2);
end
fprintf('Required Delta Qs are:')
M1=eval(M)
Output:
Command Window
Required Delta Qs are:
M1 = 0.0300
-0.0278
Exp. No: Date
Aim: To solve the Delta Q-Equations and obtain required Delta Qs are
K(1)*((q0(1)+dq(1))^n(1))+K(2)*((q0(2)+dq(1)-dq(2))^n(2))-K(3)*((q0(3)-dq(1))^n(3))-K(4)*((q0(4)-dq(1))^n(4))=0;
-k(5)*((q0(5)dq(2))^n(5))+K(6)*((q0(6)+dq(2))*n(6))+K(7)*((q0(7)+dq(2))^
n(7))-K(2)*((q0(2)+dq(1)-dq(2))^n(2))=0
Software required: Matlab
Matlab Code
clc
clear all
syms dq1 dq2
dq=[dq1 dq2];
K=[1.793 0.497 4.108 2.717 0.755 2.722 1.628];
n=[1.929 1.938 1.921 1.945 1.917 1.942 1.878];
q0=[1.75 3.55 1.05 1.75 1.8 1.5 0.4];
ws1=100;
ws2=85;
ws3=60;
f(1)=K(1)*((q0(1)+dq(1))^n(1))+K(2)*((q0(2)+dq(1)-dq(2))^n(2))-K(3)*((q0(3)-dq(1))^n(3))-K(4)*((q0(4)-dq(1))^n(4));
f(2)=-K(5)*((q0(5)dq(2))^n(5))+K(6)*((q0(6)+dq(2))*n(6))+K(7)*((q0(7)+
dq(2))^n(7))-K(2)*((q0(2)+dq(1)-dq(2))^n(2));
for i=1:2
for j=1:2
d(i,j)=diff(f(i),dq(j));
end
end
x=0;
y=0;
for i=1:10
D=subs(d,dq,[x(i) y(i)]);
F=subs(f,dq,[x(i) y(i)]);
Q=subs(dq,dq,[x(i) y(i)]);
X=inv(D)*F';
M=Q'-X;
x(i+1)=M(1);
y(i+1)=M(2);
end
fprintf('Required Delta Qs are:')
M1=eval(M)
Output:
Command Window
Required Delta Qs are:
M1 =
0.0592
0.0071
Exp No: Date:
Aim: To solve the following Darcy Weisbach equation and Colebrook white equation by using ‘f solve’ command and obtain the required diameter and friction factor.
Software Required: Matlab
Matlab Code:
function output1=sowji(ig)
D=ig(1);
f=ig(2);
e=0.002/12;
hf=40;
Q=2;
g=32.2;
v=0.0000141;
L=3000;
A=pi*(D^2)/4;
eq1=(1/sqrt(f))-1.14+2*log10((e/D)+((7.3434728*v*D)/(Q*sqrt(f))));
eq2=hf-(f*L*(Q^2)/(D*2*g*A));
output1=[eq1 eq2];
end
Output:
Command Window
>> fsolve (@sowji,[0.2 0.6])
Equation solved:
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
ans =
0.4654 0.0170
Exp No:
Date:
Aim: To solve the following equations using ‘fsolve’ command
flow*(1-c)-rate=0
flow*(1-T)+(b*rate)=0
Software Required: Matlab
Matlab Code:
function output=prob(ig)
c=ig(1);
T=ig(2);
b=0.25;
g=30;
flow=25;
rate=c*exp(g*(1-(1/T)));
eq1=flow*(1-c)-rate;
eq2=flow*(1-T)+(b*rate);
output=[eq1;eq2];
end
Output:
Command Window
>> fsolve(@prob, [0.2 0.6])
Equation solved:
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
and =
0.9422 1.0144