Can MATLAB solve a Lyapunov equation symbolically?
Mostra commenti meno recenti
I have a 3x3 matrix called J. I need to show that there exists at least one X and Q such that
where Q is a Hermitian matrix and
is the conjugate transpose of J (see https://en.wikipedia.org/wiki/Lyapunov_equation )
Matrix J is currently in terms of many parameters and variables which makes finding X and Q by hand difficult. Can MATLAB help with this? It seems using symbolic MATLAB would help but I'm not sure how to move forward.
9 Commenti
Sam Chak
il 28 Feb 2022
Hi @Matt Woolf
Looks like you are trying to compute the analytical solution for the discrete Lyapunov equation.
If it is, then it becomes a question of how to symbolically compute the infinite sum of products of matrices.
Can you assume
so that the solution of X is in terms of
?
so that the solution of X is in terms of
econogist
il 28 Feb 2022
Walter Roberson
il 28 Feb 2022
Your wikipedia link directly says that the discrete case can be solved as an infinite sum.
econogist
il 28 Feb 2022
Walter Roberson
il 28 Feb 2022
"One may then solve for vec ( X ) by inverting or solving the linear equations."
which is something that you can do symbolically. The sum of infinite products representation is an alternative representation, not the only way to solve the problem.
econogist
il 9 Mar 2022
Are you able to put any constraints on your variables? Real-valued? Integer? positive?
The piecewise pe^2 + Ur*D == Q*pe + B*Ur part is saying that it found (pe^2 + Ur*D) - (Q*pe + B*Ur) or algebraic equivalent in a denominator, and when that condition holds, there is a division by 0 that leads to an infinite outcome.
syms k Q pe D B Ur Up Sr Sp
J=[(Q*pe-(D-B)*Ur)/(pe^2) -((D-B)*Up/(pe^2)) 0; -((D-B)*Ur/(pe^2)) (Q*pe-(D-B)*Up)/(pe^2) 0; Sr Sp 1];
Q=[1 0 0; 0 1 0; 0 0 1];
F=symsum((J.^k).*Q.*(ctranspose(J)),k,1,inf)
Notice the infinity in F(3,3)
assume( pe == 0 )
simplify(F)
assume(pe ~= 0)
sF = simplify(F)
c113 = children(sF(1,1),3)
c223 = children(sF(2,2),3)
assume(~c113);
assumeAlso(~c223);
simplify(sF)
But of course the infinity is still there
Sam Chak
il 10 Mar 2022
Hi @Matt Woolf
Can you check the state matrix J if it is possible for
such that
?
econogist
il 10 Mar 2022
Risposta accettata
Più risposte (1)
Hi @Matt Woolf
Let's try a new one by reducing the non-dependant variables. I have simplified the computation by letting
,
,
, and
, with
and
maintained. Also, I have replaced
with
in order to investigate whether the solution exists.
clear all; clc
syms a b c d Sr Sp p11 p12 p13 p22 p23 p33
A = sym('A', [3 3]); % state matrix
P = sym('P', [3 3]); % positive definite symmetric matrix
A = [a b sym('0');
c d sym('0');
Sr Sp sym('0.5')];
P = [p11 p12 p13;
p12 p22 p23;
p13 p23 p33];
Q = sym(eye(3)); % identity matrix
L = A*P*A.' - P + Q; % discrete-time Lyapunov equations
eqns = [L(1, 1) == 0, L(1, 2) == 0, L(1, 3) == 0, L(2, 2) == 0, L(2, 3) == 0, L(3, 3) == 0];
S = solve(eqns);
sol = [S.p11; S.p12; S.p13; S.p22; S.p23; S.p33]
simplify(sol)
pretty(S.p33)
In this example, the solution exists, though
is still pretty long even after simplification, not mentioning that you have to substitute k, q, pe, D, B, Ur, Up, back into the a, b, c, d.
More importantly, you need to recheck your derivation/modeling of the state matrix if
. If it is, it could imply that the system is marginally stable and you can't find any P that satisfies the discrete Lyapunov equation.
3 Commenti
econogist
il 10 Mar 2022
Hi @Matt Woolf
The stability issue maybe not as bad as you think. Although I don't know what your system really is, if your system
is controllable, then there exists a feedback gain matrix K in the controller
that arbitrarily assigns the system eigenvalues to any set
. When the two equations are combined, you can rewrite the closed-loop system as
where the closed-loop state matrix is
In other words,
produces the desired system eigenvalues that can be chosen with appropriate choice of the feedback gain matrix K through the pole placement technique.
econogist
il 10 Mar 2022
Categorie
Scopri di più su Matrix Computations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








