Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I use Mathematica to find the convolution $f*f$ for

f[t_]:=Piecewise[
        {{t*(Pi - 4*t + t^2), Inequality[0, Less, t, LessEqual, 1]}, 
         {(-t)*(2 + t^2 - 4*Sqrt[-1 + t^2] - 2*ArcCsc[t] + 2*ArcTan[Sqrt[-1 + t^2]]), 
           1 < t < Sqrt[2]
        }}, 0]

I would need a symbolic expression for the convolution. Thanks for any help.

share|improve this question
1  
Have you tried implementing the definition with NIntegrate ? – b.gatessucks Jan 8 at 8:28

1 Answer

Hard to do it analytically. Tried convolution theorem also. ForuierTransform had hard time with it as well as Integrate. So, here is a numerical solution.

The support needed is really only from $0$ to $2 \sqrt(2)$ since your function exist over $0$ to $\sqrt(2)$ but I integrated it over little larger range for the plot to look better.

Mathematica graphics

Hence

  f[t_?NumericQ] := 
  Piecewise[{{t*(Pi - 4*t + t^2), 
     Inequality[0, Less, t, LessEqual, 
      1]}, {(-t)*(2 + t^2 - 4*Sqrt[-1 + t^2] - 2*ArcCsc[t] + 
        2*ArcTan[Sqrt[-1 + t^2]]), 1 < t < Sqrt[2]}}, 0];
g[t_?NumericQ] := 
 NIntegrate[f[tao] f[t - tao], {tao, -Infinity, Infinity}]
data = Table[{t, g[t]}, {t, -0.5, 6, .01}];

Show[ListLinePlot[data, PlotStyle -> Red, PlotRange -> All], 
 Plot[f[t], {t, -.5, 6}, PlotRange -> All, Exclusions -> None]]

Mathematica graphics

The red plot is the convolution and the blue curve is $f(t)$

share|improve this answer
Why not integrating over -Infinity, Infinity ? NIntegrate handles that well. Also, in your plot you can remove the little gap by adding Exclusions->None. – b.gatessucks Jan 8 at 10:39
Yes, I know that NIntegrate can do that. But why? f(t) only runs from 0 to sqrt[2]. Hence the convolution integral only needs to to run from 0 to 2*sqrt(2). The rest is zero. I'll add Exclusions->None, I did not notice the small break there. thanks. – Nasser Jan 8 at 10:58
Just to make your g more generic. – b.gatessucks Jan 8 at 11:02
Ok, made it +- infinity also, and exclusion none. thanks. – Nasser Jan 8 at 11:02
1  
@selinia are you sure an analytical solution exists? – rcollyer Jan 8 at 18:18
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.