due 9/26/2024 before midnight via Learning Suite 25 possible points
An aircraft, traveling at supersonic speeds, will produce oblique shock waves. The equation relating the incoming Mach number \(M\), to the shock wave angle \(\beta\), and the turning angle \(\theta\) is shown in the figure and equation below (you don’t really need to know any of these details, just giving some context). Typically, we know the incoming Mach number from the speed of the aircraft and the turning angle \(\theta\) from the shape of the vehicle, and want to solve for the shock angle \(\beta\). The equation below cannot be solved explicitly for \(\beta\). It is an implicit equation in \(\beta\) and so we need to use a root-solver.
From the flow physics we know the minimum and maximum angles:
\[\beta_{min} = \sin^{-1}\left(\frac{1}{M}\right)\\ \beta_{max} \approx 64^\circ\]If \(\theta\) = 15 degrees, and \(M = 2\), find \(\beta\) using scipy.root_scalar
.
Write your own version of Newton’s method that iterates until the change in \(x\) from one step to the next is less than \(10^{-6}\). Since we need to provide derivative of the input function, we’ll use a simple function: \(f(x) = x^3 - 3x^2 + x - 1\). Report the root. Try several different starting points and notice the number of iterations and its robustness (or lack thereof) in converging to a solution.
A simplified representation of the lift distribution along an aircraft wing (force per unit length) can be integrated to find the total lift force:
\[L = 4\int_{-0.5}^{0.5} \sqrt{1 - 4 x^2} dx\]Integrate this using np.trapz
(or np.trapezoid
depending on your version of numpy) for a range of linspace discretization points demonstrating convergence (show a plot with number of discretization points on x-axis and the integral on y-axis). Also evaluate the integral using scipy.integrate.quad
and compare the result (add a dashed line to the plot with the resulting integral).
An accelerometer is placed on the first stage of a rocket launch. The results are in file accel.dat (may need to right click and save as), which has two columns: time (s) and acceleration (m/s\(^2\)) starting from rest. Numerically integrate to find velocity as a function of time. Make a figure with two subplots, with velocity vs. time on top and acceleration vs. time on bottom (see this example of pyplot.subplot, although you should label your axes). Why is the velocity data less noisy than the acceleration data?