Re: Curious problem with UnitStep
- To: mathgroup at smc.vnet.net
- Subject: [mg67909] Re: Curious problem with UnitStep
- From: dh <dh at metrohm.ch>
- Date: Wed, 12 Jul 2006 05:06:17 -0400 (EDT)
- References: <e8vtkn$sp0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Hanspeter, try:Trace[akf[t, 1.0]] and you will see that the variable t is captured by the dummy variable of the integral. This can e.g. be fixed by using a local variable: akf[x_, Ï?_] := Module[{t},...] Daniel hanspi wrote: > Dear colleagues, > > I am trying to calculate the ACF of a combination of unit steps and its > fourier transform. There I see something very curious. > > I do: > > sw[t_, \[Tau]_] := UnitStep[\[Tau] - Abs[t]] > Plot[sw[t, 1.0], {t, -2, 2}] > > which looks OK. Then: > > akf[x_, \[Tau]_] := > Assuming[{t \[Epsilon] Reals, \[Tau] > 0}, > Integrate[ > sw[t, \[Tau]] sw[x - t, \[Tau]], {t, -\[Infinity], \[Infinity]}]] > Plot[akf[t, 1.0], {t, -2, 2}] > > Which also looks OK. > > But when I just type > > akf[t, 1.0] > > I get as an output > > 2. > > which is wrong, and also > > FourierTransform[akf[t, 1.0], t, \[Omega]] > > gives a wrong result. Why can I plot akf properly, but not evaluate > it? > > Hanspeter >