Message Boards Message Boards

0
|
1352 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Is Log[ ] function applicable to matrices or vectors?

Posted 10 months ago

enter image description here May I ask if the logarithmic algorithm is applicable to matrices or vectors? In the formula, Part A is a matrix and Part B is a vector. I want to split it into two parts, but the running result is incorrect. How can I modify it?

{r = 22, l = 2 10^-1, c = 1 10^-4, vi = 24};
\[CapitalDelta]vi = 0;
A = {{0, -1/l}, {1/c, -1/(r c)}};
G = Inverse[A];
B = {1/l, 0};
S1 = Inverse[DiagonalMatrix[{1, 1}] - dt*A + 1/2*dt*dt*A . A];

STAR1 = S1 . G . (B*vi + G . B*\[CapitalDelta]vi/dt) - 
   G . (B*(vi + \[CapitalDelta]vi) + G . B*\[CapitalDelta]vi/dt);

X0 = {0, 0};
a1 = Log[
   MatrixPower[S1, 
     t/dt] . (MatrixLog[S1] . X0/dt - 
      Inverse[DiagonalMatrix[{1, 1}] - S1] . STAR1 . MatrixLog[S1]/
       dt)];
a2 = Log[MatrixPower[S1, t/dt]] + 
   Log[MatrixLog[S1] . X0/dt - 
     Inverse[DiagonalMatrix[{1, 1}] - S1] . STAR1 . MatrixLog[S1]/
      dt];
a1 /. {t -> 0.008995439102590038`, dt -> 0.00006}
a2 /. {t -> 0.008995439102590038`, dt -> 0.00006}
POSTED BY: James James
3 Replies

Try this:

a = RandomInteger[{-10, 10}, {2, 2}]
b = RandomInteger[{-10, 10}, {2, 2}]
MatrixLog[a . b] == MatrixLog[a] + MatrixLog[b]
POSTED BY: Gianluca Gorni
Posted 10 months ago

Can I use Log instead of MatrixLog? Because I want to process vectors......

POSTED BY: James James

Ok, try Log:

a = RandomInteger[{-10, 10}, {2, 2}]
b = RandomInteger[{-10, 10}, {2, 2}]
Log[a . b] == Log[a] + Log[b]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract