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

2 ビュー (過去 30 日間)
Adri
Adri 2025 年 3 月 18 日
コメント済み: Adri 2025 年 3 月 19 日
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 件のコメント
Adri
Adri 2025 年 3 月 19 日
For expmv it works. It's actually the matrix exponential vector product that I need, so I can apply CST on expmv.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by