# Solving a small polynomial system

I have a small system of 6 equations. These contain 6 unknowns, and I've been trying to figure out how to solve them. I feel I could handle fewer equations by a bit of high-school algebra, but once it gets up to 6 I'm reaching the limit on what I find practical to do by hand.

I found a few websites that claim to be able to solve this type of equation (eg. this one), however while they can get some of the way and deal with simplified versions of the problem, none seem to be able to solve the whole thing.

The problem itself is a rendevous of two objects in 2D space, given a starting displacement and relative velocity. One object is accelerating at a constant rate. I've assumed this acceleration has two phases: accelerating in one direction for a time (prograde) then accelerating in another (retrograde).

The aim is to match the location and velocity of the objects. In the trivial case (no starting displacement or velocity) this would be done by accelerating toward the target until half-distance, then accelerating away from it. I've chosen a co-ordinate system where the axes are parallel and perpendicular to the initial relative velocity. Given that the set of equations I've come to is as follows:

1) $d_1 = (p_1t_p^2 + r_1t_r^2) / 2 + p_1t_pt_r + v(t_p+t_r)$

2) $d_2 = (p_2t_p^2 + r_2t_r^2) / 2 + p_2t_pt_r$

3) $-v = (p_1t_p+r_1t_r)$

4) $0 = (p_2t_p+r_2t_r)$

5) $a = \sqrt(p_1^2 + p_2^2)$

6) $a = \sqrt(r_1^2 + r_2^2)$

Where subscripts 1 and 2 denote parallel and perpendicular to the initial velocity vector respectively. $d$ is the starting displacement, $v$ the starting velocity, $p$ the prograde acceleration, $r$ the retrograde acceleration, $t$ the prograde/retrograde times and finally $a$ is the magnitude of the acceleration. The unkowns are $p_1$, $p_2$, $r_1$, $r_2$, $t_p$ and $t_r$.

How can I solve these equations? Are there any useful tools for this sort of problem beyond substitution/elimination?

• By squaring you obtain a system of polynomial equations. This can be "solved" by Groebner bases, if the system is not too complicated. – Dietrich Burde Nov 19 '17 at 16:20

Start with a little simplification: Divide all of your unknowns by $a$, $v$ by $a^2$ and $d_1, d_2$ by $a^3$. Then also divide $t_r, t_p$ by $-v$ and $d_1, d_2$ by $v^2$. Then your 6 equations become:

1. $2d_1 = p_1t_p^2 + r_1t_r^2 + 2p_1t_pt_r - 2(t_p+t_r)$
2. $2d_2 = p_2t_p^2 + r_2t_r^2 + 2p_2t_pt_r$
3. $1 = (p_1t_p+r_1t_r)$
4. $0 = (p_2t_p+r_2t_r)$
5. $1 = p_1^2 + p_2^2$
6. $1 = r_1^2 + r_2^2$

Equations 5 and 6 tell us that there exist $\theta, \phi$ with $$p_1 = \cos\theta, \quad p_2 = \sin\theta\\r_1 = \cos\phi, \quad r_2 = \sin\phi$$

Now look at 3 and 4: treating the $p$s and $r$s as knowns and applying gaussian elimination, we get $$t_p = \frac{r_2}{r_2p_1 - r_1p_2} = \frac{\sin \phi}{\sin\phi\cos\theta-\cos\phi\sin\theta} = -\frac{\sin\phi}{\sin(\theta - \phi)}$$ $$t_r = \frac{p_2}{p_2r_1-p_1r_2} = \frac{\sin \theta}{\sin\theta\cos\phi-\cos\theta\sin \phi} = \frac{\sin\theta}{\sin(\theta - \phi)}$$

Substituting all of this into 1 and 2, and multiplying through by $\sin(\theta - \phi)^2$, we get: $$2d_1\sin(\theta - \phi)^2 = \cos\theta \sin^2\phi + \cos\phi\sin^2\theta + 2\cos\theta\sin\theta\sin\phi - 2(\sin\phi + \sin\theta)$$ $$2d_2\sin(\theta - \phi)^2 = \sin\theta\sin^2\phi + \sin\phi\sin^2\theta + 2\sin^2\theta\sin\phi$$

Which is still a nasty batch of trig to simplify, but at least now you are down to two equations in two unknowns.