1
$\begingroup$

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 ![enter image description here How can linear matrix equations like these be solved in terms of the given parameters?

$\endgroup$
2
  • $\begingroup$ Note that LyapunovSolve is the first hit when searching for "Lyapunov equation" in the documentation center. $\endgroup$
    – Michael E2
    Jun 22, 2019 at 23:52
  • 1
    $\begingroup$ 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 $\endgroup$
    – Michael E2
    Jun 22, 2019 at 23:53

1 Answer 1

8
$\begingroup$

There's LyapunovSolve[]:

LyapunovSolve[mA, -mC]
(* long output of matrix for X *)
$\endgroup$
4
  • $\begingroup$ would it be possible to trace out the cavity before the stationary solution to avoid the long output? $\endgroup$
    – user0322
    Jun 23, 2019 at 20:50
  • 1
    $\begingroup$ @user0322 Sorry, I'm unsure what the jargon term "cavity" refers to. It's likely that the underlying problem that led to this Lyapunov equation is from a field I'm not familiar with. Your follow-up question might better be asked on physics.SE or another more appropriate site. Of course this site attracts experts from a wide variety of fields, so someone else might be able to answer your question. $\endgroup$
    – Michael E2
    Jun 23, 2019 at 21:40
  • $\begingroup$ I moved it to physics $\endgroup$
    – user0322
    Jun 24, 2019 at 6:37
  • $\begingroup$ I modified the matrix mA with changes in sign and would like to ask one question how to avoid returning Null in the output. $\endgroup$
    – user0322
    Jul 24, 2019 at 8:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.