# How do you avoid Null in matrix? [closed]

The following matrix equation is a Lyapunov equation,

$$mA.x+ x.mA^T=-mC,$$

the matrix $$mA$$ is given by

$$ mA= $$\begin{pmatrix} -\frac {\gamma}{2} & \omega_{m} & 0 & 0\\\\ -\omega_{m} &-\frac {\gamma}{2} & -2G & 0\\\\ 0 & 0 & -\frac {\kappa}{2} & -\Delta\\\\ -2G & 0 & \Delta & -\frac {\kappa}{2} \end{pmatrix}$$ $$

and the matrix $$mC$$ is given by

$$mC= \begin{pmatrix} 0 & 0 & 0 & 0\\\\ 0 & \gamma (2n+1) & 0 & 0\\\\ 0 & 0 & \kappa & 0\\\\ 0 & 0 & 0 & \kappa \end{pmatrix}$$

With[{x = Array[x, Dimensions[mA]]},  x /. Solve[mA .x + x. mA^T + mC == 0,Flatten@x]]


I got an output like this How can linear matrix equations like these be solved in terms of the given parameters?

## closed as off-topic by Michael E2, Chris K, garej, Alex Trounev, EdmundJun 26 at 21:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Chris K, garej, Alex Trounev, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

• Note that LyapunovSolve is the first hit when searching for "Lyapunov equation" in the documentation center. – Michael E2 Jun 22 at 23:52
• People here generally like users to post code as Mathematica code instead of (i.e. in addition to) just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this meta Q&A helpful – Michael E2 Jun 22 at 23:53

There's LyapunovSolve[]:
LyapunovSolve[mA, -mC]