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

2 views (last 30 days)
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

Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!