Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.4K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

NIntegrate vs (Inverse)FourierTransform

Posted 10 years ago

Hello, everyone.

I have been trying to get the solution of [Eta] (in the code below) using Fouriertransform + InverseFouriertransform. But I faced some problems which gave me a kind of singular point behavior, even though there is no singular point in G[t] function that I used (at least I removed the candidate singular point). I don't know where this comes from. Here is the code.

Remove["Global`*"];
\[Lambda] = 800000;
A1 = 0.6; A2 = -1.8; 
n = 2.48; k = 4.38 ;
\[Xi] = \[Lambda]/(4 \[Pi] k);
\[Chi] = \[Lambda]/(4 \[Pi] n);
v = 5894;
P1 = Re[(2 (n + I k))/(1 - (n + I k)^2) (A1 + I A2)]; P2 = 
 Im[(2 (n + I k))/(1 - (n + I k)^2) (A1 + I A2)];
ReflNormExpTot[t_, offset_] = -6 (Cos[0.25 t] + offset) Exp[-(t/10)^2];
Sol = NSolve[
   Integrate[ReflNormExpTot[t, offset], {t, -100, 100}, 
     Assumptions -> offset \[Element] Reals ] == 0, offset][[1]]
offsetT = Sol[[1, 2]];
start = SessionTime[];
G[t_] = (P1 Sin[v/\[Chi] t] + 
     P2 Cos[v/\[Chi] t] Sign[t]) Exp[-Abs[t] v/\[Xi]];
SS[\[Omega]_] = 
  FourierTransform[ReflNormExpTot[t, offsetT], t, \[Omega]];
GG[\[Omega]_] = FourierTransform[G[t], t, \[Omega]];
Plot[{Re[SS[\[Omega]]], Im[SS[\[Omega]]]}, {\[Omega], -20, 20}, 
 PlotRange -> All, PlotStyle -> {Blue, Red}]
Plot[{Re[GG[\[Omega]]], Im[GG[\[Omega]]]}, {\[Omega], -20, 20}, 
 PlotRange -> All, PlotStyle -> {Blue, Red}]
\[Eta][t_?NumericQ] := \[Lambda]/(16 \[Pi]^2 v)
    NIntegrate[(SS[\[Omega]]/
      GG[\[Omega]]) Exp[-I \[Omega] t], {\[Omega], -10, 10} , 
    MaxPoints -> 1000];
Plot[{Re[\[Eta][t]], Im[\[Eta][t]]}, {t, -20, 20}, 
 PlotStyle -> {Blue, Red}, PlotRange -> All]
(SessionTime[] - start)/60

In the code, ReflNormExpTot[t] is not a continuous function. So there is no reason why I got the spike (singular-like) after Fouriertransform. When I used NIntegrate (with a limited integration range) instead of FourierTransform as follows,

SS[\[Omega]_?NumericQ] := 
  NIntegrate[
   1/(2 \[Pi])^(1/2) (ReflNormExpTot[t, offset] /. Sol) Exp[
     I \[Omega] t], {t, -100, 100}, MaxPoints -> 1000];

there was no singular-like point. Also, when I use InverseFourierTransform to retrieve [Eta][t], it does not stop and runs forever, even though the SS[\Omega], GG[\Omega] are simple functions. If I use NIntegrate here, the result of [Eta][t] can be obtained quickly (at some limited integration ranges) and looks 'not bad' except many discontinuous regions. Does anyone know what is the reason for these ? Thank you in advance.

This is my version. In[121]:= $Version

Out[121]= "10.2.0 for Microsoft Windows (64-bit) (July 7, 2015)"
POSTED BY: hwoarang Polar
3 Replies

I think it is actually some kind of bug integrating this specific function:

In[29]:= a = FourierTransform[-6 Cos[ t] Exp[-(t/10)^2], t, w]

Out[29]= -6 ((5 Cosh[25 (-1 + w)^2])/Sqrt[2] + (5 Cosh[25 (1 + w)^2])/Sqrt[2] - (
   5 Sinh[25 (-1 + w)^2])/Sqrt[2] - (5 Sinh[25 (1 + w)^2])/Sqrt[2])

In[30]:= b = TrigToExp[a]

Out[30]= -15 Sqrt[2] E^(-25 (-1 + w)^2) - 15 Sqrt[2] E^(-25 (1 + w)^2)

In[31]:= InverseFourierTransform[b, w, t]

Out[31]= -3 E^(-(1/100) t (100 I + t)) (1 + E^(2 I t))

but it seems to have trouble to find this:

In[32]:= InverseFourierTransform[a, w, t]

Out[32]= $Aborted
POSTED BY: Kay Herbert
Posted 10 years ago

Thank you Kay,

If it is true, that's too bad. Also I changed all initial numbers to rational forms, then the outcome looks better a little bit (less singular points). But that's not enough for me to get results. It takes toooo long time. Do you think that it is good to use 'Discrete FT' ? I already tried it, but I think that it's very different from Fourier. Anyway, I will think further.

Thank you again.

POSTED BY: hwoarang Polar

Try to convert your equations with TrigToExp before doing the transform. I think it does better without subtracting the offset before the transform (you can split the sum) A DFT certainly should work, as long as you sample your function at small enough intervals.

POSTED BY: Kay Herbert
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard