Non-linear root finding algorithm "not making any progress"

48 Views Asked by At

I'm trying to use an algorithmic root finder (namely, the CERN ROOT https://root.cern.ch implementation of the GNU Scientific Library's MultiRootFinder) to solve for the unknowns, $x$ and $y$, in the following system:

enter image description here

This system describes the solution to a localization problem (about which I've posted before). That is, given the coordinates, $[x_i,y_i]$, of three parties, the velocity $s$ of some signal, and the time, $t_i$, at which each party "saw" the signal, I want to determine the coordinates, $[x,y]$, of the source. This is a 2D solution as, in this case, we can assume the three parties and the observer to be coplanar.

Since I want to solve for only two unknowns (and since the root finder complains if I provide all three), I've fed the algorithm the first two equations. I then chose the initial point to be the center of the circle circumscribed by the three parties (although, notably, I know the source to be outside of this circle). I then set the iterations to the maximum possible value.

What I get is the error "root finder not making any progress". I'm quite certain this is an issue of the mathematics, as opposed to some issue with the code. So, what mistake have I made here?

Apologies if this is a basic question. I'm quite unfamiliar with this topic.

1

There are 1 best solutions below

0
On

The problem could just be that the initial guesses are not sufficiently good.

What I suppose is that the initial equations are $$\sqrt{(x-x_1)^2+(y-y_1)^2}=s(t_1-t)\tag 1$$ $$\sqrt{(x-x_2)^2+(y-y_2)^2}=s(t_2-t)\tag 2$$ $$\sqrt{(x-x_3)^2+(y-y_3)^2}=s(t_3-t)\tag 3$$ where the $t_i$'s are the real times and $t$ the time at which the signal was observed.

In a preliminary step, rewrite these squaring $$(x-x_1)^2+(y-y_1)^2=s^2(t_1-t)^2\tag 4$$ $$(x-x_2)^2+(y-y_2)^2=s^2(t_2-t)^2\tag 5$$ $$(x-x_3)^2+(y-y_3)^2=s^2(t_3-t)^2\tag 6$$ Subtract $(4)$ from $(5)$ and $(6)$, expand and simplify to get $$2(x_1-x_2)x+2(y_1-y_2)y+2s^2(t_2-t_1)t=(x_1^2+y_1^2-s^2 t_1^2)-(x_2^2+y_2^2-s^2 t_2^2)\tag 7$$ $$2(x_1-x_3)x+2(y_1-y_3)y+2s^2(t_3-t_1)t=(x_1^2+y_1^2-s^2 t_1^2)-(x_3^2+y_3^2-s^2 t_3^2)\tag 8$$ Solve $(7)$ and $(8)$ for $x$ and $y$ (these are two linear equations). The resulting solutions $x$ and $y$ are functions of $t$. Plug these results in $(4)$, $(5)$ or $(6)$ to get a quadratic in $t$; for sure select the root which is smaller that the minimum of $(t_1,t_2,t_3)$.

Now, you should be ready for solving $(1)$, $(2)$ and $(3)$ for $x$, $y$, and $t$.

However, instead of using an equation solver, I would prefer to use a minimizer.

For illustration purposes, consider the following data (with $s=343$) $$\left( \begin{array}{ccc} i & x_i & y_i & t_i \\ 1 & 100 & 150 & 1.3685 \\ 2 & 200 & 150 & 1.0777 \\ 3 & 300 & 100 & 0.7876 \end{array} \right)$$

The above procedure leads to $t=0.1911$, $x=503.08$, $y=124.96$. The optimization leads to almost identical results.

The data were generated using $x=500$, $y=125$, $t=0.2$ and the times were rounded to four decimal places.