Trying to simulate a water rocket using matlab, however I can't get my for loop to work properly.
This is what I have so far:
close allclear allP0 = 6e5; %Pa
Pout = 1e5; %PaV0 = 2; %l
V = 1.5; %lgamma = 1.4;rho_w = 998; %kg/m^3
%Pin = P0*(V/V0).^-gamma;
dt = 0.01;t = 1:dt:100;Ve(1) = 0; %m/s
Pin(1) = 6e5; %Pav0 = 0; %m/sv = 0; %m/sM0 = 0.1; %kg
M = M0 + (V0-V)*rho_w;for i = 1:100 Pin(i+1) = Pin(i) - P0(V/V0).^-gamma; Ve(i+1) = sqrt(2*(Pin(i) - P0)/rho_w); %v = Ve*log(M0/M) + v0;
end
Really hoping one of you can enlighten me, because I'm completely lost here.
Best Answer