close all;
clear all;


g = 9.81;  %m/s^2
lbperkg = 2.2;
Nperlb = g/lbperkg;
mperin = 0.0254;

P = 300; %psi
Q = .1;   %L/s

%Convert to SI
P = P*Nperlb/(mperin^2);  %N/m^2
Q = Q/1000;  %m^3/s


Pin = P*Q;  %Watts

thdot = 100:5000;  %rpm
thdot = thdot*2*pi/60;  %rad/s

T = Q*P./thdot;

Pout = T.*thdot;

eff = Pout/Pin;

figure
plot(thdot*60/(2*pi),T);
xlabel('rpm');
ylabel('N-m');

figure
plot(thdot*60/(2*pi),Pin,thdot*60/(2*pi),Pout);
xlabel('rpm');
ylabel('Watts');
legend('Pin','Pout');

figure
plot(thdot*60/(2*pi),eff);
xlabel('rpm');
ylabel('efficiency');




