recently I have been working on solving some math problems using Fortran. There occurs to me that a linear matrix equation:
$$ AX-XA=B $$
where $A$ and $B$ are known $n\times n$ matrices and $X$ is the one need to be solved. I know this looks like a typical Lyapunov equation. However, in order to solve this equation space friendly, one can use an iterative way to get the numerical result of $X$ when the Kronecker product:
$$ AI-IA^T $$
Unfortunately, this is not my case. The Kronecker product in my problem is singular. Thus, I cannot use a space friendly iterative way to solve the problem but use a very space consuming method which generates and stores the Kronecker product explicitly!!! Then I used Moore-Penrose pseudoinverse of matrix algorithm to generate the pseudoinverse of this huge matrix and used a library matrix-vector multiplication routine to solve the equation.
For small matrices, this is alright. But when the size of matrices grows (e.g. when n goes up to several hundred) my computer's memory has been completely used up. Any one can help on this so that I can use a space friendly algorithm for such a problem? Thank you very much.