{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


4_Quarterman_Patrick_LabExam2_Problem1 -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Patrick Quarterman Section 4 Lab Exam Problem 1 Script: %Script 'Rocket_Fuel.m' %Patrick Quarterman, Section 4 %Calculate the mass of fuel left and the velocity of rocket after a given %time %given constants Cd=.55; %drag coefficient (kg/m) Ft=4.2*10^6; %thrust force (N) m1=258500; %inital mass (kg) v1=0; %initial velocity (m/s) Cf=1.4*10^-3; %burn coefficient t=0:.5:25; %time interval in half minute increments g=9.81 ; %acceleration due to gravity (m/s^2) figure %create first subplot of mass vs time subplot(1,2,1) xlabel( 'time (min)' ) ylabel( 'mass (kg)' ) title( 'Mass vs. Time' ) grid on hold on subplot(1,2,2) %second subplot of velocity vs time xlabel( 'Time (min)'
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ) ylabel( 'Velocity (m/s)' ) title( 'Velocity vs. Time' ) grid on hold on m=m1; v=v1; for t=0:.5:25; m=m-(Cf*m)*.5; v=v+(Ft/m-g-Cd/m*v^2)*.5; subplot(1,2,1) plot(t,m, 'r--' ) subplot(1,2,2) plot(t,v, '.-' ) end hold off matlab plot: *note that I know the plots are not with solid line, and the mass plot on left shouldn’t have point markers, but I could not get a line to show up for the plots. 10 20 30 2.49 2.5 2.51 2.52 2.53 2.54 2.55 2.56 2.57 2.58 2.59 x 10 5 time (min) mass (kg) Mass vs. Time 10 20 30 20 40 60 80 100 120 140 160 180 Time (min) Velocity (m/s) Velocity vs. Time...
View Full Document

{[ snackBarMessage ]}