Message Boards Message Boards

1
|
10896 Views
|
14 Replies
|
4 Total Likes
View groups...
Share
Share this post:

$\sqrt{1-x^2}$ convolution Integral does not converge

Posted 9 years ago

Hi !

Out of curiosity, I went to see what I get when two half-circles are to be convolved but Mathematica stopped with " ... does not converge on {-[Infinity],[Infinity]}. " , see below.

f[x_] := Sqrt[1 - x^2]

Then, I verified I that this is indeed a half-circle with radius = 1 by doing

Plot[f[x], {x, -2, 2}]

Then, the convolution from -inf to +inf:

Integrate[f[?] f[t - ?], {?, -?, ?}]

which Mathematica fails to integrate saing "does not converge on {-[Infinity],[Infinity]}." Where did I go wrong?

Thanks for reading! Chris

POSTED BY: Christian Bauer
14 Replies

The real part appears to be correct:

In[6]:= With[{x = 1/2}, 
 NIntegrate[
  Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], x - 1, 1}]]

Out[6]= 1.05223
POSTED BY: Frank Kampas

Questionable are these large imaginary parts in the results for a real integrand:

In[39]:= With[{x = 1/2},
 Integrate[Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], x - 1, 1}, Assumptions -> x >= 0]
 ]

Out[39]= 1/48 (150 I Sqrt[2] + 51 Sqrt[3] + 
   34 Sqrt[15] EllipticE[16/15] - 
   68 EllipticE[ArcSin[2 Sqrt[2/5]], 15/16] - 
   68 EllipticE[ArcSin[Sqrt[6/5]], 15/16] + 
   8 (EllipticF[ArcSin[2 Sqrt[2/5]], 15/16] + 
      EllipticF[ArcSin[Sqrt[6/5]], 15/16]) - 
   2 Sqrt[15] EllipticK[16/15])

In[40]:= %39 // N
Out[40]= 1.05223 + 4.41942 I

In[52]:= With[{x = 1/3},
 Plot[Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], x - 1, 1}]
 ]

as well as

In[41]:= With[{x = -1/2},
 Integrate[
  Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], -1, 1 + x}, 
  Assumptions -> x <= 0]
 ]

Out[41]= 1/48 (150 I Sqrt[2] + 51 Sqrt[3] + 
   34 Sqrt[15] EllipticE[16/15] - 
   68 EllipticE[ArcSin[2 Sqrt[2/5]], 15/16] - 
   68 EllipticE[ArcSin[Sqrt[6/5]], 15/16] + 
   8 (EllipticF[ArcSin[2 Sqrt[2/5]], 15/16] + 
      EllipticF[ArcSin[Sqrt[6/5]], 15/16]) - 
   2 Sqrt[15] EllipticK[16/15])

In[42]:= %41 // N
Out[42]= 1.05223 + 4.41942 I

In[47]:= With[{x = -1/2},
 Plot[Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], -1, 1 + x}]
 ]

whereas

In[35]:= With[{x = 3/2},
 Integrate[
  Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], x - 1, 1}, 
  Assumptions -> x >= 0]
 ]

Out[35]= 1/168 (-175 I Sqrt[7] EllipticE[-(9/7)] - 
   350 EllipticE[7/16] + 175 Sqrt[7] EllipticE[16/7] + 
   400 I Sqrt[7] EllipticK[-(9/7)] - 252 I EllipticK[9/16] + 
   81 Sqrt[7] EllipticK[16/7])

In[36]:= With[{x = -3/2},
 Integrate[
  Sqrt[1 - (x - \[Tau])^2] Sqrt[1 - \[Tau]^2], {\[Tau], -1, 1 + x}, 
  Assumptions -> x <= 0]
 ]

Out[36]= 1/168 (-175 I Sqrt[7] EllipticE[-(9/7)] - 
   350 EllipticE[7/16] + 175 Sqrt[7] EllipticE[16/7] + 
   400 I Sqrt[7] EllipticK[-(9/7)] - 252 I EllipticK[9/16] + 
   81 Sqrt[7] EllipticK[16/7])

In[37]:= N[%36, 39]
Out[37]= 0.171366442761431135877826465734053857640 + 0.*10^-40 I

In[38]:= N[%35, 39]
Out[38]= 0.171366442761431135877826465734053857640 + 0.*10^-40 I

looks good.

POSTED BY: Udo Krause
f[x_] = Boole[-1 <= x <= 1]*Sqrt[1 - x^2];
Integrate[f[\[Tau]] f[0 - \[Tau]], {\[Tau], -\[Infinity], \[Infinity]}]

4/3
POSTED BY: Frank Kampas

Frank, are you sure that for displacement Zero, the overlap area is 4/3 ? Because in this case, the two circles (radius = 1, see first post) will be congruent, therefore their area overlaps 100%.

In other words, A_circle = r² pi = 1² pi = pi. Since we have a half circle, the result is pi/2 or roughly 1,57 area units. That is why I expected the convolution for t = 0 to be pi/2.

Chris

Edit: I just figured that I had a fundamental misunderstanding - convolution gets the moving average, whereas I was thinking of the overlapping area between the two functions. Nevermind.

POSTED BY: Christian Bauer

For t = 0, the integral evaluates to 4/3

for arbitrary t, the range of tau can be calculated as follows:

 Reduce[-1 <= t - tau <= 1 && -1 <= tau <= 1]

(t == -2 && 
   tau == -1) || (-2 < t <= 0 && -1 <= tau <= 1 + t) || (0 < t < 
    2 && -1 + t <= tau <= 1) || (t == 2 && tau == 1)

for t = 1, from the previous result, tau goes from 0 to 1

Integrate[Sqrt[1 - (1 - tau)^2] Sqrt[1 - tau^2], {tau, 0, 1}]

1/18 (-30 I Sqrt[3] EllipticE[-(1/3)] - 30 EllipticE[3/4] + 
   30 Sqrt[3] EllipticE[4/3] + 
   I (38 Sqrt[3] EllipticK[-(1/3)] - 15 EllipticK[1/4] + 
      6 EllipticK[4]))

In[35]:= N[%]

Out[35]= 0.58075 + 7.89492*10^-16 I
POSTED BY: Frank Kampas
f[x_] = Boole[-1 <= x <= 1]*Sqrt[1 - x^2];

int[t_] := NIntegrate[
  f[\[Tau]] f[t - \[Tau]], {\[Tau], -\[Infinity], \[Infinity]}]

Plot[int[t], {t, -3, 3}]

enter image description here

POSTED BY: Frank Kampas

Hi Frank,

here is an analytical solution using Fourier Transformation:

In[5]:= ft = 
 FourierTransform[Piecewise[{{Sqrt[1 - t^2], -1 < t < 1}}], t, s, 
  FourierParameters -> {1, -1}]

Out[5]= (\[Pi] BesselJ[1, Abs[s]])/Abs[s]

In[6]:= invft = 
 InverseFourierTransform[ft*ft, s, t, FourierParameters -> {1, -1}] //
   FullSimplify

Out[6]= 1/4 \[Pi] t MeijerG[{{}, {1, 2}}, {{-(1/2), 1/2}, {}}, t^2/
  4] (-1 + UnitStep[-2 - t] - UnitStep[-2 + t] + 2 UnitStep[t])

At first we try to find the maximum value:

Limit[invft, t -> 0]
Limit[invft, {t ->  10^-100, t -> -10^-100}] // N

8/3
{1.33333, 1.33333}

The first result (8/3) must be a bug.

Let's try to find an exact result by applying l'Hôpital's rule:

In[7]:= Limit[D[t , t]/D[1/(invft/t) , t], t -> 0]
Out[7]= 4/3

Plotting our function invft takes about 10 minutes:

Plot of invft

By using a trick we find a much simpler representation of this rather clumsy function Out[6]. This one will plot smoothly:

In[9]:= invft2 = Limit[invft, t -> x] /. x -> t;

%[[1, 1]][[1]]

Out[10]= 1/3 ((4 + t^2) EllipticE[1 - t^2/4] - 2 t^2 EllipticK[1 - t^2/4])

Regards

Klaus

[Remark: To date, my knowledge doesn't extend much past the Wikipedia site about convolution with textbook examples e.g. two boxcar functions which yield a triangle-shaped function - please bear with me ;)]

Vitaliy, I see you define the function g being dependent upon x and t, for which Integrate yields that big something. OK, but what does this do for me ?

Limit[g[x, t], x -> \[Infinity]]

gives 0 for x -> +/-Infinity, see the attached nb.

Chris

Attachments:
POSTED BY: Christian Bauer

Deleted. Considered integral was not the convolution integral but

Integrate[Sqrt[(1 - t^2) (1 - (t - \[Tau])^2)], {\[Tau], -1, 1}, Assumptions -> -1 <= t <= 1]
POSTED BY: Udo Krause

Because I guess you are not interested in the complex domain you should define your function properly:

f[x_] = Piecewise[{{Sqrt[1 - x^2], -1 < x < 1}}]
Plot[f[x], {x, -1.5, 1.5}, AspectRatio -> Automatic, Filling -> Bottom, PlotTheme -> "Detailed"]

enter image description here

that what Franks function will give if you run ComplexExpand on it. Then try taking simple antiderivative with no limits - you will get pretty monstrous thing:

g[x_, t_] = FullSimplify[Integrate[f[t] f[x - t], t]];
g[x, t] // TraditionalForm

enter image description here

Now you just need to find limits of that at x -> +/- Infinity. That could be a bit challenging or impossible, I did not dwell further.

POSTED BY: Vitaliy Kaurov

You can restrict the function to the range -1 to 1 as follow:

f1[x_] = Boole[-1 <= x <= 1]*Sqrt[1 - x^2];

I was able to do the convolution for various values of t, using NIntegrate. I didn't have the patience to see if Integrate could do it with t as a parameter.

POSTED BY: Frank Kampas

Integrate doesn't fail anymore if I use your function definition, but the output is not that helpful. It seems to me this is some special case that I'm hitting...

Thank you! Chris

p.s. I know that I can still use NIntegrate but ideally, I'd like to have the analytical solution, if there is one.

Attachments:
POSTED BY: Christian Bauer

I don't have the command 'ReIm' available on Mathematica 9.0 but I suppose you meant to say the half-circle function extends beyond the real part that Plot[] Shows me, right ? So how do I get the integral to converge ?

Chris

POSTED BY: Christian Bauer
Plot[ReIm[Sqrt[1 - x^2]], {x, -2, 2}]

enter image description here

POSTED BY: Frank Kampas
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