Final Goddard Project

Final Goddard Project - GODDARD FINAL PROJECT COLE PAGE...

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

View Full Document Right Arrow Icon
G ODDARD F INAL P ROJECT C OLE P AGE %Goddard Problem Main File %MAE 2117 %Cole Page %May 3rd 2011 clc %A program that simulates the motion of a sounding rocket. global g_sealevel %reference value sea level global r_earth %radius of earth global rho_zero %density at sea level global scale_hgt %scale height global s_ref %reference area global cd %drag coefficient global thrust %thrust global m_dot %rate of mass change m_i = 200; %initial mass m_f = 100; %final mass t_b = 50; %Burn time. i_sp = 300; %Specific impulse s_ref = .196349541; %reference area cd = .2; %drag coefficient rho_zero = 0.002377; scale_hgt = 23800.0; g_sealevel = 32.17405; r_earth = 2.092567257e7; zero = 0.0; two = 2.0; %The program prints to the file "Sound.prt" n_states = 3; print_increment = 2.0; states(1) = 0; states(2) = 0; states(3) = m_i/g_sealevel; time = 0; %set initial time to zero
Background image of page 1

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

View Full DocumentRight Arrow Icon
delta_t = input('Please enter the integration time step'); if (delta_t > print_increment) print_increment = delta_t; end %setup initial given equations for mass change and thrust m_dot = (m_f - m_i)/g_sealevel/t_b; thrust = -m_dot*g_sealevel*i_sp; fid = fopen('Sound.dat','a'); fprintf(fid,'Time Altitude Velocity Weight\n'); fprintf(fid,' (ft) (ft/sec) (lb)\n'); fprintf(fid,'==== ======== ======== ======\n'); fprintf(fid,'%f %f %f %f \n',time,states(1),states(2),g_sealevel*states(3)); fclose(fid); %First integration loop while (time < t_b) t_next = time + print_increment;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/12/2011 for the course ECON 011 taught by Professor Bob during the Spring '11 term at Tufts.

Page1 / 5

Final Goddard Project - GODDARD FINAL PROJECT COLE PAGE...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online