Complex Step Derivative of 3D rotation in exponential coordinates at u = [0 0 0] not working?

2 Ansichten (letzte 30 Tage)
Applying complex step differentiation to the matrix exponential works fine, except at u = [0 0 0]. Here, the exponential coordinates have a removable singularity. Why does the complex differentiation fail only at this point? Can you think of a complex differentiable matrix exponential that returns the correct derivative at u = [0 0 0]? Similar to the Complex-step-compatible atan2()?
Thank you for your time.
u0 = [0;0;0]; % The problematic point
% Central finite-difference
sh = 1e-5;
for ii = 1:3
dh = zeros(3,1);
dh(ii) = sh;
JFD(:,ii) = (vec(rexpm(u0+dh)) - vec(rexpm(u0-dh))) / (2*sh);
end
% Complex step differentiation
sh = 1e-16;
for ii = 1:3
dh = zeros(3,1);
dh(ii) = sh*1i;
JCS(:,ii) = imag(vec(rexpm(u0+dh))) / (sh);
end
JFD - JCS % should be close to 0!
% Functions
function R = rexpm(u)
Su = [ 0 -u(3) u(2)
u(3) 0 -u(1)
-u(2) u(1) 0];
R = expm(Su);
end
function y = vec(x)
y = x(:);
end
  1 Kommentar
Adri
Adri am 19 Mär. 2025
For expmv it works. It's actually the matrix exponential vector product that I need, so I can apply CST on expmv.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by