{"id":6146,"date":"2019-05-12T23:09:06","date_gmt":"2019-05-13T03:09:06","guid":{"rendered":"http:\/\/pages.vassar.edu\/magnes\/?p=6146"},"modified":"2019-05-12T23:20:21","modified_gmt":"2019-05-13T03:20:21","slug":"computational-simulation-of-rocket-trajectories","status":"publish","type":"post","link":"https:\/\/pages.vassar.edu\/magnes\/2019\/05\/12\/computational-simulation-of-rocket-trajectories\/","title":{"rendered":"Computational Simulation of Rocket Trajectories"},"content":{"rendered":"<h4>Background<\/h4>\n<p>In PHYS 375 we have studied several applications for numerical methods in solving otherwise impossible, or at least prohibitively difficult, differential equations. One example involved the Euler-Cromer method for solving the equation of motion for a pendulum both damped by atmospheric elements and driven by an outside force.\u00a0 At the most basic level, the equation of motion for a rocket can be treated in the same way as the damped driven pendulum &#8212; both are affected by three forces: gravitational force, a damping drag force, and a driving force.\u00a0 In the case of rocket motion, these forces are represented by the rocket&#8217;s weight, atmospheric and wave drags, and its thrust force. The biggest difference between the two problems is that because a rocket&#8217;s thrust force is much larger than any damping forces, it will not exhibit chaotic motion like the pendulum.<\/p>\n<p>The equation of motion for a rocket is therefore:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq1-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6148\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq1-2-300x97.jpg\" alt=\"\" width=\"300\" height=\"97\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq1-2-300x97.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq1-2.jpg 554w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In this article I will explore each term of the equation of motion, covering the various dependencies that must be accounted for in the code, as well as any assumptions or simplifications made.\u00a0 Finally, we will see the results of this simulation for different rocket models.<\/p>\n<h4>I. Thrust Force<\/h4>\n<p>The majority of all rockets which have entered into orbit have been liquid-fuel rockets, as opposed to solid-fuel rockets (the notable exception being the Space Shuttle, which uses both).\u00a0 For a liquid-fuel rocket, thrust would be controlled during the ascent by a throttle, responding to rocket performance and adjusting thrust over time to control the trajectory.\u00a0 For the sake of the project, we are assuming that the thrust of the model rocket is constant for the duration of the ascent.\u00a0 A mathematical representation of the thrust force could be:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6149\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq3-300x45.jpg\" alt=\"\" width=\"300\" height=\"45\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq3-300x45.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq3.jpg 551w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In other words, the thrust force is a constant up until the time at which the rocket runs out of fuel, after which it is zero.\u00a0 The constant value of the thrust will be known for each rocket model used in the simulation.\u00a0 Therefore:\u00a0 <strong>t<\/strong><strong>he thrust force is dependent on time only.<\/strong><\/p>\n<p>It is important to note that this model is purely one-dimensional.\u00a0 In a realistic rocket flight, the rocket would launch perpendicular to the surface, and then rotate by a small degree in flight to begin forming a parabolic trajectory.\u00a0 Therefore the actual vertical component of the thrust would be slightly lower than it is here.\u00a0 However, we can also assume that a rocket flying at any non-zero angle would generate a small amount of aerodynamic lift that would counteract this reduction in vertical thrust.<\/p>\n<h4>II.1 Atmospheric Drag<\/h4>\n<p>The drag acting on the rocket can be separated into two components: atmospheric drag and wave drag.\u00a0 Atmospheric drag, a form of parasitic drag, is a damping force opposite to the rocket&#8217;s motion due to skin friction between the surrounding air molecules and the surface of the rocket.\u00a0 The equation for drag force due to atmospheric skin friction is:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6150\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq4-300x42.jpg\" alt=\"\" width=\"300\" height=\"42\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq4-300x42.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq4.jpg 499w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>where\u00a0\u03c1 is the air density (kg\/m<sup>3<\/sup>),\u00a0<em>v<\/em> is the velocity of the rocket,\u00a0<em>C<\/em><sub>D<\/sub> is the drag coefficient, a\u00a0<em>A<\/em> is the cross-sectional area of the rocket.\u00a0 The diameter of each rocket is given, so\u00a0<em>A<\/em> will be known.\u00a0 The drag coefficient is difficult to determine without making physical tests on the rocket, but we will assume a value of\u00a0<em>C<\/em><sub>D<\/sub> = 0.75, which represents a flying shape somewhere between a cylinder and a cone.\u00a0 This is a relatively high drag coefficient; airfoils, for comparison, have values of\u00a0<em>C<\/em><sub>D<\/sub> well below 0.05.<\/p>\n<p>Air density is more complicated to calculate, because it will decrease exponentially as the rocket ascends through the atmosphere.\u00a0 For altitudes under 86 km (the troposphere, stratosphere, and mesosphere), the air density can be given by the ideal gas law (Eq. 5). Here,\u00a0<em>R<\/em> is the gas constant (8.314 J\u22c5K<sup>\u22121<\/sup>\u22c5mol<sup>\u22121<\/sup>) and\u00a0<em>M<\/em>\u00a0is the molar mass of air (0.029 kg\/mol).\u00a0 Atmospheric temperature and pressure are also dependent on altitude, and are given by the barometric equations below.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq5-7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6155\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq5-7-300x130.jpg\" alt=\"\" width=\"300\" height=\"130\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq5-7-300x130.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq5-7.jpg 461w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Here\u00a0<em>T<\/em><sub>0<\/sub> and <em>P<\/em><sub>0<\/sub>\u00a0are\u00a0the baseline temperature and pressure for certain altitude regions,\u00a0<em>L<\/em> is the temperature lapse rate for that region, and <em>g<\/em><sub>0<\/sub> is the acceleration due to gravity at sea level (9.81 m\/s<sup>2<\/sup>).<\/p>\n<p>Above 86 km, in the thermosphere, temperature rises more quickly because the atmosphere no longer shields the space from the sun&#8217;s rays.\u00a0 Pressure and air density, now very small, drop off with a quartic relationship to altitude.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq8-9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6159\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq8-9-300x51.jpg\" alt=\"\" width=\"300\" height=\"51\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq8-9-300x51.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq8-9.jpg 573w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The coefficients of each term vary in different high-altitude regions.\u00a0 For a table of these coefficients, as well as the values for\u00a0<em>T<\/em><sub>0<\/sub>,\u00a0<em>P<\/em><sub>0<\/sub> and <em>L<\/em>, please refer to <a href=\"http:\/\/www.braeunig.us\/space\/atmmodel.htm\">this comprehensive mathematical model of the Earth&#8217;s atmosphere<\/a>.<\/p>\n<p>To correctly calculate atmospheric drag in my rocket simulation, I needed to write a function that could accept a value for altitude and compute the pressure, temperature, and air density in each atmospheric region. <a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Density_function.pdf\">Here is this function<\/a>, which stops distinguishing very small values for air density above\u00a0<em>z<\/em> = 150 km.\u00a0 Running this function for increasing altitude produced the following graphs of temperature, pressure, and air density.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Temperature.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6195\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Temperature-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Temperature-300x225.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Temperature.jpg 560w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\u00a0\u00a0<a style=\"font-size: 1rem\" href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Atmospheric-Pressure.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6196\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Atmospheric-Pressure-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Atmospheric-Pressure-300x225.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Atmospheric-Pressure.jpg 560w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><a style=\"font-size: 1rem\" href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Air-Density.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6197\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Air-Density-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Air-Density-300x225.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Air-Density.jpg 560w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In summary, the code must update values of air density and drag within the for-loop of the Euler-Cromer method, because the\u00a0<strong>atmospheric drag depends on both altitude and velocity<\/strong>.<\/p>\n<h4>II.2 Wave Drag<\/h4>\n<p>Earlier versions of my project failed to account for wave drag, or the drag force exerted on an aircraft by the pressure due to compressed waves of air.\u00a0 This force comes into play once the rocket exceeds its critical Mach number (typically Mach 0.8), and approaches the sound barrier.\u00a0 When an object approaches the speed of sound, it begins to move faster than the air waves in front of it, causing a rapid rise in drag.\u00a0 The peak in drag at Mach 1 causes the sound barrier, which is the primary obstacle for rockets attempting to leave the Earth&#8217;s atmosphere. When I did not account for wave drag in my simulation, rockets were able to reach space up to distances of 1,000,000 meters without difficulty.<\/p>\n<p>Exact calculations of the relationship between drag and Mach number are difficult and rely heavily on the specific shape of the rocket.\u00a0 Furthermore, most information available on calculating wave drag is from the field of aerodynamic engineering, which deals in airplanes, not rockets.\u00a0 One equation, however, the Prandtl-Glauert Rule, can help approximate the effects of transonic drag forces in my rocket simulation.<\/p>\n<p>The use of the Prandtl-Glauert Rule in this context requires several further caveats.\u00a0 First, it is currently accepted that the Prandtl-Glauert Rule is not valid for accurate calculations in the transonic region, only being valid for Mach numbers below 0.8 and between 1.2-5.\u00a0 I am choosing to ignore this disclaimer, because the rule in this region approximates the effect of the sound barrier well enough for the purposes of the project. Also, the Prandtl-Glauert Rule has been shown in experiments to underestimate increases in wave pressure (NACA Report No. 646, 1939).\u00a0 Two updates exist to the rule &#8212; the Karman-Tsien Rule, and Laitone&#8217;s Rule &#8212; which include higher-order terms.\u00a0 Lastly, the explicit definition of the Prandtl-Glauert Rule relates Mach number to the pressure coefficient of an aircraft, not its drag coefficient.\u00a0 Its application here is by analogy, noting the similar effects in equations for the Prandtl-Glauert corrections to coefficients of lift and moment.<\/p>\n<p>The Prandtl-Glauert Rule (Equation 10) states that when dealing with compressible fluids, the aerodynamic coefficients (e.g. pressure, lift, drag, etc) must be divided by\u00a0<em>\u03b2<\/em>, the Prandtl-Glauert Factor, which depends on the freestream Mach number.\u00a0 The Mach number is defined as the ratio of velocity over sound speed, and the sound speed in turn depends on air temperature.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq10-13.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6185\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq10-13-300x147.jpg\" alt=\"\" width=\"300\" height=\"147\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq10-13-300x147.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq10-13.jpg 473w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In aerodynamics, in is customary to perform calculations using a frame of reference that moves along with the aircraft.\u00a0 The subscript\u00a0\u221e below the Mach number, velocity, and sound speed (<em>a<\/em>) refers to the &#8220;freestream&#8221; value of each, meaning the speed of the moving air around the stationary vessel in this frame of reference, but far away from the vessel, where the shape of the aircraft can not yet affect the airflow.\u00a0 In Equation 13,\u00a0<em>\u03b3<\/em> is the ratio of specific heats (about 1.4 on average), and\u00a0<em>R<\/em><sub>sp<\/sub> is the specific gas constant (287\u00a0J\u22c5kg<sup>\u22121<\/sup>\u22c5K<sup>\u22121<\/sup> for dry air).\u00a0 For Mach numbers higher than 1 (supersonic speeds), the terms under the square root in Equation 11 are reversed.<\/p>\n<p>We have previously established that air temperature depends on altitude, so we can say that\u00a0<strong>wave drag depends both on velocity and altitude<\/strong> just as atmospheric drag does.\u00a0 For this reason, I also needed\u00a0<a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Wave_drag_function.pdf\">a function<\/a> that could update the coefficient of drag at each iteration of the main for-loop.<\/p>\n<p>Running the function at a fixed altitude and temperature for increasing rocket velocities produced the following results for wave drag:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Drag_data.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6191\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Drag_data-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Drag_data-300x225.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Drag_data.jpg 560w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The drag peaks at 347.18 m\/s, the speed of sound at 300 K.\u00a0 Notice that if that code had not corrected it, the drag would have been infinite at Mach 1 following Equations 10 and 11.\u00a0 This is called the Prandtl-Glauert Singularity.<\/p>\n<h4>III. Gravitational Force<\/h4>\n<p>The force due to gravity is given by the same simple equation as in other projectile physics problems:\u00a0\u00a0<em>F<sub>G<\/sub> = mg<\/em>.\u00a0 However, in this case, calculating the gravitational acceleration and the mass of the rocket introduces new problems.<\/p>\n<p>The mass of the rocket will always be decreasing as it expels fuel.\u00a0 Continuing to assume constant thrust, and therefore a constant mass flow rate out of the rocket, we can model the mass of the rocket with a linear time dependence as in Equation 15.\u00a0 The gravitational acceleration at an altitude\u00a0<em>z<\/em> from the Earth&#8217;s surface is given in Equation 16, where\u00a0<em>R<sub>E<\/sub><\/em> is the radius of the Earth (6,371,000 m) and\u00a0<em>M<sub>E<\/sub><\/em> is the mass of the Earth (5.972 x 10<sup>24<\/sup> kg).<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq14-16.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6201\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq14-16-300x101.jpg\" alt=\"\" width=\"300\" height=\"101\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq14-16-300x101.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/eq14-16.jpg 460w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The mass flow rate can be calculated from the Tsiolkovsky Rocket Equation, given the thrust force and the specific impulse of the rocket.\u00a0 The specific impulse, in seconds, is a measure of the efficiency of the rocket&#8217;s engines, and is known for most rockets.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq17.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6204\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq17-300x50.jpg\" alt=\"\" width=\"300\" height=\"50\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq17-300x50.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Eq17.jpg 470w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Because mass is decreasing over time, and gravity is decreasing with altitude,\u00a0<strong>gravitational force depends on time and altitude<\/strong>.<\/p>\n<p>We have now reduced the equation of motion to depend only on time, altitude as a function of time, and velocity (the derivative of altitude) as a function of time.\u00a0 We can now apply the Euler-Cromer method to solve for altitude and velocity and determine the rocket&#8217;s one-dimensional trajectory.<\/p>\n<h4>IV. Computational Method<\/h4>\n<p>My code for solving the equation of motion is attached\u00a0<a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/One_stage_code.pdf\">here<\/a> in full.\u00a0 A pseudo-code summary of the program is given below.<\/p>\n<pre>\u2022 Initialize universal constants (G, M_earth, mol, R, P0, T0, rho0, g0)\r\n\u2022 Initialize rocket specifications (thrust, drag coef., diameter, area, wet and dry mass,\r\n  specific impulse, mass flow rate)\r\n\u2022 Euler-Cromer method\r\n   \u2023 initialize altitude (1 m), velocity (0 m\/s), mass (m0), air density (rho0), and\r\n     gravity (g0)\r\n   <strong>for<\/strong> t from 0 to tmax\r\n   \u2023 update gravity, g(z)\r\n   \u2023 update mass, m(t)\r\n   \u2023 call density function, [rho,T,P] = f(z)\r\n   \u2023 call wave drag function, Cd = f(v,T,C0)\r\n   \u2023 calculate thrust force, FT(m)\r\n   \u2023 calculate drag force, FD(rho,v,Cd,m)\r\n   <em>  if<\/em> [drag vector condition]\r\n   \u2023 Euler-Cromer:  v = v + (thrust - drag - g)*dt\r\n                    z = z + v*dt\r\n   \u2023 save matrix values for v, z, m, g, thrust, drag, and rho\r\n   \u2023 save end time\r\n     <em>if <\/em>[crash condition]\r\n     <em>if <\/em>[empty condition]\r\n   <strong>end\r\n<\/strong>\r\n\u2022 Plot z vs. t, v vs. t\r\n\u2022 Plot FT, FD, and g vs. t\r\n\u2022 Define density function, [rho,T,P] = f(z)\r\n\u2022 Define wave drag function, Cd = f(v,T,C0)<\/pre>\n<p>I would like to call attention to the three &#8220;if conditions&#8221; in the for-loop, which were inserted as the result of trial and error.\u00a0 First, the &#8220;drag vector condition&#8221; is necessary because the code cannot determine the direction component of the velocity vector, only its magnitude.\u00a0 If the rocket fails, and begins to fall, the other forces will still point upwards, but the drag force will need another line of code to tell it to change sign when the velocity is negative.<\/p>\n<p>The &#8220;crash condition&#8221; simply says to stop the for-loop and end the simulation when the rocket hits the ground, when z = 0 or z &lt; 0.\u00a0 Otherwise, the rocket would fall through the Earth.\u00a0 This is also why the rocket&#8217;s altitude was initialized at z = 1, so as not to prematurely trigger this condition.<\/p>\n<p>Finally, the &#8220;empty condition&#8221; says to set the thrust and mass flow rate equal to zero when the rocket runs out of fuel. The empty mass (&#8220;dry mass&#8221;) of the rocket was initialized, so the condition simply checks to see when\u00a0<em>m<\/em> =\u00a0<em>m<\/em><sub>dry<\/sub>.\u00a0 When I had not yet written this condition, the rocket&#8217;s mass would decrease to negative infinity.<\/p>\n<h4>V. Results, Single-Stage Rocket<\/h4>\n<p>The test rocket used in the simulations was the Falcon 1e, a theoretical rocket designed by SpaceX in 2011 as an update to the earlier Falcon 1.\u00a0 The Faclon 1e was never launched, which gave me the inspiration to test its theoretical viability in my simulation.\u00a0 The Falcon 1e specifications, compared to other rockets which I tried in the simulation, are given below.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6287\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs-1024x373.jpg\" alt=\"\" width=\"546\" height=\"199\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs-1024x373.jpg 1024w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs-300x109.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs-768x279.jpg 768w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs-624x227.jpg 624w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/rocket_specs.jpg 1116w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/a><\/p>\n<p>The next two figures show the rising altitude and velocity of the rocket, as well as the relative strength of each component force over time.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6263\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2.jpg\" alt=\"\" width=\"560\" height=\"420\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2.jpg 560w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2-300x225.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2forces.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6264\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2forces.jpg\" alt=\"\" width=\"560\" height=\"420\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2forces.jpg 560w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight2forces-300x225.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>We can see that the Falcon 1e will fly for about 169 seconds before it runs out of fuel and the thrust force drops to zero. By that time it has reached an altitude of about 125 km, still short of the 200 km required for a comfortable low-earth orbit.\u00a0 This is consistent with our expectations: no single-stage rocket in history has every made it to orbit from Earth.\u00a0 The topic of a single-stage-to-orbit spacecraft (SSTO) is an area of current research, mostly among defense contractors.<\/p>\n<p>The flatline in the velocity curve around 65-95 seconds represents the rocket approaching the sound barrier.\u00a0 The corresponding sudden increase in drag represents effects of compressibility and wave drag taking hold.\u00a0 Note how the graph of drag directly across the sound barrier around 95 seconds seems to exhibit more erratic, possibly chaotic fluctuation.\u00a0 This occurs because thrust and drag at this point in time are competing for dominance over the rocket&#8217;s net force.\u00a0 Once the sound barrier is breached, drag quickly becomes negligible, as the air waves move behind the rocket, and air density becomes very thin.\u00a0 Making the jump to supersonic speeds, therefore, is critical in order to leave the Earth&#8217;s atmosphere; although the jump requires a high amount of thrust and a sturdy spacecraft, choosing to remain at subsonic velocities would be less effective overall due to the higher drag on the rocket.<\/p>\n<h4>VI. Results, Two-Stage Rocket<\/h4>\n<p>In order to get to space, our simulated rocket will need two stages.\u00a0 Specifications for both stages of the Falcon 1e are public on Wikipedia and the SpaceX website.\u00a0 In order to achieve this in the code, I added the following lines inside the for-loop:<\/p>\n<pre> if z &lt; 0              % rocket crashes or fails to launch\r\n        break\r\n    elseif m &lt; empty      % rocket runs out of fuel, mass becomes stable\r\n        FT = 0;\r\n        dm = 0;\r\n        <strong>nextstage = nextstage + 1<\/strong>;\r\n    end\r\n    \r\n    <strong>if nextstage == 15<\/strong>\r\n<strong>        nextstage = 0;<\/strong>\r\n<strong>        break<\/strong>\r\n<strong>    end<\/strong><\/pre>\n<p>In other words, when the rocket runs out of fuel, the program will continue for another 15 iterations of the loop, and then will break (nextstage was initialized as zero).\u00a0 After that, I reinitialized the specifications of the rocket for its second stage and then ran a second for-loop identical to the first, but without reinitializing the holding matrices for the variables.<\/p>\n<p>The results for the two-stage Falcon 1e&#8217;s altitude trajectory, velocity, and force diagrams are shown below.\u00a0 The program was instructed to stop when the rocket reached an altitude of 250 km.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6268\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3.jpg\" alt=\"\" width=\"560\" height=\"420\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3.jpg 560w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3-300x225.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3forces.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6271\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3forces.jpg\" alt=\"\" width=\"560\" height=\"420\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3forces.jpg 560w, https:\/\/pages.vassar.edu\/magnes\/files\/2019\/05\/Flight3forces-300x225.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>We can see that the first stage did most of the hard work.\u00a0 After crossing the sound barrier, very little additional thrust or increase in velocity was needed to complete the journey to space.\u00a0 This is because, as previously mentioned, the drag at high altitudes and supersonic speed is negligible.\u00a0 We can also see that the second stage of the rocket did not expend all of its fuel.\u00a0 This is necessary, because once the rocket has escaped the Earth&#8217;s atmosphere, the second (or third) stage will still be responsible for making orbital maneuvers in space.\u00a0 For example, if the rocket&#8217;s mission is to launch a satellite, or rendez-vous with the International Space Station, the rocket will need to rotate parallel to the surface of the Earth and increase its velocity to around 7.8 km\/s, the normal minimum velocity for low-earth orbit.\u00a0 For comparison, this speed at sea level would correspond to nearly Mach 23.\u00a0 My simulation of the Falcon 1e only achieved 3.8 km\/s, or Mach 11 at sea level, during its ascent.<\/p>\n<h4>References<\/h4>\n<p>[1]\u00a0Anderson, John D.\u00a0<i>Fundamentals of Aerodynamics<\/i>. 5th ed. New York: McGraw-Hill, 2011.<\/p>\n<p>[2]\u00a0Braeunig, Robert A. Basic of Space Flight: Atmospheric Models. 2014. http:\/\/www.braeunig.us\/space\/atmmodel.htm.<\/p>\n<p>[3]\u00a0Giordano, Nicholas J., and Hisao Nakanishi.\u00a0<i>Computational Physics<\/i>. 2nd ed. Upper Saddle River, NJ: Pearson Prentice Hall, 2006.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Background In PHYS 375 we have studied several applications for numerical methods in solving otherwise impossible, or at least prohibitively difficult, differential equations. One example involved the Euler-Cromer method for solving the equation of motion for a pendulum both damped by atmospheric elements and driven by an outside force.\u00a0 At the most basic level, the [&hellip;]<\/p>\n","protected":false},"author":5269,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6146","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/6146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/users\/5269"}],"replies":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/comments?post=6146"}],"version-history":[{"count":7,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/6146\/revisions"}],"predecessor-version":[{"id":6292,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/6146\/revisions\/6292"}],"wp:attachment":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/media?parent=6146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/categories?post=6146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/tags?post=6146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}