Incorrect evaluation of a convolution
That does not explain why your solution does not work (I'm pretty sure it is because of your definition of stripe
), but if you replace stripe
with:
stripe[x_, d_] := HeavisidePi[Mod[x/(2 d), 1]]
you get:
conv[x_] = Convolve[UnitStep[tau + 5] stripe[tau, 1] UnitStep[5 - tau],
gaussian[tau, 0, 0.5], tau, x]
(* -0.5 (1. Erf[2.82843 - 1.41421 x] + 1. Erf[5.65685 - 1.41421 x] +
Erf[1.41421 (-5. + x)] + Erf[1.41421 (-3. + x)] +
Erf[1.41421 (-1. + x)] - 1. Erf[1.41421 x] +
Erf[1.41421 + 1.41421 x] - 1. Erf[2.82843 + 1.41421 x] +
Erf[4.24264 + 1.41421 x] - 1. Erf[5.65685 + 1.41421 x]) *)
Plot[conv[x], {x, -10, 10}]
With x
and d
not numeric:
If[EvenQ[Quotient[x, d]], 1, 0]
(* 0 *)
The essential difficulty is using programming constructs If
and EvenQ
to formulate a symbolic analysis problem.