close all
clear all


pipe_size = 2;

D = [2.5 3.0 3.5]*.0254;
Dr = 2*.0254;


A = 0.25*pi*(D.^2-Dr^2);


V = 0:1/100:1; V = V';
F = 0:10:14000;

Q = V*A;
P = (1./A')*F;

figure('Position',[520   142   843   956],'PaperOrientation','portrait','PaperPositionMode','auto');
subplot(2,1,1)
plot(V,Q*1000*60/3.81)  %G/min
xlabel('Speed (m/s)');
ylabel('Flow Rate (GPM)');
legend('D = 2.5 in','D = 3.0 in','D = 3.5 in');
title('Flow and Pressures for a range of Bore Diameters;  Rod = 2 in');

subplot(2,1,2)
plot(F,P/6894)  %psi
xlabel('Force (N)');
ylabel('Pressure Differential (psi)');
legend('D = 2.5 in','D = 3.0 in','D = 3.5 in');


Disp = 4.9;  %cm^3/rev
Disp = Disp/(100^3);  %m^3/rev

N = Q/Disp;

figure('Position',[520   142   843   956],'PaperOrientation','portrait','PaperPositionMode','auto');
subplot(3,1,1)