# How to solve nonlinear system generated from $(x_i - x_j)^2 \approx f_{ij}$

Looking for advice/help with solving a nonlinear system generated from the equation:

$(x_i - x_j)^2 \approx f_{ij}$ where $\textbf(X) = (x_1,x_2,x_3,...,x_n)$, $f_{ij}$ are known, solve for $\textbf(X)$

If $(x_1, \dotsc, x_n)$ is a solution, also $(x_1+t, \dotsc, x_n+t)$ is a solution for every $t \in \mathbb{R}$. So you can assume $x_1=0$. From this you get $x_j = \pm \sqrt{f_{1j}}$ for every $j = 2,\dotsc, n$. Then you can choose the right signs looking at the other equations one by one, starting from $f_{23},f_{34}, \dotsc$
Note that this needs a lot of compatibility conditions on the $f_{ij}$, so for most choices of $f_{ij}$ there is no solution.
• That is a very helpful answer, thank you. If in the case there is no solution given the set of $f_{ij}$ is there a way to find an optimal solution which minimizes the error . e.g. $(x_i - x_j)^2 \approx f_{ij}$ ? Feb 28, 2016 at 23:31