# Matrix and vectors operations

1. Jun 20, 2012

### chepa

Hey guys,

I would need to isolate S (solve for S knowing all other terms) in this equation made of Matrix (B, I and S), of vector (x and y) and of constant &.

x = - ([(B-I)S -(I/&)]^-1) (y/&)

Someone could help me?

Chepa

2. Jun 20, 2012

### meldraft

Let's call "c" your constant "&":

$$x=-((B-I)S-\frac{I}{c})^{-1}\frac{y}{c}$$

Then

$$((B-I)S-\frac{I}{c})x=-((B-I)S-\frac{I}{c})((B-I)S-\frac{I}{c})^{-1}\frac{y}{c}=-\frac{y}{c}$$

$$(B-I)Sx-\frac{I}{c}x=-\frac{y}{c}$$
$$(B-I)Sx=-\frac{y}{c}-\frac{I}{c}x$$
$$Sx=(B-I)^{-1}(-\frac{y}{c}-\frac{I}{c}x)$$

Since x is a vector, this is a system of equations. As far as I remember, the existence of an "inverse vector" that satisfies the equation is not guaranteed, so you cannot simply solve for S. What you can do is solve the system and find the elements of S. Notice that S is a matrix whereas x is a vector. This gives you n equations for $n^2$ elements of S, which means that there is a family of matrices that satisfy that equation. If you assume e.g. that all elements of S except for the diagonal are 0, then you might find an answer.

3. Jun 20, 2012

### chepa

Hi meldraft,
actually the matrix S is a diagonal matrix and all other parameters of that equations are known. That being said, my "matrix solving skills" are rather deficient. That would be great if you could tell me a little more on the method or the way I should put things in place to solve this.

Thanks a lot anyway,

Chepa

4. Jun 20, 2012

### AlephZero

If S is diagonal, the product Sx is the vector
$$\begin{bmatrix} S_{11}x_1 \\ S_{22}x_2 \\ \cdots \\ S_{nn}x_n \end{bmatrix}$$

So if work out the right hand side of post #2 and call it vector z, you have the equations
\begin{align} S_{11}x_1 &= z_1 \\ S_{22}x_2 &= z_2 \\ \cdots & \cdots \\ S_{nn}x_n &= z_n \end{align} which are easy to solve, if the solution exists. If you have $x_i = 0$ and the corresponding $z_i \ne 0$ for some value(s) of $i$, there isn't a solution. If $x_i = z_i = 0$, the corresponding $S_{ii}$ is arbitrary.

5. Jun 21, 2012

Thanks