Use symbolic variable for lyapunov function

38 visualizaciones (últimos 30 días)
Kashish Pilyal
Kashish Pilyal el 8 de Mzo. de 2022
Editada: Sam Chak el 9 de Mzo. de 2022
I am trying to find a value for a lyapunov function but I do not know the numeric values. When I run the lyapunov command, I get an error that only numeric arrays can be used. Is there a way for using only symbolic variable to get the answer.
  4 comentarios
Kashish Pilyal
Kashish Pilyal el 9 de Mzo. de 2022
@Sam Chak Thank you for the help.

Iniciar sesión para comentar.

Respuesta aceptada

Sam Chak
Sam Chak el 9 de Mzo. de 2022
If you are writing for a journal paper or a thesis, the following explanation might be helpful.
Let , , and .
There are a few ways to solve this symbolically.
syms a b c p11 p12 p22 p23 p33 p31
eqns = [1 - 2*a*p12 == 0, - a*p22 - b*p12 + c*p31 + p11 == 0, 1 - 2*b*p22 + 2*c*p23 + 2*p12 == 0, - b*p23 - c*p23 + c*p33 + p31 == 0, 1 - 2*c*p33 == 0, - a*p23 - c*p31 == 0];
S = solve(eqns);
sol = [S.p11; S.p12; S.p22; S.p23; S.p33; S.p31]
Result:
The result has been verified numerically:
clear all; clc
A = [0 1 0; -1 -2 0; 0 1 -1]
Q = eye(3)
P = lyap(A', Q)
A'*P + P*A
  5 comentarios
Torsten
Torsten el 9 de Mzo. de 2022
Ah, I didn't know this.
Thank you for the info.

Iniciar sesión para comentar.

Más respuestas (1)

Torsten
Torsten el 9 de Mzo. de 2022
Editada: Torsten el 9 de Mzo. de 2022
syms k_p k_d h
A = sym('A', [3 3]);
X = sym('X', [3 3]);
A = [sym('0') sym('1') sym('0');
-k_p -k_d sym('0');
sym('0') sym('1')/h sym('-1')/h];
Q = sym(eye(3));
N = sym(zeros(3));
B = A.'*X + X*A + Q;
F = solve(B==N)
  1 comentario
Kashish Pilyal
Kashish Pilyal el 9 de Mzo. de 2022
Thank you for the answer but I have tried this method too. The matrix F in this case comes out to be empty. It is 0 by 1 symbolic. I actually managed to get the answer now. I had to write all equations seperately like this
syms P [3 3]
X= (A'*P)+(P*A);
eqnA=X(3,3)==-1;
eqnB=X(3,2)==0;
eqnC=X(3,1)==0;
eqnD=X(2,3)==0;
eqnE=X(1,3)==0;
eqnF=X(1,1)==-1;
eqnG=X(2,1)==0;
eqnH=X(2,2)==-1;
eqnI=X(1,2)==0;
Then I used solve and got the values of each element although the lyapunov function equation A'P+PA=-Q (in my case I) does not hold properly still. In other words the lyapunov equation does not give the identity matrix as output.

Iniciar sesión para comentar.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by