Re: HELP again
- To: mathgroup at smc.vnet.net
- Subject: [mg19002] Re: [mg18954] HELP again
- From: "Richard Finley" <rfinley at medicine.umsmed.edu>
- Date: Tue, 3 Aug 1999 13:44:42 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Chris, Just one more item of interest to make this problem more curious....if you define your own function: f[x_] := x + Fourier[x] or f[x_] := x Fourier[x] then by replacing output = Fourier[ideal] by output = f[ideal] you get the correct final results. On the other hand, functions such as : f[x_] := Fourier[x] + x f[x_]:= Fourier[x] x f[x_] := 2 + Fourier[x] all continue to give the wrong answer. But you can define a function: f[x_] := x Fourier[x] / x that obviously just gives Fourier[x] as an output, but now you will get the right answer!! Kind of strange results that I haven't been able to figure out...good luck. RF >>> Chris Slinger <slinger at signal.dra.hmg.gb> 07/29/99 11:33PM >>> We recently upgraded to Mathematica v4 on NT and Solaris from Mathematica v3. To my horror, I discovered that notebooks which produced good results under 3 produced errroneous ones under v4. I have traced the fault, and the code below is distilled down to illustrate the problem. Basically, I'm simply assigning complex numbers to an array using a Do[] (but note the Fourier[], which seems to be necessary to cause the bug, for some reason). Unfortunately, the imaginary parts of the result are not correct - their values should be as in the array "ideal" but are simply equal to the real parts !! Can people reproduce it ? What is going on ? No comments please on style or content - remember this is a cut down version of a far larger notebook just to illustrate the point: In[1]:= $Version Out[1]= "4.0 for Microsoft Windows (April 21, 1999)" In[2]:= SeedRandom[1]; ideal=Table[Random[Complex,{-1-I,+1+I}],{2},{2}] Out[2]= {{0.337385+0.6624 I], 0.563615-0.750732 I},{0.869075+0.200504 I, 0.516709+0.938178 I}} In[3]:= output=Fourier[ideal]; Do[output[[i,j]]=ideal[[i,j]],{i,1,2},{j,1,2}]; output Out[3]= {{0.337385+0.337385 I, 0.563615+0.563615 I},{0.869075+0.869075 I, 0.516709+0.516709 I}} Why does Out[3] not equal Out[2] ? In Mathematica v3, there is no problem. The upshot of this is that we have "downgraded" back to Mathematica v3 until this is sorted out (the fragment of code above is distilled from our computer generated holography design algorithms). I've asked Wolfram Support to help out, but am awaiting their comments. Please e-mail me with any replies as well as copying them to the newsgroup. Ta, -chris slinger at signal.dera.gov.uk