Solving a system of a system of equations, numerically.

numerical methodssystems of equations

I have a system of 4 systems of equations.

$$\begin{align*}
C – 0 &= 1.02 \\
C – F &= 0.45 \\
C – N &= 0.24 \\
C – I &= -0.21 \\
\end{align*}$$

$$\begin{align*}
F – 0 &= 0.59 \\
F – C &= -0.45 \\
F – N &= -0.20 \\
F – I &= -0.68 \\
\end{align*}$$

and so on.

Obviously, I can just say that $C = 1.02, F = 0.59$. But then $C – F = 0.43$, not $0.45$, as the second line indicates. Is there a way to solve for the best approximation for $C, F, N, I$, or am I better off not wasting my time and just going with $C = 1.02$, etc.?

I've tried setting up a matrix equation for each system, and solving the normal equations symbolically in Matlab, but that didn't work out too well.

Thanks!

Best Answer

We can arrange all the equations in a whole system in the form $Ax=b$ with $x=(C,F,N,I)$ and solve by least-squares method

$$A^TA\hat x=A^Tb \implies \hat x =(A^TA)^{-1}A^Tb$$

Related Question