I have a system of $n$ equations which follows a particular pattern as follows (showing the case $n=3$):
$$\phi = a_1 + \psi_2 a_2 + \psi_3 a_3 \\ \phi = \psi_1 a_1 + a_2 + \psi_3 a_3\\ \phi = \psi_1 a_1 + \psi_2 a_2 + a_3$$ The scalars $\phi$ and the $a_i$ are known, and I need to solve for the $\psi_i$. All scalars are $\in \mathbb{R}$.
So I am trying to rewrite it into a matrix equation, and getting mixed up with constructing the matrix, and then solving, somewhat similar to this and this previous questions.
So I've got this far: $$\phi \begin{Bmatrix} 1\\1\\1 \end{Bmatrix} = \begin{bmatrix} 1 & \psi_2 & \psi_3 \\ \psi_1 & 1 & \psi_3 \\ \psi_1 & \psi_2 & 1 \end{bmatrix} \begin{Bmatrix} a_1\\a_2\\a_3\ \end{Bmatrix} $$ which more generally can become: $$\phi\boldsymbol{\unicode{x1D7D9}}_{n\times 1} = \boldsymbol{\Psi}_{n\times n} \boldsymbol{a}_{n\times 1}$$ so to solve for the vector $\boldsymbol{\psi} = \left[\psi_1, ..., \psi_n\right]^T$ and inspired by this I try to decompose $\boldsymbol{\Psi}$ as follows:
$$ \boldsymbol{\Psi} = \left[ \textrm{diag}(\boldsymbol{\psi} )(\boldsymbol{\unicode{x1D7D9}}_{n\times n}) - \boldsymbol{I}_{n\times n}\right]^T + \boldsymbol{I}_{n\times n} $$ but this both feels messy, and also doesn't seem to make finding $\boldsymbol{\psi}$ any easier. The system might also be overdetermined.
Any ideas appreciated!
If I understand you correctly, your matrix is
$$ 0 \psi_1 + a_2 \psi_2 + a_3 \psi_3 = \phi -a_1\\ a_1\psi_1 + 0 \psi_2 + a_3 \psi_3 = \phi -a_2\\ a_1 \psi_1 + a_2 \psi_2 + 0 \psi_3 = \phi -a_3$$
Using Gaussian Elimination, we arrive at
$$\begin{bmatrix} 1 & 0 & 0 & \dfrac{a_1-a_2-a_3+\phi}{2 a_1}\\0 & 1 & 0 & \dfrac{-a_1+a_2-a_3+\phi}{2 a_2} \\ 0 & 0 & 1 & \dfrac{-a_1-a_2+a_3+\phi}{2 a_3} \end{bmatrix}$$
Note that any $a_i$ equal to zero causes issues.