First, I took the indefinite integral of equation E1 with respect to time to determine the formula for the distance of the rocket. Then, the values of 5 s, 10 s, and 30 s were inserted into the resulting distance equation to find the height of the rocket.
Figure 1: The figure above shows the velocity over time function of the rocket.
The integral of the velocity function after 5 seconds is 238.59 m. This is the analytical height of the rocket after 5 seconds.
The integral of the velocity function after 10 seconds is 995.81 m. This is the analytical height of the rocket after 10 seconds.
The integral of the velocity function after 30 seconds is 10880 m. This is the analytical height of the rocket after 30 seconds.
Part A)
The integral of the velocity function of the rocket was approximated using the six segment trapezoidal rule, Simpson's 1/3 Rule, and O(h^8) Romberg Method. To calculate the O(h^8) Romberg Solution, first the O(h^4) Romberg Solution and the O(h^6) Romberg Solution must be calculated from trapezoidal rule approximations. Therefore, I computed, one, two, four, and eight segment trapezoidal rule approximations as well.
Part B)
The acceleration of the rocket was found by approximating the derivative of the velocity function using finite divided differences. Since the times of 5, 10, and 30 seconds were significant in Part A, the derivative at the points from 0 to 30 with a step size of 5, were estimated.
Part A)
The six segment trapezoidal yielded an integral of 238.73 m, which is the approximate height of the rocket after 5 seconds. After 10 seconds, the approximate height of the rocket is 997.02 m. Lastly, the approximate height of the rocket after 30 seconds using the six segment trapezoidal rule is 10931 m.
Using Simpson's 1/3 Rule, the integral of the velocity function after 5 seconds was 238.59 m. After 10 seconds, the approximate height of the rocket is 995.84 m. Lastly, after 30 seconds, the approximate height of the rocket using Simpson's 1/3 Rule is 10897 m.
Using the O(h^8) Romberg Method, the integral of the velocity function after 5 seconds was 747.76 m. After 10 and 30 seconds, the approximate height of the rocket is 3120.9 m and 34099 m, respectively.
Part B)
The results of the derivative approximations using finite divided differences can be seen in Table 2.
Figure 2: The acceleration of the rocket over time is plotted above.
Table 1: The percent relative error for method to approximate the integral of the velocity function is shown below.
Table 2: The table below shows the analytical acceleration calculated by taking the derivative of equation E1, the numerical acceleration approximated using finite divided differences, and the percent relative error between the two.
Part C)
Simpson's 1/3 Rule produced the lowest error for the height of the rocket. The magnitude of the error was over 100 times larger for the 5 second interval for the trapezoidal rule compared to the Simpson's Rule approximation. I would prefer to use Simpson's rule in this problem due to its higher accuracy and the simplicity of the algorithm.
Finite divided differences proved to not be an effective method for approximating the derivative of the velocity function. The error of the approximation ranged from 77-80% for each time value. Therefore, I would recommend using a built-in coding function like MATLAB's diff function to find the analytical acceleration.