How can I solve the following system of nonlinear equations?
$$\begin{split}f_{k}=&\\ &a_1^2(p_{k}s_1+q_{k}s_2+r_{k}s_3)(2x_i+p_{k}s_1+q_{k}s_2+r_{k}s_3)+\\ &a_2^2(p_{k}s_4+q_{k}s_5+r_{k}s_6)(2y_i+p_{k}s_4+q_{k}s_5+r_{k}s_6)+\\ &a_3^2(p_{k}s_7+q_{k}s_8+r_{k}s_9)(2z_i+p_{k}s_7+q_{k}s_8+r_{k}s_9)=0\end{split}$$
where:
- $k = 1, \cdots, 2256$
- $p_k, q_k, r_k$ are known
- $x_i, y_i, z_i$ with $i=1, \cdots, 50$
- $s_j$ with $j=1, \cdots, 9$
- $a_j$ with $j=1, 2, 3$
are all unknown (total of 162 unknowns).
I have tried MATLAB fsolve function with levenberg-marquardt method which resulted into a solution which is not realistic. I have defined both the function and its Jacobian and passed to fsolve. Is there a better method of solving such a system? Is there any way to better pose the problem?
You could try gradient descent.
Btw setting all the a values to zero seems to work