Professional Documents
Culture Documents
disp('*****************************************************************************
******************************');
f = input('frictional factor : ' );
L = input('lenth of the pipe in m : ');
d = input('dia of the pipe in m : ');
H = input('height in m : ');
g = input('acceleration due to gravity in m/s^2 : ');
p = input('give the value of power in mph : ');
w = 1000;
A=(pi*d^2)/4;
disp('*****************************************************************************
******************************')
syms Q;
eqn=p-(w*Q*(H-f*L*(Q/A)^2/(2*g*d))/75)==0;
solQ=solve(eqn,Q);
solQ=vpa(solQ);
disp(['required discharge is = ',num2str(Q) %'m^3/s]);
fprintf('*****************************************');
fprintf('\n');
%k=input('interest to continue ( 1 for continue & 0 for exit)');]
end
clear all
clc
%11.6
while k==1[
pressure_head= input('pressure head in m:');
%eff=(H-hf)/H;
eff=input('efficency:');
g=input('acceleration due to gravity in m/s^2:');
D=input('dia of the pipe in m : '); %m
f=input('frictional factor : ');
L=input('lenth of the pipe in m : '); %kms
P= input('give the value of power in kw : '); %KW
w=9810;
H=pressure_head/eff;
hf=H-pressure_head;
V=((2*g*D*hf)/(f*L))^0.5;
Q=(pi*D^2)/4*V;
n=P*1000/(w*Q*(H-hf));
N=round(n,0); %Number of pipes required
disp(['Number of pipes is = ',num2str(N)]);