Why Matlab do not respect the exponential matrix property \exp^{YXY^{-1}}=Y\exp^XY^{-1}?
1 view (last 30 days)
Show older comments
Alberto Cavarzeran
on 5 Oct 2021
Commented: Alberto Cavarzeran
on 6 Oct 2021
Given two square matrices X, Y, with Y invertible, it holds that
,
but when coding it seems not.
For example, given the two matrices
>> X = [1 1 1; 1 1 1; 1 1 1];
>> Y = [1 1 1; 0 1 1; 0 0 1];
Y is invertible as it is full rank.
Defining its inverse as
>> IY = inv(Y)
IY =
1 -1 0
0 1 -1
0 0 1
it is numerically correct.
When checking for the above property a get
>> exp(Y*X*IY)
ans =
20.0855 1.0000 1.0000
7.3891 1.0000 1.0000
2.7183 1.0000 1.0000
>> Y*exp(X)*IY
ans =
8.1548 0 0
5.4366 0 0
2.7183 0 0
Clearly the property does not hold.
What am I missing?
0 Comments
Accepted Answer
Paul
on 6 Oct 2021
The identity holds for the matrix exponential, which is implemented with expm(), not exp() (which is the element-wise exponential function)
X = [1 1 1; 1 1 1; 1 1 1];
Y = [1 1 1; 0 1 1; 0 0 1];
% numerically
expm(Y*X/Y) - Y*expm(X)/Y
% symbolically
expm(sym(Y)*sym(X)*inv(sym(Y))) - sym(Y)*expm(sym(X))*inv(sym(Y))
More Answers (1)
Walter Roberson
on 5 Oct 2021
Let X and Y be scalar matrices.
syms X Y
lhs = exp(Y * X * inv(Y))
rhs = Y * exp(X * inv(Y))
eqn = lhs == rhs
solve(eqn, X)
So your proposed equation only holds if X has that particular relationship to Y.
I would suggest to you that your relationship is incorrect.
rhs2 = exp(X * inv(Y))^Y
eqn2 = lhs == rhs2
assume(X, 'real')
assume(Y, 'real')
simplify(eqn2)
2 Comments
Walter Roberson
on 5 Oct 2021
Are you sure it is an identity?
syms X [3 3] real
syms Y [3 3] real
lhs = exp(Y * X * inv(Y))
rhs = Y * exp(X) * inv(Y)
eqn = lhs - rhs
Seqn = simplify(eqn)
x = [1 1 1; 1 1 1; 1 1 1];
y = [1 1 1; 0 1 1; 0 0 1];
subs(Seqn, [X,Y], [x, y])
See Also
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!