clear all
close all

P = 100:200:500;  %psi
Q = .01:.01:.35;  %L/s

figure
plot(Q,4.45*P'*Q/1000/(0.0254^2));
set(gca,'FontSize',18);
legend('100 psi','300 psi','500 psi','Location','NorthWest');
xlabel('Flow Rate (L/s)');
ylabel('Power (W)');
title('Power versus flow rate and pressure differential');

print -depsc2 'EnergyRates'

h = 0:10:300;
g = 9.81;
rho = 1025;  %kg/m^s
V = 1;  %L
V = V/1000;  %m^3

E = rho*g*h*V;

figure
plot(h,E);
set(gca,'FontSize',18);
xlabel('seawater depth (m)');
ylabel('Energy (J)');
title('Potential Energy in a 1 liter evacuated volume');
print -depsc2 'Energy'