Problem 84 The pressure drop p Nm2 in a tube can be calculat
Solution
The MATLAB code for finding pressure by given two methods is shown below followed by results
------------------------------------------------------------------------------------------------------------
x=[0 0.02 0.04 0.05 0.06 0.07 0.1];
r=[0.002 0.00135 0.00134 0.0016 0.00158 0.00142 0.002];
u=0.005;
Q=10^-5;
I=-8*u*Q./(pi*r.^4);
p=0 % implementing rectangular formula using for loop
for i=1:6
p= p+I(i)*(x(i+1)-x(i));
end
p1=0; % implementing trapezoidal formula using for loop
for i=1:6
p1= p1+(I(i)+I(i+1))*(x(i+1)-x(i))/2;
end
fprintf(\'\ the pressure calculated by rectangular rule is : %5.4f \ \',p);
fprintf(\'\ the pressure calculated by rectangular rule is : %5.4f \ \',p1);
------------------------------------------------------------------------------------------------------------------------
The results are
the pressure calculated by rectangular rule is : -2658.7689
the pressure calculated by rectangular rule is : -2582.8563
>>
