Solving a matrix equation where the elements of a vector sum to zero

187 Views Asked by At

I am currently trying to solve a problem where the terms are given as:

$$ \mathbf{R}_{ij}\mathbf{c}-dT = \mathbf{z},\\ T'\mathbf{c}=0 $$

where $\mathbf{R}_{ij}$ is a $n \times n$ matrix, $\mathbf{z}$ is a vector of length $n$ and $T$ is equal to $(1,...,1)'$, we are solving for $\mathbf{c}$ and $d$ which is a vector of length $n$ and a scalar value respectively. The values for $\mathbf{R}_{ij}$, and $\mathbf{z}$ are known.

I am assuming that $T'\mathbf{c}=0$ means that all of the elements of $\mathbf{c}$ sum to zero, at first glance, this system of equations should be easily solvable in MATLAB, but I can't quite figure it out; it seems to me that the second equation would allow for an infinite amount of possible values for $\mathbf{c}$.

Can somebody guide me in the right direction or is my understanding of the problem flawed?

2

There are 2 best solutions below

1
On BEST ANSWER

Your problem is equivalent to

$$\begin{bmatrix} R_{ij} & -T \\ T' & 0\end{bmatrix} \begin{bmatrix} c \\ d\end{bmatrix} =\begin{bmatrix} z \\ 0\end{bmatrix} $$

It has $n+1$ equations and $n+1$ unknowns, it is unclear how many solutions are there from the information that is given to us.

For example you can let $R_{ij}$ be a $2 \times 2$ identity matrix and the system is nonsingular.

0
On

Let's use the convention that uppercase Latin characters are matrices, lower case are vectors, and greek letters are scalars, and use $(1,\beta)$ in place of $(T,d)$.

Let's also define two vectors in terms of the known quantities $$\eqalign{ y &= R^{-1}z \cr w &= R^{-1}1 \cr }$$ Then the solution for the vector variable is simple $$\eqalign{ Rc - \beta 1 &= z \cr Rc &= z+ \beta 1 \cr c &= y +\beta w \cr }$$ Applying the constraint yields a unique solution for scalar variable $$\eqalign{ 1^Ty +\beta 1^Tw = 1^Tc &= 0\,\,\,\,\implies \beta &= \frac{-1^Ty}{1^Tw} \cr }$$ Putting it all together $$c = y-\bigg(\frac{1^Ty}{1^Tw}\bigg)w$$