Intercept of 2 moving objects at constant acceleration I have to make a simulation in which a guided missile has to hit an incoming enemy missile.The enemy missile "T" is the one which has to be intercepted and is only affected by gravity, the guided missile "P" is moving by its own acceleration which is constant in magnitude with a variable angle and is also affected by gravity. I have to find the right angle to give to the acceleration vector of the guided missile "P" in order to be able to catch the enemy missile "T".
For $t = 0$ I have this situation:
Enemy missile "T":
$x_t$ = random; $y_t$ = fixed; $v_{x,t}$ = random; $v_{y,t}$ = random; $a_{x,t} = 0$; $a_{y,t} = -9.8$;
Guided missile "P": 
$x_p$ = fixed; $y_p$ = fixed; $v_{x,p} = 0$; $v_{y,p} = 0$; $|a_p|$ = fixed; $a_{p,\theta} = 0$;
Starting from this i wrote this system of equations in which $a_{x,p}$, $a_{y,p}$ and $t$ are the variables (sorry I don't know how to write equations here).
$$x_t + v_{x,t} * t = x_p + (a_{x,p} / 2) * t^2 $$
$$y_t + v_{y,t} * t + (a_{y,t} / 2) * t^2 = y_p + (a_{y,p} / 2) * t^2$$
$$\sqrt{a_{x,p} ^ 2 + a_{y,p} ^ 2} = |a_p|$$
Now what I really need is to solve this in a symbolic way, because I have to write the results in a C program to make this computation at runtime.
I tried to solve this with Matlab and Wolfram Alpha but I'm not able to get any result. Is there something wrong in the system? Is there any better way to get the result of this problem?
 A: At the OPs request, here I suggest looking at the target and projectile as non-self propelled: once launched from their initial positions only gravity acts on them (air drag is neglected too).
Both target and projectile are assumed launched at the same time. If there is some lag $\Delta t$ between launch of target and projectile use $\text{Eq.1}$ and $\text{Eq.2}$ to calculate new initial positions for the target, then proceed from there, resetting time to $0$.
I'm using indices $1$ and $2$ resp. for target and projectile.
$$x_1=x_{1,0}+v_{1,0,x} t...\text{Eq.1}$$
$$y_1=y_{1,0}+v_{1,0,y} t-\frac{1}{2} g t^2...\text{Eq.2}$$
$$x_2=x_{2,0}+v_{2,0,x} t$$
$$y_2=y_{2,0}+v_{2,0,y} t-\frac{1}{2} g t^2$$
The objects collide when $y_2=y_1=y$ and $x_2=x_1=x$:
$$y_{1,0}+v_{1,0,y} t-\frac{1}{2} g t^2=y_{2,0}+v_{2,0,y} t-\frac{1}{2} g t^2$$
$$t=\frac{y_{1,0}-y_{2,0}}{v_{2,0,y}-v_{1,0,y}}$$
Use this expression in $\text{Eq.1}$ and $\text{Eq.2}$ to get expressions for $x$ and $y$ (the collision point).
Define the angle $\theta$:
$$\tan\theta=\frac{v_{2,0,y}}{v_{2,0,x}}$$
From Wikipedia:
$$y_2=y_{2,0}+x_2\tan\theta-\frac{gx_2^2}{2(v_2\cos\theta)^2}$$
Where $v_1=\sqrt{v_{2,0,x}^2+v_{2,0,y}^2}$
The objects collide when $y_2=y_1=y$ and $x_2=x_1=x$:
$$y=y_{2,0}+x\tan\theta-\frac{gx^2}{2(v_2\cos\theta)^2}$$
From this equation $\theta$ can be calculated but this isn't easy either. The equation can be re-worked to:
$$A\tan\theta-\frac{B}{(\cos\theta)^2}=C$$
I suggest to take this problem to MathOverflow of our network.

Edit:
If we assume that after launch the projectile motor simply provides enough force to combat gravity:

So $F=mg$, then no net forces act on the projectile and its initial velocity vector $\vec{v_2}$ is maintained and:
$$x_2=x_{2,0}+v_{2,0,x} t...\text{Eq.3}$$
$$y_2=y_{2,0}+v_{2,0,y} t$$
$$y_2=y_{2,0}+ (x_2-x_{2,0})\tan\theta$$
Combining $\text{Eq.1}$ and $\text{Eq.3}$ allows to extract $t$. Use that value to determine $x$.
Again with Wikipedia:
$$y_1=y_{1,0}+x_1\tan\alpha-\frac{gx_1^2}{2(v_1\cos\alpha)^2}$$
Where $v_1=\sqrt{v_{1,0,x}^2+v_{1,0,y}^2}$
And $\tan\alpha=\frac{v_{1,0,y}}{v_{1,0,x}}$, $\cos\alpha =\frac{v_{1,0,x}}{v}$:
At collision:
$$y_{2,0}+ (x-x_{2,0})\tan\theta=y_{1,0}+x\tan\alpha-\frac{gx^2}{2(v_1\cos\alpha)^2}...\text{Eq.4}$$
Since as all parameters except $\tan\theta$ are now known, $\tan\theta$ can be extracted from $\text{Eq.4}$.

A: I can see why Mathematica has a problem with this. The result is ugly, and does not necessary have an analytical solution. I might as well say from the start that I think your best option here is to solve the system of equations partly analytically and partly numerically.
Here goes. Instead of $a_x$ and $a_y$, I use $a$ and $\theta$ as these are more natural variables when the magnitude of the acceleration is fixed.
The two equations to solve is then
\begin{eqnarray*}
x_{t}+v_{x}t & = & x_{p}+\frac{1}{2}a_{p}t^{2}\cos\theta\\
y_{t}+v_{y}t-\frac{1}{2}gt^{2} & = & y_{p}+\frac{1}{2}a_{p}t^{2}\sin\theta
\end{eqnarray*}
We can use the first to solve for the time until impact. We basically use completion of squares and get the solution
\begin{eqnarray*}
t_{\mathrm{impact}} & = & -\frac{v_{x}}{a_{p}\cos\theta}\pm\sqrt{\frac{2\left(x_{t}-x_{p}\right)a_{p}\cos\theta+v_{x}^{2}}{a_{p}^{2}\cos^{2}\theta}}\\
 & = & \frac{v_{x}}{a_{p}\cos\theta}\left(-1\pm\sqrt{1+\frac{2\left(x_{t}-x_{p}\right)a_{p}\cos\theta}{v_{x}^{2}}}\right)
\end{eqnarray*}
This will only have one solution with $t_{\mathrm{impact}}>0$ so you choose that. Note that $t_{\mathrm{impact}}=t_{\mathrm{impact}}(\theta)$ so for every value of $\theta$ you will have a differnt solution for $t_{\mathrm{impact}}$.
Next you feed your solution $t=t_{\mathrm{impact}}$ into the second equation. This, you will not be able to solve analytically (unless some magic simplification occurs).
Instead you solve it graphically/numerically by plotting both sides of the equation as a function of $\theta$. If the functions is relatively nice you should be able to use Newton's method to solve for the desired angle.
NB: Remember to relcalulate $t_{\mathrm{impact}}$ for every new $\theta$ as that will chage.
Note that the expression for $t_{\mathrm{impact}}$ will still hold even if you introduce a gravitational pull on your projectile (as that only acts in the $y$ direction).
