<div dir="ltr">Hi all, <br><br>I have an issue with matrix logarithms, in the complex case. Consider<br>the following matrix :<br><br>A=[<br>    -0.01+0*%i 0.13+0*%i;<br>     0.00+0*%i 0.08+0*%i;<br>  ];<br><br>Coefficients are real, but I force them to be complex, hoping that<br>
scilab will use a complex logarithm matrix function. But scilab says<br>"unable to diagonalize!"... I understand that as a real matrix, I<br>can't calculate its log, but as a complex matrix, why doesn't this<br>
work ?<br><br>Using algorithms from Golub, van Loan, "Matrix Computations", I coded<br>a complex matrix log function, and found logm(A) = L where<br><br>L=[<br>    -4.6051702+3.1415927*%i  3.0036378-4.5378561*%i;<br>
     0.0000000+0.0000000*%i -2.5257286+0.0000000*%i;<br>  ];<br><br>and it's easy to check that exp(log(A)) == log(exp(A)) == A.<br><br>I looked in the scilab source, and found that logm is actually a .sci<br>file that does<br>
.........................<br>a=a+0*%i;   //Set complex<br>[s,u,bs]=bdiag(a);<br>  if maxi(bs)>1 then<br>    error('logm: unable to diagonalize!');return<br>  end<br>.........................<br><br>bdiag does block diagonalisation, finds a 2x2 block, and refuses to<br>
continue !... Is this normal ? is there some reason for scilab not<br>calculating this ?<br><br>Maybe I'm missing something obvious, thanks for helping.<br><br>Joao<br><br>P.S. Maybe this is a question for the scilab developers, is there a<br>
better forum for this ? Thx.<br><br><br>-- <br>Joao Moreira (math student)<br>Paris, France<br><a href="mailto:joao.mrr1@gmail.com">joao.mrr1@gmail.com</a><br><br></div>