% Cylinder calcs
% User input:

%cylinder
pressure = 150; %pressure in psi
cyl_D = 2.5; %cylinder ID in inches
cyl_t = .25; %cylinder wall thickness in inches
Vol = 1; %working volume in liters

%material properties
%Using 6061-T6
E = 1e7; %modulus in psi
yield = 38000; %yield strength in psi
poissons = 0.33;

% Thin walled cylinder under internal stress.  Calc hoop stress according to
% \sigma =P\;\frac{r}{\delta }
% where
% \begin{array}{l}
% P=\mathrm{internal}\;\mathrm{pressure}\\
% r=\mathrm{radius}\\
% \delta =\mathrm{wall}\;\mathrm{thickness}
% \end{array}
%

hoop_stress = pressure * (cyl_D/2)/cyl_t %psi

% Calculate longitudinal stress according to
% \sigma_l =P\frac{r}{2\delta }

long_stress = pressure * (cyl_D/2) / (2*cyl_t)

% Calculate equatorial dilation according to Harvey eq 2.4.3 pp.40
% d=\frac{Pr^2 }{2\delta \;E}\left(2-\mu \right)
% where
% \begin{array}{l}
% \mu =\mathrm{poissons}\;\mathrm{ratio}\\
% E=\mathrm{modulus}\;\mathrm{of}\;\mathrm{elasticity}
% \end{array}

dilation = (  (pressure*(cyl_D/2)^2)/(2*cyl_t*E) ) * (2-poissons)  %inches

%