Re: Bug in FourierTransform?

*To*: mathgroup at smc.vnet.net*Subject*: [mg31078] Re: Bug in FourierTransform?*From*: "Alan Mason" <swt at austin.rr.com>*Date*: Sun, 7 Oct 2001 03:11:43 -0400 (EDT)*References*: <9pme6e$657$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Daniel, I get the same behavior with Version 4.1 under Win2000. I'm not sure it's a bug, but it looks like Mathematica's internal simplification rules are taking too long in its Fourier Transform code. This happens quite a lot with integrals, too. The solution, as you suggest, is to apply the transformation to each term separately. Thus the answer comes almost instantaneously if you do this: In[2]:= func = E^(-100 + 20*X - 2*X^2 - 10*Y - Y^2/2) + E^(-100 - 2*X^2 - 10*Y - Y^2/2 + 10*(10 + Y)) + E^(-200 + 20*X - 2*X^2 - 10*Y - Y^2/2 + 10*(2*X + Y)) + E^(-200 - 2*X^2 - 10*Y - Y^2/2 + 10*(10 + Y) + 10*(2*X + Y)); FourierTransform[#, Y, P]&/@ func Out[2]= \!\(\[ExponentialE]\^\(\(-\(P\^2\/2\)\) - 2\ \((\(-10\) + X)\)\^2\) + \ \[ExponentialE]\^\(\(-10\)\ \[ImaginaryI]\ P - P\^2\/2 - 2\ \((\(-5\) + \ X)\)\^2\) + \[ExponentialE]\^\(10\ \[ImaginaryI]\ P - P\^2\/2 - 2\ \((\(-5\) \ + X)\)\^2\) + \[ExponentialE]\^\(\(-\(P\^2\/2\)\) - 2\ X\^2\)\) Such workarounds are our daily bread in working with Mathematica. The basic primitives of Mathematica are so powerful and general that you can for the most part do whatever you want on your own. It's pretty much an experimental science -- see what Mathematica does on your problem, and in the exceptional cases when it's pathologically slow or gives a wrong answer, you can generally write your own code to fix the problem. The core of Mathematica is of higher quality than most of the applications written for it (including some included in Mathematica itself). Alan PS. If you really want the delayed rule, the following works fine, too: In[4]:= FourierTransform[#,Y,P]&/@ F[X, Y] Out[4]= \!\(\[ExponentialE]\^\(\(-\(P\^2\/2\)\) - 2\ \((\(-10\) + X)\)\^2\) + \ \[ExponentialE]\^\(\(-10\)\ \[ImaginaryI]\ P - P\^2\/2 - 2\ \((\(-5\) + \ X)\)\^2\) + \[ExponentialE]\^\(10\ \[ImaginaryI]\ P - P\^2\/2 - 2\ \((\(-5\) \ + X)\)\^2\) + \[ExponentialE]\^\(\(-\(P\^2\/2\)\) - 2\ X\^2\)\) "Daniel Arteaga" <darteaga at ffn.ub.es> wrote in message news:9pme6e$657$1 at smc.vnet.net... > Hi, > > Mathematica hangs up when trying to compute the Fourier transform of > > F[X_, Y_] := > E^(-100 + 20*X - 2*X^2 - 10*Y - Y^2/2) + > E^(-100 - 2*X^2 - 10*Y - Y^2/2 + 10*(10 + Y)) + > E^(-200 + 20*X - 2*X^2 - 10*Y - Y^2/2 + 10*(2*X + Y)) + > E^(-200 - 2*X^2 - 10*Y - Y^2/2 + 10*(10 + Y) + 10*(2*X + Y)) > > FourierTransform[F[X,Y],Y,P] > > (keeps running forever) > > However, it computes very fast the Fourier transform of each term > separately. I am using Mathematica 4.1 in Windows 2000. Mathematica 2.2 > computed correctly this fourier transform. > > Any idea? > > Daniel Arteaga >