0

I am trying to find the constants $a,b,c,d$ in the equation $ax+by+cz=d$ but only know the values of $x,y,z$.

I tried to write it as using matrices as $Ax = B$ where the matrix $A$ is the known values of $x,y,z$, the constants matrix $x=[a, b, c]^T$, and $B$ is a matrix with only values of $d$ equal in rows to $A$.

$A = [2, 0, 1; 1, -1, 1; 1, -2, 2; 2, -1, 2]$

Please let me know if this can be done in general so I can use it to solve given other values of $x,y,z$.

mojojojo
  • 293
  • 2
    Sounds like you’re trying to do something like this. – amd Mar 27 '20 at 05:09
  • If you’re working with real-world noisy data, once you have more than three points you run the risk of the problem becoming overconstrained—the system of equations will become inconsistent. In that case you’ll need to resort to some sort of best-fit solution. – amd Mar 27 '20 at 06:12
  • @amd that's just what I was looking for! Thanks so much! – mojojojo Mar 27 '20 at 15:00

1 Answers1

1

It seems that you have a few points that satisfies the equation and you are trying to find $a,b,c,d$.

Note that if $ax+by+cz=d$ then we have $ax+by+cz-d=0$

That is for each data point, we have $(x_i, y_i, z_i, -1)^T(a,b,c,d)=0$.

$A = \begin{bmatrix}2 & 0 & 1 & -1 \\ 1& -1& 1 & -1 \\ 1& -2& 2 & -1 \\ 2 & -1& 2 & -1\end{bmatrix}, x=(a,b,c,d)^T$ and $B$ is the zero vector.

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149