September 6th, 2007, 8:43 am
QuoteOriginally posted by: AlanCan anyone match or beat either of these running times?If so what's your setup? (Matlab/Mathematica Version #, CPU, Brand, Model, Op. Sys., Memory)Matlab---------------------------M = rand(300,300);t=0.25; T=2;tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;Elapsed time is 0.288171 secondsMathematica---------------------------M = Table[Random[], {i, 1, 300}, {j, 1, 300}];t = 0.25; T= 2;Timing[Inverse[M].(MatrixExp[-M t] - MatrixExp[-M T]);] {0.375 Second, Null}Hi Alan,My setup : Windows XP, AMD Opteron P250, 2.39GHz, 4Go RAMMathematica v5.0 -> {1.852 Second, Null}Mathematica v6.0 -> {0.422 Second, Null}When I ran the Mathematica benchmarks (Help -> About Mathematica -> System Information -> Kernel)it 'rated me' 1.37, worse being 0.21 and best being 2.84.My conclusion : simply v6 [ + intel oriented hardware better than AMD (for mathematica at least) ].Personal comment : I also tried to do my own MatrixExp. I did compute the eigensystem and did the exponentiation with exp(M) = P.exp(D).P^(-1). This should be less efficient than native MatrixExpbecause there are faster algorithm to do matrix exponentiation, as quoted in their help.Anyway, with v5.0, home made exponentiation is faster, which is NOT normal.With v6.0, it's no longer the case.I'll try to get a matlab licence.