Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Convolution Integral

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72740] Re: Convolution Integral
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 17 Jan 2007 06:48:45 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <eoht0r$pti$1@smc.vnet.net>

Mr Ajit Sen wrote:
> Dear Mathgroup,
> 
> Could anyone please help me with the following?
> 
>  I'd like to find the convolution of 2 arbitrary
> functions, f(t) and g(t) in the Laplace transform
> sense,i.e., 
> 
> convolve[f[t],g[t]]=Integrate[f[u]*g[t-u],{u,0,t}]
> 
> Thus, I'd like convolve[Sin[t],Exp[-t]] to return
> 
>    (Exp[-t]-Cos[t]+Sin[t])/2 .
> 
> My several attempts with function definitions such as
> 
>   convolve[f_,g_]:=Integrate[f[u]*g[t-u],{u,0,t}]
> 
>  
> convolve[f[t_],g[t_]]:=Integrate[f[u]*g[t-u],{u,0,t}]
> 
>   convolve[f_,g_][t_]:=Integrate[f[u]*g[t-u],{u,0,t}]
> 
> all failed (because of the dummy u ? )
> 
> Thanks in advance.
> Sen.

Hi Sen,

The following thread, "Function-type arguments in function definition," 
explains in detail what you are looking for (also with a convolution 
function.)

http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/b6478604df3636e4/518ed9af2936a8d1?lnk=gst&q=function+as+argument&rnum=1&hl=en#518ed9af2936a8d1

Another approach is the following (although it does not work with pure 
functions.) We use replacement rules and an extra argument to indicate 
the name of the independent variable.

In[1]:=
ClearAll[convolve];
convolve[f_, g_][t_] := Module[{u},
    Integrate[(f /. t -> u)*(g /. t -> t - u),
     {u, 0, t}]]

In[3]:=
convolve[Sin[t], Exp[-t]][t]

Out[3]=
1   -t
- (E   - Cos[t] + Sin[t])
2

In[4]:=
convolve[Sin[x], Exp[-x]][x]

Out[4]=
1   -x
- (E   - Cos[x] + Sin[x])
2

Regards,
Jean-Marc


  • Prev by Date: Re: Difficulties with Complex-Modulus Series
  • Next by Date: Re: Difficulties with Complex-Modulus Series
  • Previous by thread: Re: Convolution Integral
  • Next by thread: Nonautonomous ODEs