-
Notifications
You must be signed in to change notification settings - Fork 0
/
StopperCalc.m
74 lines (70 loc) · 2.31 KB
/
StopperCalc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%% Stopper Calculations
% -------------------------------------------------------------------------
% This file shows whether the material chosen to be the stopper will hold
% given the highest force requested by the customer, the material strength,
% and the cross sectional area of the material in contact with the system.
% -------------------------------------------------------------------------
% ---------------------------Vessel Force----------------------------------
format short
disp('*** Stopper Calculation Completed ***');
% _Inputs_
d0=3.505; % diameter of the piston (in)
P=50; % highest desired Pressure(psi) (lbf/in^2)
% _Formulas_
y=Vessel_Force(d0,P);
% _Display_
vF=sprintf('Force of piston on fluid: %g lb',y);
disp(vF);
% ----------------------- Max Allowable Force -----------------------------
% ------------- info used for confirmation ----------------------
% PVC can withstand:
% - Young's Modulus of 441000 psi (lbf/in^2)
% - Poisson's Ratio = 0.4
% ABS can withstand:
% - Young's Modulus of 304,000 psi
% - Poisson's Ratio = 0.37
% Euler's Formula for buckling was used
% ---------------------------------------------------------------
%_ inputs_ (PVC)
d1_p=1.03; % inner diameter (in)
d2_p=1.33; % outer diameter (in)
L=5; % Length of the column
E=441000; % Young's modulus given (matweb)
% _constants_
K=1; % assumed as both ends are fixed
ri=d1_p/2; % inner radius
ro=d2_p/2; % outer radius
% _formula_
I=pi/4*(ro^4-ri^4); % moment of inertia of a hoop
P_cr_PVC=pi^2*E*I/((K*L)^2); % Max force allowable
% _display_
P_cr_P=sprintf('PVC max allowable force: %g lb',P_cr_PVC);
disp(P_cr_P);
%_ inputs_ (ABS)
d1_a=1; % inner diameter (in)
d2_a=3; % outer diameter (in)
L=3; % Length of the column
E=145000; % Young's modulus given (matweb)
% _constants_
K=1; % assumed as both ends are fixed
ri=d1_a/2; % inner radius
ro=d2_a/2; % outer radius
% _formula_
I=pi/4*(ro^4-ri^4); % moment of inertia of a hoop
P_cr_ABS=pi^2*E*I/((K*L)^2); % Max force allowable
% _display_
P_cr_A=sprintf('ABS max allowable force: %g lb',P_cr_ABS);
disp(P_cr_A);
% --------------------- Stopper Calculations ------------------------------
% _display_
if y < P_cr_PVC
disp('PVC is OK to use');
else
disp('PVC cannot withstand stress');
end
% _display_
if y < P_cr_ABS
disp('ABS is OK to use');
else
disp('ABS cannot withstand stress');
end