Message Boards Message Boards

0
|
1808 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Help with double numerical integration (Inverse Fourier and Laplace Transforms)

Hi All,

I have a complex function with two independent variables, but aren't easily separated in my function. One is a Laplace variable and the other is a Fourier variable and I would like to bring both back to their respective real spaces and must do so numerically as the function is too convoluted to do symbolically.

I believe I have the right structure, but as it is throwing up a million errors, I wanted to see if anyone had any helpful advice. I have tried looking at other discussions, but I didn't see one that quite fit this niche.

Mathematically, what I am trying to do is: enter image description here

And using the following resources: NInverseLaplaceTransform,NInverseFourierTransform

Needs["FourierSeries`"]

f[g_,s_,\[Omega]0_,k0_,\[Theta]_] := -I 1/\[Pi] g^2/(g^2+\[Omega]0^2) 1/Sinh[k0] Exp[-(g/Abs[k0])Abs[\[Theta]]]/\[Theta];(* Sin[k0 y] *)

tval = 23;

FList:={}
For[i=1,i<=1,i++,xpos = i*0.2;
    datap := ResourceFunction["NInverseLaplaceTransform"]
    [Simplify[NInverseFourierTransform[f[g,10000,0.5,1,\[Theta]] ,\[Theta],xpos,FourierParameters->{-1,-1}]],g,tval];
AppendTo[FList,datap];
]
Print["Done."]

The f I provide here is one that can be done symbolically, I wanted to use it as a test case but errors abound. I have chosen to loop over only one nonzero x value and one t value as a start.

My understanding of the issue is that the fourier transform will not converge to a value, but will retain itself as a function of g. Then the laplace transform will take care of g.

I hope it is clear what I have presented.

Thanks, Daniel

POSTED BY: Daniel Urbanski
4 Replies

Instead of a For loop I would write

invFT[g_?NumericQ, xpos_] := 
  NInverseFourierTransform[f[g, 10000, 0.5, 1, \[Theta]], \[Theta], 
   xpos, FourierParameters -> {-1, -1}];
FList = Table[
  ResourceFunction["NInverseLaplaceTransform"][invFT[g, xpos], g, 
   tval],
  {xpos, 0, 0.4, 0.2}]

but you should be careful to choose a sample f for which you know in advance that all integrals converge.

POSTED BY: Gianluca Gorni

I really like the formatting you have provided here, it is very helpful and transparent. I can't seem to get a simple expression to work with it, however. My take away is that it's not going to be possible to do a double integral in this way. For example, for the following function f:

g/((g^2 + w0^2) (DiracDelta[\[Theta]-1]+DiracDelta[\[Theta]+1])

The inversions should yield cosines, however the integrals provide the errors: NInverseLaplaceTransform::wrongexpr: The argument invFT[g,0.2] is not Numeric at fixed g .

I think the approach should be as you said in your previous comment. I need to conduct the first integral symbolically and then I can do it numerically for the second variable. Thanks again for your help!

POSTED BY: Daniel Urbanski

Your function f[g, s, \[Omega]0, k0, \[Theta]] is not integrable with respect to \[Theta]. My understanding is that NInverseFourierTransform relies on numerical integration, which is likely to fail. Try the symbolic way, which handles non-integrable cases:

InverseFourierTransform[f[g, s, \[Omega]0, k0, \[Theta]],
 \[Theta], \[Omega]]
POSTED BY: Gianluca Gorni

Thank you for response! I had done that method previously and for the function I provided the symbolic method works quite well. I had hoped to use the double numerical method to solve a more complex expression and since I knew this one could be handled symbolically I thought it would be a good test to try numerically, but I see why that isn't the case. Thanks again, apologies for the delated response!

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

Group Abstract Group Abstract