How to solve the Lyapunov equation with unknowns

I'd like to ask those with unknowns Lyapunov What function does the equation use
The original equation is MV+VM‘=-D,
The matrix code is like this , There is only one unknown :
M=[0 w1 0 0 0 0;-q1 -r1 0 0 -g1u -g1v;0 0 0 w2 0 0;0 0 -q2 -r2 -g2u -g2v;g1v 0 g2v 0 -k x;-g1u 0 -g2u 0 -x -k];
d=[0 r1*(2n1+1) 0 r2(2*n2+1) k k];
D=diag(d);
V=lyap(M,D)
The following error occurred after running , Only numeric matrices can be calculated :
Misuse lyap (line 35)
The input arguments of the "lyap" command must be numeric arrays.
error Untitled (line 38)
V=lyap(M,D)
Thank you

6 Comments

So you want to solve for V with an additional symbolic parameter in M and/or D ?
Then you have a linear system of 36 equations for 36 unknowns v_ij that has to be solved symbolically.
Means that MATLAB will have to calculate determinants of matrices of size 36x36. This is not realistic.
Thanks for your response, yes that's it, and please what's the solution in this case to find the solution of this equation with one or max two symbolic parameters in M?
Torsten
Torsten on 25 Jul 2022
Edited: Torsten on 25 Jul 2022
As I wrote - practically unsolvable.
Insert numerical values for the symbolic variables and use lyap for this problem without symbolic variables.
What exactly do you gain from symbolically solving the linear matrix equation that is named after Lyapunov?
Do the symbolic parameters vary from to in reality?
What are you trying to prove? Have you looked deeper into the problem such that it may be possible to decouple a few states to reduce the matrix size down to where it can be solved symbolically?
Do the reviewers suggest that you to solve the Lyapunov equation in order to get your manuscript accepted?
If you tell us your story, perhap we can find a workaround.
w1 = 1;
q1 = 1;
r1 = 1;
g1 = 1;
w2 = 1;
q2 = 1;
r2 = 1;
g2 = 1;
n1 = 1;
n2 = 1;
k = 1;
u = 1;
v = 1;
x = 1;
M = [0 w1 0 0 0 0; -q1 -r1 0 0 -g1*u -g1*v; 0 0 0 w2 0 0; 0 0 -q2 -r2 -g2*u -g2*v; g1*v 0 g2*v 0 -k x; -g1*u 0 -g2*u 0 -x -k];
d = [0 r1*(2*n1+1) 0 r2*(2*n2+1) k k];
D = diag(d);
V = lyap(M, D)
V = 6×6
0.4032 0.0000 -1.0968 0.0000 0.0645 0.9032 0.0000 1.3710 -0.0000 -0.1290 -0.1452 0.2742 -1.0968 -0.0000 0.4032 0.0000 0.0645 0.9032 0.0000 -0.1290 0.0000 1.3710 -0.1452 0.2742 0.0645 -0.1452 0.0645 -0.1452 0.5645 -0.0645 0.9032 0.2742 0.9032 0.2742 -0.0645 -1.2419
@Sam Chak well Thanks Sir for your response, I look to calculate logarithmic negativity "EN" and it's defined as a function of V (solution of Lyapunov equation). IF I give all numerical values of the parameters I don't find the variable for plot EN as a function of some parameters such as temperature coupling ..
Please see the picture below to understand what I'm looking for it
Thank you.
I'm not good at magnomechanics, but it can clearly says that the elements of 𝒱are fully defined as function of u
and in Eq. (3), it is given that
.
So, maybe you can use ode45() to solve for . Then, you can find a steady-state 𝒱 when no longer change in time..

Sign in to comment.

 Accepted Answer

One inefficient way is too convert the Lyaponuv Matrix equation to linear system using the vectorization rule, and solve the linear system.
A = kron(eye(6),M) + kron(M,eye(6));
B = D(:);
X = A\B;
V = reshape(X,6,6);

8 Comments

M and/or D contain a symbolic parameter - that's the problem here.
Thanks for your response,
Please, I want references for this method if you have any, I did not know it before, thank you
Indeed "lyap" function does not support symbolic parameters, but "kron" and "\" functions do support symbolic parameters. Thats why this solution works if you have a few symbolic parameters and small matrix sizes.
Thank you very much for the help, I will try the method, I work with matrix 6x6 8x8 and max 12x12
Thanks @Ivo Houtzager for sharing the good article on solving the Lyapunov Equation using the Kronecker Product.
Unfortunately, @Abdelkader Hd cannot symbolically solve the inverse problem due the matrix size of his problem. For more info, check out Abel–Ruffini theorem. I guess that's the reason @Torsten said the problem is unsolvable.
Torsten
Torsten on 26 Jul 2022
Edited: Torsten on 26 Jul 2022
If "\" and "kron" can deal with symbolic parameters, then in principle the problem can be solved using Ivo Houtzager 's suggestion. The inversion of a matrix does only use subdeterminants of the matrix itself - no roots are needed.
But even if it theoretically works: for a 36x36 or even 144x144 matrix, the expressions involved will become useless in my opinion.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 25 Jul 2022

Edited:

on 26 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!