Tag Info

Hot answers tagged


You might get a speed improvement by doing as follows. (1) Change the expansion to give an explicit sum of products of trigs. comm00[t1_, t2_, tg_] = ComplexExpand[ Im[Expand[ ExpToTrig[(O1[t2, tg] + Exp[I*\[Gamma]*t2]*O2[t2, tg])*(O1c[t1, tg] + Exp[-I*\[Gamma]*t1]*O2c[t1, tg])]]]] (2) Do the double integral without iteration, ...


Edit 2 - Fixed omitted integrand Lukas pointed out that the first integration produces terms of the form x Sin[x], which were mishandled by the original rules. (See edit history, if curious.) I changed some things around a little. We have to Expand the result of the first integration before doing the second integration. Overall the speed is actually ...


Fixed in 10.0.2 Probability[a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g^2 < 1, {a, b, c, d, e, f, g} \[Distributed] UniformDistribution[{{0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}}]]


Update 2: In Mathematica 9.0.1 this takes only 19 seconds on first evaluation and 10 seconds on subsequent evaluations. The results returned by M9 and M10 are equivalent but not given in identical form. Update: While I was writing this I tried Eigenvectors[m], which finished in 100 seconds on my machine. I'm leaving the NullSpace-based method below ...


The difference in behaviour seem to be because Plus expects more than one argument. f_[whoCalled] ^:= f Sin[whoCalled] Plus[whoCalled] Minus[whoCalled] MadeUp[whoCalled] (* Sin whoCalled Minus MadeUp *) f_[whoCalled, youCalled] ^:= f Plus[whoCalled, youCalled] (* Plus *)


the result of Eigenvalues[m]: ( using g instead of \[gamma] ) {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g^2,0,0,0,0,0,-g,0,0,-g,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g,0,0,0,0,0,-1,-g,0,0,0,0,0,1,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g,0,0,0,0,-1,-g,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-1,0,0,-1,0,0,1,0,0,0}, ...


This seems to come close. The idea is to find factors, at all levels, that are not numeric and are independent of the variable. Set up replacement rules for these in terms of some new symbol. Do the replacement. I also return the rules used in case that might be useful. replaceFactors[expr_, x_, c_Symbol] := Module[ {e2 = MapAll[Collect[#, x] &, ee], ...

Only top voted, non community-wiki answers of a minimum length are eligible