Minimization problem of parametric equations in ballistics (minimum projectile speed)

calculuskinematicsoptimizationprojectile motion

I am trying to solve a minimization problem for a physics simulation in Unity 3D. In short, a projectile is fired at a certain position with a certain velocity, and experiences a constant acceleration (in the 3 axis directions) due to gravity/wind. I want the projectile to hit a moving target with any amount of time derivatives of position (acceleration, jerk, snap, crackle, etc.).

By expanding the initial condition differential equations, we can use a Taylor expansion to model the trajectories of both objects (that is the method I am using, someone on Physics StackExchange questioned it as if it were bad? If someone has a better solution, please offer suggestions). Therefore, by letting all the variables be the initial conditions at time $0$, here are the kinematic equations:

Projectile: $$x_p(t) = x_p+v_p t + \frac{1}{2}a_p t^2$$
($v_p$ is the unknown we are searching for.)

Target: $$x_t(t) = \sum_{k=0}^{n} \frac{x^{(k)}_t t^k}{k!}$$

As I mentioned, the variables without an input parameter are initial conditions with $t = 0$. The movement conditions are all 3D vectors, while time is a scalar parameter.
We want the 2 objects to intersect, so we impose the equation

$$x_p(t) = x_t(t)$$
$$x_p+v_p t + \frac{1}{2}a_p t^2 = \sum_{k=0}^{n} \frac{x^{(k)}t^k}{k!}$$

At this stage I am unsure how to proceed. We are trying to minimize the projectile speed for given initial conditions: therefore, I tried a few different things.

When setting up an Euler-Lagrange equation with $L(t,\dot{x}, \ddot{x})$, everything cancelled out to $0=0$, no useful result.

Also, I had tried to compare coefficients of the polynomials in a previous post, but that solution didn't seem to work. If anyone could explain why, that would be appreciated.

Is there a fast numerical solution, or perhaps an alternative, more clever analytical solution to this problem?

Best Answer

(i) Since the unknown vector $\vec v_p $ satisfies an equation of the form $\vec v_p t = \sum_{k=0}^n \vec c_k t^k$ in which each $\vec c_k$ is a known constant vector, you can write $\vec v_p = t^{-1} \sum_{k=0}^n \vec c_k t^k$. Denote the right-hand side as $\vec R(t)$ and treat it as a known parametrized particle path in 3-space.

(ii) Your goal is to find the value of $t>0$ that minimizes the squared length $L^2 = ||\vec R(t)||^2$. If you visualize the trajectory traced by $\vec R(t)$ as a smooth space curve, then it is clear that $L$ is the radius of a sphere centered at the origin that can be drawn tangent to this curve. Imagine temporarily that the space curve is parametrized by its arclength. Then at the critical time where the curve contacts this critical sphere, the velocity vector $\vec T= \vec R'$ is perpendicular to the radius vector $\vec R$. This scalar equation $\vec R \cdot \vec R'=0$ can be solved for the unknown scalar $t$. Thus you now know the critical value of $\vec R$ and of $L$ which is a candidate for the absolute minimum.

(iii) Thus we have reduced the problem to solving a single scalar equation, and that equation (after a bit of massaging) can be re-written as a polynomial in $t$. Newton's method is the standard numerical algorithm for solving such polynomial equations when the degree exceeds two. Or you may have access to a built-in root-solver.

Related Question