4

How to solve matrix equation $AXH+AHX−BH=0$? All matrices are square, $A$, $B$ known constant matrices and invertible, $H$ can take any value, $X$ represent the solution to be found.

I have seen about the Sylvester Equation like in this post Solving a matrix equation $AX=XB$ in a CAS, but I'm not sure how to apply it because of the presence of matrix H.

4 Answers4

3

The equation is still linear in $X$, that means that if you consider $X$ a vector, call it $\Xi$ (made up of all the entries of the matrix $X$ in a definite order) you can write it in the form

$$ Q\Xi = W $$ where $W$ is the vector likewise made of the entries of the matrix $BH$. Now the problem reduces to finding $Q$ and its inverse (you should check if $Q$ is invertible, it is not obvious to me that it will be).

The matrix $Q$ represents the action of $A$ and $H$ over $X$ sometimes acting on the left and sometimes on the right. I you call the right-acting operator $^R$ and the left one $^L$ then in fact you have $Q = A^L \otimes H^R + (AH)^L \otimes {\bf 1}^R$ and you can write the matrix as a tensor product, and then invert it. To simplify matters you could also start multiplying your equation on the left by $A^{-1}$, but the method to solve remains the same. Your answer is then $\Xi = Q^{-1} W$ which you can map back to $X$ in matrix form.

  • Thanks Rogelio, sorry I have edited the post, maybe you can check it again and let me know your opinion. Thanks. – Gina Torres Oct 10 '13 at 15:44
  • Well, even with the new version it is still true that you can proceed in the same manner by finding $W$, then $Q$ then $\Xi$ and finally $X$. Changing to the base where $H$ is diagonal will not really help because we do not know that $X$ will be diagonal in such case, we end up having to solve a linear system anyway, which we could have done earlier inverting $Q$ – Rogelio Molina Oct 10 '13 at 20:33
  • I didn't have any previous knowledge of tensor matrix, but i have do some research after you give me your answer, but I have a question respect to $$Q=A^R⊗H^L−(AH)^R⊗1^L$$ It shouldn't be something like $$Q=A^L⊗H^R+(AH)^R⊗1^L$$? And when you say (AH)^R should I assume a different form for AH or the matrices are the same $$AH=(AH)^{R}$$?. How do I know who is W if H can take any value? and finally if A is a identity matrix, because if it actually that. Should the tensor be $$H^R⊗1^L+H^L⊗1^L$$ if I am right in the previous question? – Gina Torres Oct 11 '13 at 09:42
  • Actually it should be a + sign, I edited the answer. No matter what $H$ is, you can compute $W$ by multiplying arbitrary unknown components of $H$ by known components of B. The actual problem is that you don't know a priori if $Q$ will be invertible for any $H$, I don't think it will be. If $Q$ is non invertible the system has no solution. To obtain the components of $Q$ from the components of $H$ you may use collective indices that label the tensor product (index is labeled by two letters $ij$) you have the matrix $Q_{ij,kl} = H_{ik}\delta_{jl} + H_{jl}\delta_{ik}$ – Rogelio Molina Oct 11 '13 at 20:03
  • $AH$ has the same matrix form as $(AH)^R$, but the $^R$ is just to emphasize that it acts on the right, it is just the order I chose for the tensor product, i.e. $D\otimes G$, $D$ acts always on the left and $G$ on the right. The form you gave for the case $A= {\bf 1}$ is correct: $H^R\otimes 1^L+H^L\otimes 1^L$. I changed the roles of $^R,^L$ in my answer above as they were mixed up, now they're fine. – Rogelio Molina Oct 11 '13 at 20:14
  • I found just one particular solution for X putting an specific value to H and what I did for Q was $$Q=H⊗1^L+1^L⊗H^{T}$$, but with other values of H it doesn't work, I mean XH+HX-BH=0 (because A is identity) just with the particular H I have chosen. So what can I conclude? Numerically matrices are: $$B=\begin{pmatrix} 0.5287 & 0.2708 \ -0.9522 & -0.4732\end{pmatrix}$$, The H matrix which I choose is $$H=\begin{pmatrix} 1 & 0 \ 0 & 2\end{pmatrix}$$. – Gina Torres Oct 14 '13 at 10:55
  • There seems to be some mix up with the way in which $Q$ is defined. $^T$ usually stands for the transpose, but you should take no transposes anywhere. I will write the details with the particular matrices you have given, but this will be in a few hours. The point is inverting $Q$ which will be a $4\times 4$ matrix, this can be done numerically also, provided $Q$ is invertible, that will not be a problem for the $H$ you have given. – Rogelio Molina Oct 14 '13 at 11:51
  • Yes T is the transpose, I actually did $$Q=H⊗I+I⊗H^T$$ by following some properties of the Kronecker product, and I found a 4 x 4 Matrix $$Q=\begin{pmatrix}2 & 0 & 0 & 0\0 & 3 & 0 & 0 \ 0 & 0 & 3 & 0\ 0 & 0 & 0 & 4 \end{pmatrix}$$. Then I compute $$W=[ 0.5287, -0.9522, 0.5417, -0.9465]^T$$, which is vectorizing the product $BH$ and then I obtain $Ξ=Q^{−1}W$ and reconstructing $Ξ$ into a matrix which will be $$X=\begin{pmatrix}0.2643 & 0.1806\ -0.3174 &-0.2366 \end{pmatrix}$$, which is solution because if I compute XH+HX-BH=0. But let me know your method. – Gina Torres Oct 14 '13 at 12:19
  • And why only with the particular H I chose does it work and with others not? – Gina Torres Oct 14 '13 at 12:24
  • You should not use the transpose. $Q$ is simply $Q= H\otimes 1 + 1 \otimes H$. I added an answer below. It works for that particular $H$ because such $H$ is diagonal. – Rogelio Molina Oct 14 '13 at 23:17
3

Okay, the equation $AXH + AHX - BH = 0$ is equivalent to $A(HX + XH) = BH.$

You say $A$ is invertible, so you can write $HX + XH = A^{-1}BH$ which is a Sylvester equation (Wikipedia) and can be solved in CASes by the functions described in the answer to the post you linked, or as $$(I_n \otimes H + H^T \otimes I_n) \operatorname{vec} X = \operatorname{vec}(A^{-1}BH).$$

If $A$ is not invertible, I would do as anbarief suggest. First solve $$AY = BH$$ by solving $$(I_n \otimes A) \operatorname{vec} Y = \operatorname{vec}(BH)$$ and then solving the Sylvester equation $HX + XH = Y$, e.g. through $$(I_n \otimes H + H^T \otimes I_n) \operatorname{vec} X = \operatorname{vec} Y.$$

Of coure, if $A$ is not invertible, the equation $AY = BH$ have several or no solutions.

Calle
  • 7,897
  • Fine. It is quite clear. – Felix Marin Oct 14 '13 at 20:07
  • In fact, A is the identity matrix, I should edit the post, so should I do $$(In⊗H+H^{T}⊗In)vecX=vec(BH)$$, right?. – Gina Torres Oct 14 '13 at 20:41
  • Yes, that is correct. – Calle Oct 15 '13 at 15:43
  • But should I find the same solution for every H?, because as I change H solutions X are totally different. – Gina Torres Oct 22 '13 at 09:46
  • If you change $H$, $X$ will change. You will not find a single $X$ that works for all $H$. – Calle Oct 22 '13 at 15:51
  • But I don't understand very good these results? And by other side I have found also from other answers that $$f'(X)=0$$ iff $$ I⊗(X−B)=−(X^t⊗I)$$ and I have done that finding a system of equations, equating on each side and what I have found is that B12 and B21 must be zero, it means B diagonal, but numerically they are not for that reason I concluded that there is not any critical point, because of the nature of B, so what about this result and the result I found with your equation, different solutions for each H. – Gina Torres Oct 25 '13 at 10:16
  • Could you please provide some context? What is $f$ and how does it relate to your question? – Calle Oct 27 '13 at 19:38
1

My idea is that ... try to solve this equation first : $$ A(X_{1}) = BH $$, then solve, $$ XH+HX = X_{1} $$ , by writing $XH + HX = H(X + H^{-1}XH) $. Then write the solution $X$ as a matrix that has $H$ for the diagonalization. Maybe it'll work..?

Redsbefall
  • 5,429
  • Thanks anbarief, sorry I have edited the post, maybe you can check it again and let me know your opinion. Thanks – Gina Torres Oct 10 '13 at 15:44
  • But H can take any value, so how to solve X1 for any H? – Gina Torres Oct 11 '13 at 13:42
  • What do you mean with "write the solution X as a matrix that has H for the diagonalization"? Could you please explain a bit the process after $$XH+HX=H(X+H^{−1}XH)$$? – Gina Torres Oct 11 '13 at 14:04
  • Well my $\textit{idea}$ is the solution $X$ is of the form a matrix such that the columns of $H$ are the eigenvectors of $X = HDH^{-1}$ , so $H^{-1}XH = D$. So solve $H(X+D) = X_{1}$ – Redsbefall Oct 15 '13 at 07:30
0

First vectorise the matrix $X$ so that $vec (X) = (X_{11},X_{12},X_{21},X_{22})^T$, here I chose the ordering of the base as $11 \to 1, 12\to 2, 21\to 3, 22\to 4$ In this basis now compute $Q = H\otimes 1 + 1 \otimes H$ (No transpose anywhere!), in the case of a matrix $2 \times 2$ we obtain $Q$ in the basis we want as:

$$ Q = \left( \begin{array}{cccc} 2H_{11}& H_{21}&H_{12}&0 \\ H_{12}& H_{11}+H_{22}&0&H_{12}\\ H_{21}&0&H_{11}+H_{22}&0 \\ 0&H_{21}&0&2H_{22} \end{array}\right) $$ Now invert $Q$ and apply the inverse to $vec(BH)$, the result is $vec(X)$, that is the answer you want. I am guessing that what you did before was wrong because you used a transpose in $H$ (which should not be there), but it worked for the simple case you chose because that particular $H$ you wrote is diagonal so $H=H^T$ and they both agree. If you were to deal with a non-symmetric $H$ your answer would come out wrong because $Q$ was wrong. You should use the $Q$ I wrote above, that is a correct expression for $Q$, also valid when $H$ is not diagonal.

  • I have a question with respect to Q because I have computed $Q=H⊗1+1⊗H$ having H as $$H=\begin{pmatrix} H_{11}&H_{12}\H_{21}&H_{22}\end{pmatrix}$$ and I have obtained: $$Q=\begin{pmatrix} 2H_{11} & H_{12} & H_{12} & 0 \ H_{21}&H_{11}+H_{22}&0& H_{12}\ H_{21} & 0 & H_{11} + H_{22} & H_{12}\0 & H_{21}&H_{21}& 2H_{22}\end{pmatrix}$$, which has some elements different from your Q matrix. Am I wrong in some part maybe? – Gina Torres Oct 15 '13 at 14:42
  • The form of $Q$ depends of the basis you choose. I chose the ordering given above, but if you choose another ordering the matrix form of $Q$ may change. The form of $Q$ I gave was obtained by the componentwise expression above involving the Kronecker tensor. Other representations are possible. I suggest you check the componentwise definition of a tensor product for matrices, choose a basis you like and try it once again, or try to reproduce the matrix $Q$ I gave above from the equation $Q_{ij,kl}=H_{ik}\delta_{jl} + H_{jl} \delta_{ik}$ – Rogelio Molina Oct 15 '13 at 20:57
  • Hello, I have done what you have said but always changing H i find a different solution for X and after I have done what martini suggest because the problem comes from finding the critical points of a equation. http://math.stackexchange.com/questions/518760/critical-points-of-a-matrix-equation/518774?noredirect=1#comment1115660_518774 I mean this equation $$Id⊗(AX−B)=−Xt⊗A$$ lets me to find critical points. By using A as identity so it becomes $$Id⊗(X−B)=−X^{t}⊗I$$ and I have found something that was not coherent because solving the system as a system of equations as I said in next comment... – Gina Torres Oct 17 '13 at 09:04
  • http://math.stackexchange.com/questions/527059/critical-points-of-a-discrete-matrix-equation-x2-bx-c-0?noredirect=1#comment1130578_527059, i found a problem for X12 and X21 so I can conclude that there is no a critical point because of the nature of B. – Gina Torres Oct 17 '13 at 09:05
  • If you have some comment please let me know. – Gina Torres Oct 22 '13 at 09:38