Can someone run this simple code for me? Matlab isn't converging to a solution on my computer...

1 view (last 30 days)
A = [0 1 0 0; 1 .15 -2 -.05; 0 0 0 1; -1 -.025 -.5 -.075]
t = sym('t')
expm(A*t)
Thanks in advance! Apparently it should work, but I guess finding the state-transition matrix for when A is a 4 x 4 matrix is pretty computationally taxing for Matlab.

Answers (1)

Walter Roberson
Walter Roberson on 30 Jan 2014
Edited: Walter Roberson on 30 Jan 2014
I suggest experimenting with
expm(sym(A,'d') * t)
the sym(,'d') tells MuPAD to treat the numbers as decimals instead of doing the default of converting to rational. My tests suggest that doing the calculation with rationals might be considerably more time consuming.
  1 Comment
Walter Roberson
Walter Roberson on 30 Jan 2014
Technical compatibility note:
When you use the MATLAB expm() interface to MuPAD, you do want to multiply your input values by "t", as Kelsey shows. Likewise, if you go down into the MuPAD level to find the built-in MuPAD expm, your numeric input should be multiplied by "t" in the manner shown.
If, though, you happen to use Maple, then Maple's MTM:-expm() function should only be passed the numeric values, as it will add the "t" itself.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!