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

2 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing 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