MATLAB code

From GICL Wiki
Jump to: navigation, search

MATLAB code: clear

clc


%air psi=8.5; %psi on gauge

d1a=.25; %in dia inlet

d2a=.015; %in dia outlet

pa=.07647; %lbm/ft3 density

%fuel

p1f=14.6959488; %psi atmsophere

d1f=.25; %in dia inlet

h2f=.015; %in height outlet

w2f=.03; %in height outlet

n2f=6; %number of outlets pf=1.572; %lbm/ft3 density

qf=1.6; %gal/hr


%constants

g=32.174;

%air

p1a=psi+p1f; %pesure adjusted to actual

a1a=pi*(d1a/2)^2; %area inlet

a2a=pi*(d2a/2)^2; %area outlet

pa=(pa/g)/1728; %slug/in3 density

%fuel a1f=pi*(d1f/2)^2; %area inlet

a2f=6*(h2f*w2f); %area outlet

pf=(pf/g)/1728; %slug/in3 density

qf=(qf*231)/(3600); %in3/s

%solution

p2f=p1f-((qf/a2f)^2-(qf/a1f)^2)*(pf/2) p2a=p2f;

qa=(a2a*((2*(p1a-p2a)/pa)/(1-(a2a/a1a)^2))^.5); qf

p2f=p2f+.01

qf=(a2f*((2*(p1f-p2f)/pf)/(1-(a2f/a1f)^2))^.5)

MATLAB command window:

p2f =

  14.6756

qf =

   0.1027

p2f =

  14.6856

qf =

   0.0733