Finding the angle at which a ball should be thrown to pass through a given coordinate

59 Views Asked by At

A man standing at the origin of a coordinate system throws a ball with the initial speed $v_0 = 15$ m/s from a height of $1.4$ m. The throw is made at a 60° angle in the $xz$-plane and a $-15°$ angle in the $xy$-plane according to the below figure.

trajectory of a ball

The man attempts to hit an object located at the coordiante $(x, y, z) = (6.0, 2.0, 3.5)$.

The differential equations describing the ball's trajectory are $$\ddot{x}=-q \dot{x}, \quad \ddot{y}=-q(\dot{y}-a(z)), \quad \ddot{z}=-9.81-q \dot{z},$$ $$\text { where } q=c \sqrt{\dot{x}^{2}+(\dot{y}-a(z))^{2}+\dot{z}^{2}}, \: c = 0.070, \: \text{and} \: a(z) = 7 + 0.35z.$$

What numerical method could be used to find the angles in the $xz$-plane and $xy$-plane that result in the ball passing through $(6.0, 2.0, 3.5)$? For example, is it possible to construct a multivariate interpolant to a set of points generated by solving the differential equations and then use multivariate Newton's method on the interpolant to find angles that almost result in the ball passing through the given point? If it is possible to construct such an interpolant, how can one do this?

I have already solved this problem by taking a naïve approach in which I iteratively compute the angles that make the ball pass through $(6.0, 2.0, 3.5)$ by using the below formula $$\theta_3 = \arcsin\Big(\sin(\theta_1) + \frac{\sin{\theta_2} - sin{\theta_1}}{x_2 - x_1} (x_{\text{correct}} - x_1)\Big)$$

and then finding the new $y$ and $z$ coordinates of the ball at $x = 6.0$ by solving the above differential equations when pluging in the new angle. This approach lead to me to find the angles $$(\theta_{xy}, \theta_{xz}) = (0.12463568358759607, 0.5513118629221305)$$ which, when pluged in to the differential equations, result in the ball passing through $$(x, y, z) = (5.999900256229058, 2.0006304797039323, 3.499964095635448).$$

For my purposes, this level of accuracy is good enough. Nevertheless, it took 30 iterations (i.e. the ball had to be thrown 30 times) to arrive at these angles. I think there exist more efficient ways of solving this problem and am eager to learn them.