Q8.4.3Determining the initial angle of a projectile's motion
The trajectory of a projectile in the \(xz\)-plane launched from the origin at an angle \(\theta_0\) from the (horizontal) \(x\)-axis with speed \(v_0 = 25\;\mathrm{m\,s^{-1}}\) is
Derivation
During its flight, the projectile is subject to a constant acceleration \(\ddot{\boldsymbol{r}} = -g\hat{\boldsymbol{k}}\). Integrating,
where \(\boldsymbol{v_0} = (v_0\cos\theta)\hat{\boldsymbol{i}} + v_0(\sin\theta)\hat{\boldsymbol{k}}\) and \(\boldsymbol{r_0}=0\) (the projectile starts at the origin).
Therefore, \(x = v_0t\cos\theta\) and \(z = v_0t\sin\theta - \frac{1}{2}gt^2\). Eliminating \(t\) from these expressions gives the formula for \(z\) above.
If the projectile passes through the point \((5, 15)\), use Brent's method to determine the possible values of \(\theta_0\).
Show solution
In general, there are two (physically distinct) possible angles \(\theta_0\) corresponding to the projectile passing through the specified point, \((x_1, y_1) = (5,15)\), on the way up or on the way down. These values are the roots in \((0, \pi/2)\) of the function
After bracketing the roots with a rough plot of \(f(\theta_0)\), we can use brentq:
In [x]: g = 9.81
In [x]: v0, x1, z1 = 25, 5, 15
In [x]: f = lambda theta0, x1, z1: x1 * np.tan(theta0) - g / 2\
* (x1 / v0 / np.cos(theta0))**2 - z1
In [x]: th1 = brentq(f, 1, 1.4, args=(x1,z1))
In [x]: th2 = brentq(f, 1.5, 1.6, args=(x1,z1))
In [x]: np.degrees(th1), np.degrees(th2)
Out[x]: (74.172740936822834, 87.392310240255171)
That is, \(\theta_0 = 74.2^\circ\) or \(\theta_0 = 87.4^\circ\).