I have a system of 6 equations for 8 variables. There are many solutions. I want a solution that minimizes $x_1^2 + x_2^2 + ... + x_8^2$.
Is there a formulaic method to solve this?
(Application: 8 motors in an octocopter. Thrust and torque for each motor is approximately linear with throttle/RPM. Power consumption is quadratic with respect to throttle. Achieve a given combined thrust+torque, with minimal power.)
You wish to find the solution to the linear system $Ax=b$ with minimal norm, $\|x\|_2$. Assuming the rows of $A$ are linearly independent, this problem has a unique solution. The solution to this problem is given by $x = A^+b$, where $A^+$ is the Moore-Penrose pseudo-inverse of $A$. You matrix $A$ has more columns than rows. Assuming the rows are linearly independent, the pseudo-inverse can be written as $$A^+ = A^T(AA^T)^{-1},$$ where $A^T$ denotes the matrix transpose of $A$. There are routines to compute this in more stable ways in basically all linear algebra libraries.