I have an equation in the form of Q*d=z, where Q is 3by3 matrix of variables, and d and z are vectors of 3 known numbers. What would be the best way to compute all 9 elements of matrix Q, provided that i know the approximate values for all 9 elements?
Determine 9 variables by 3 equations with approximation
64 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
A good method is Lagrange Multipliers. Though in this case it is a bit complicated.
Suppose $$Q=\left[\begin{array}{ccc}a+\alpha&b+\beta&c+\gamma\\d+\delta&e+\epsilon&f+\zeta\\g+\eta&h+\theta&i+\iota\end{array}\right]$$
Let $d$ be the vector $(p,q,r)$ and $Z=(x,y,z)$.
The Lagrange expression is
$$L = \alpha^2+\beta^2+\gamma^2+...+\iota^2+...\\
\lambda(p(a+\alpha)+q(b+\beta)+r(c+\gamma)-x)+...\\
\mu(p(d+\delta)+q(e+\epsilon)+r(f+\zeta)-y)+...\\
\nu(p(g+\eta)+q(h+\theta)+r(i+\iota)-z)$$
$L$ is a function of eleven unknowns $\alpha,...,\iota,\lambda,\mu,\nu$.
Differentiate $L$ with respect to all eleven variables. All eleven derivatives should equal zero. You get eleven linear equations in eleven variables.
On
It is an ill defined problem and the OP has not much thought about a good presentation. The Michael's solution consists in minimizing the squared error, method also indicated in Andre's post. There are $12 $ unknowns and $12$ relations ($9$ derivatives and the relation $Qd=z$). We can write the equations in compact form (for any dimension $n$) as follows. $Q_0$ is the approximated solution.
We minimize $\phi(Q)=tr((Q-Q_0)^T(Q-Q_0))$ under the linear condition $Qd-z=0$. Then $\nabla\phi(Q)=2(Q-Q_0)$ and the Lagrange's equalities are $Q-Q_0+\begin{pmatrix}\lambda_1 d^T\\\cdots\\\lambda_n d^T\end{pmatrix}=0$.
Finally, the $(\lambda_i)_i$ are defined by $Q_0d-z=\begin{pmatrix}\lambda_1||d||^2\\\cdots\\\lambda_n||d||^2\end{pmatrix}$ and $Q=Q_0-\begin{pmatrix}\lambda_1 d^T\\\cdots\\\lambda_n d^T\end{pmatrix}$.
First off, since your variables are in $Q$, you can consider each row independently . $$q_{i1}d_1+q_{i2}d_2+q_{i3}d_3=z_i.$$ Let's drop the row index $i$ for brevity. $$q_{1}d_1+q_{2}d_2+q_{3}d_3=z.$$ You already have approximate values, let's call them $\hat q_1, \hat q_2, \hat q_3$. If you put them into your equation you get an approximate $\hat z$: $$\hat z = \hat q_{1}d_1+ \hat q_{2}d_2+ \hat q_{3}d_3.$$ Since you want to get $z$ exactly, you have to offset the error $r = z - \hat z$. $$ z = \hat z + r = \hat q_{1}d_1+ \hat q_{2}d_2+ \hat q_{3}d_3 + r.$$ You could distribute this error equally among all 3 variables as: $$q_i = \hat q_i + \frac{1}{3d_i}r.$$ Alternatively, you can try to find the solution that minimizes the squared error $$(q_1-\hat q_1)^2+(q_2-\hat q_2)^2+(q_3-\hat q_3)^2$$.