mae155b_hw1sol

# mae155b_hw1sol - U(i,1)=u H(i,1)=h TT(i,1)=i*dt...

This preview shows pages 1–3. Sign up to view the full content.

MAE155b Homework 1 SOLUTIONS 1 Nominal Results 0 5 10 15 20 25 -20 0 20 40 60 80 100 120 140 160 180 Time [sec] Altitude [ft] (a) 0 5 10 15 20 25 -40 -20 0 20 40 60 80 100 Time [sec] Velocity [ft/sec] (b) Figure 1: SimulationPlots The predicted time of ±ight is 20.35 seconds. 2 Matlab Script % % MAE 155b % HW #1 SOLUTION % nominal flight profile for model rocket % close all; clear all; % % thrust profile for Quest A6-4 % time[sec] vs. thrust[N] T=[0 0 0.1 4.8 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
0.2 11.82 0.23 7.9 0.3 4.8 0.41 0 0.42 0 1e2 0]; % m0=50e-3; % [kg] % mass depletion for Quest A6-4 % time[sec] vs. mass[kg] M=[0 15.3e-3+m0 0.41 8.8e-3+m0 0.42 8.8e-3+m0 1e2 8.8e-3+m0]; % Tfinal=30; % [sec] dt=0.01; % [sec] % rho=1.225; % [kg/m^3] g=9.81; % [m/s^2] A=pi*0.00125^2; % [m^2] A_p=pi*(0.0254*7)^2; % [m^2] Cd=0.6; Cd_p=1.2; % u=0; h=0; % for i=1:round(Tfinal/dt)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: U(i,1)=u; H(i,1)=h; TT(i,1)=i*dt; % m=interp1(M(:,1),M(:,2),i*dt); % % euler integration (dont tell my advisor) % burn+coast phases if(i*dt&amp;lt;4.41) h=h+dt*u; u=u+dt*(interp1(T(:,1),T(:,2),i*dt)/m-g-0.5*Cd*rho*u^2*A/m); end % parachute phase if(i*dt&amp;gt;=4.41) h=h+dt*u; 2 u=u+dt*(-g+0.5*Cd_p*rho*u^2*A_p/m); end % % stop sim as rocket hits ground if(i&amp;gt;0.5/dt &amp;amp; h&amp;lt;=0) break; end end % time_of_flight=i*dt, % figure(1) plot(TT,H/(0.0254*12)),grid on; xlabel(Time [sec]); ylabel(Altitude [ft]); % figure(gcf+1) plot(TT,U/(0.0254*12)),grid on; xlabel(Time [sec]); ylabel(Velocity [ft/sec]); % 3...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

mae155b_hw1sol - U(i,1)=u H(i,1)=h TT(i,1)=i*dt...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online