I recently installed Mathematica and I wanted to define a functional in it. This is what I did:
autocorrelate[f_[t], τ_, T_] := Integrate[ f[t]*f[t+τ], {t, 0 , T}]/T
This was processed without a hitch.
I tried using it as on a sine function:
autocorrelate[Sin[t], τ, 2Pi]
and it gave me the output of
Cos[τ]/2
Which is right.
Then I defined a function:
a[t_]:= E^t
and when I used the command:
autocorrelate[a[t],τ, 10]
I get the output as autocorrelate[E^t, τ, 10]. Can you please tell me where I'm going wrong?
SetAttributes[autocorrelate, HoldFirst]. Do that and try it again. – march Sep 25 '15 at 05:34f_[[t_]although the current specification is not wrong as long as all your functions are in terms of t. – Sjoerd C. de Vries Sep 25 '15 at 05:42f_[t_]. – Sjoerd C. de Vries Sep 25 '15 at 10:55