R=8.314/32;
T0=2930;
a=(12)/((2.027*10^6)^0.45);
rhoP=1920;
Astar=pi*0.25^2;
k=1.35;
n=0.45;
P0=101325;
syms P(t)
for t = [0,0.1]
dP=@(P,t)(Ab*a*P^n*(rhoP-rhoO)-P*Astar*sqrt(k/(R*T0))*(2/(k+1))^((k+1)/(2*(k-1))))*R*T0/v0;
[P,t]=ode45(dP, [0,0,1], P0);
end
if t==0 %at beginning of the integration set initial values for the persistent variables
rp=0.35; %initial port radius
t1=0; %initial time step
end
Ab=2*pi*rp*8;%burn area
rhoO=P/(R*T0); %gas density
rp=min(rp+((a*P^n)*10^-3)*(t-t1),0.7);
figure(2)
plot(t,y)
xlabel("Time (s)")
ylabel("Chamber Pressure (Pa)")
title("Chamber Pressure vs Time (Start-Up)")
Best Answer