Using Pyton

The speed u of a Saturn V rocket in vertical flight near the surface of the earth can be approximated by the following formula: v=u-ln ( one) – 94 where • In() is the natural logarithm function (i.e. base e). This is what the functions math.log or numpy.log would compute by default. . u=2510 m/s (velocity of exhaust relative to rocket) • Mo = 2.8 x 106 kg (mass of rocket at liftoff) • m = 13.3 x 10% kg/s (rate of fuel consumption) . 9 = 9.81 m/s2 (gravitational acceleration) • t = time measured from liftoff Using the secant root-finding method and its associated Python code seen in class, determine the time when the rocket reaches the speed of sound (335 m/s). Write your code in roots.py. You can copy the root-finding method code from the slides as part of your program. You can also use NumPy arrays and functions. After you write the code for the above calculation, in the same file roots.py plot a graph with the speed of the rocket on the y-axis and time on X-axis, for the time interval [0, 150). Provide appropriate titles for the two axes and the plot itself. Save this plot to disk as rocket.png using the plt.savefig(“rocket.png”) function. Do not submit the rocket.png file – when your code is run during grading, the file, if saved properly, will be automatically created at that time. (Be sure to verify that your code does produce the correct image saved on disk when run.) Finally, answer the same rocket question above (finding the time when it reaches the speed of sound), but this time do the calculation manually, on paper or on computer, using the steps shown in class. Use the Newton-Raphson method with epsilon as 10-9, the first approximation as 0, and 4 iterations. For each iteration, you should write the value of x, f(x), l'(x), and the difference between each root approximation. Include the steps in your submission under the name iterations.pdf. Your answer should be precise within 5 decimal places. Note that hard copies of your answer will not be accepted. If you decide to write down the steps by hand, you must either scan your pages into the computer, take a very legible picture with your phone or other device, or in some other way digitize the answer. Show transcribed image text The speed u of a Saturn V rocket in vertical flight near the surface of the earth can be approximated by the following formula: v=u-ln ( one) – 94 where • In() is the natural logarithm function (i.e. base e). This is what the functions math.log or numpy.log would compute by default. . u=2510 m/s (velocity of exhaust relative to rocket) • Mo = 2.8 x 106 kg (mass of rocket at liftoff) • m = 13.3 x 10% kg/s (rate of fuel consumption) . 9 = 9.81 m/s2 (gravitational acceleration) • t = time measured from liftoff Using the secant root-finding method and its associated Python code seen in class, determine the time when the rocket reaches the speed of sound (335 m/s). Write your code in roots.py. You can copy the root-finding method code from the slides as part of your program. You can also use NumPy arrays and functions. After you write the code for the above calculation, in the same file roots.py plot a graph with the speed of the rocket on the y-axis and time on X-axis, for the time interval [0, 150). Provide appropriate titles for the two axes and the plot itself. Save this plot to disk as rocket.png using the plt.savefig(“rocket.png”) function. Do not submit the rocket.png file – when your code is run during grading, the file, if saved properly, will be automatically created at that time. (Be sure to verify that your code does produce the correct image saved on disk when run.) Finally, answer the same rocket question above (finding the time when it reaches the speed of sound), but this time do the calculation manually, on paper or on computer, using the steps shown in class. Use the Newton-Raphson method with epsilon as 10-9, the first approximation as 0, and 4 iterations. For each iteration, you should write the value of x, f(x), l'(x), and the difference between each root approximation. Include the steps in your submission under the name iterations.pdf. Your answer should be precise within 5 decimal places. Note that hard copies of your answer will not be accepted. If you decide to write down the steps by hand, you must either scan your pages into the computer, take a very legible picture with your phone or other device, or in some other way digitize the answer.

## Expert Answer

Answer to The speed u of a Saturn V rocket in vertical flight near the surface of the earth can be approximated by the following f…