I don't know if this is related to the same underlying problem or if it is a different problem with Convolve
. I also realize this is not an answer per se, but it's too large to fit the limits of a comment. I'm posting it here in case it may be related somehow to the strange behavior the OP encountered. When I was working with Convolve
a while ago, I identified the following strange behavior. It's my understanding that the convolution operation is supposed to be both commutative and associative. Below is some demonstration code that produces wildly different results when convolving three functions together. If Convolve
was commutative and associative, it should've given the same results for all 6 variants.
s[f_, t_, delay_, dispersion_] := Apply[f, {t - delay}]*UnitStep[t];
u[t_, delay_, dispersion_] := Exp[-t/(delay + dispersion)]*UnitStep[t];
v[t_, dispersion_] := Exp[-t/dispersion]/dispersion*UnitStep[t];
delayedAndDispersedConcentrationVariant1[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[s[f, x, delay, dispersion], u[x, delay, dispersion],
x, y, Assumptions -> x >= 0]], v[y, dispersion], y, t, Assumptions -> y >= 0]]];
delayedAndDispersedConcentrationVariant2[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[s[f, x, delay, dispersion], v[x, dispersion],
x, y, Assumptions -> x >= 0]], u[y, delay, dispersion], y, t, Assumptions -> y >= 0]]];
delayedAndDispersedConcentrationVariant3[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[u[x, delay, dispersion], s[f, x, delay, dispersion],
x, y, Assumptions -> x >= 0]], v[y, dispersion], y, t, Assumptions -> y >= 0]]];
delayedAndDispersedConcentrationVariant4[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[v[x, dispersion], s[f, x, delay, dispersion],
x, y, Assumptions -> x >= 0]], u[y, delay, dispersion], y, t, Assumptions -> y >= 0]]];
delayedAndDispersedConcentrationVariant5[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[u[x, delay, dispersion], v[x, dispersion],
x, y, Assumptions -> x >= 0]], s[f, y, delay, dispersion], y, t, Assumptions -> y >= 0]]];
delayedAndDispersedConcentrationVariant6[f_, t_, delay_, dispersion_] :=
Module[{x, y},
Evaluate[Convolve[Evaluate[Convolve[v[x, dispersion], u[x, delay, dispersion],
x, y, Assumptions -> x >= 0]], s[f, y, delay, dispersion], y, t, Assumptions -> y >= 0]]];
If we then compute the convolution for an arbitrary function (q[t]
in this example) using the different variants (which differ only by commutative and associative rearrangements), the resulting plots are very different.
q[t_] := Piecewise[{{0.0, t < 1.0}, {3.0, 1.0 <= t <= 2.0}, {0.0,
2.0 < t < 3.5}, {5.0, 3.5 <= t <= 5.0}, {0.0, t > 5.0}}];
Plot[q[t], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant1[q, t, 3.0, 2.0], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant2[q, t, 3.0, 2.0], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant3[q, t, 3.0, 2.0], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant4[q, t, 3.0, 2.0], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant5[q, t, 3.0, 2.0], {t, 0, 20}]
Plot[delayedAndDispersedConcentrationVariant6[q, t, 3.0, 2.0], {t, 0, 20}]
Variants 1 and 2 give the expected result, a delayed and smoothed version of the input function q[t]
.
FullSimplify[g[x,n]]
evaluates toComplexInfinity
symbolically (no need to take the limit of $n\to1$). The reason is thatGamma[1-n]==ComplexInfinity
for all integern
. $\endgroup$case-report from WRI
. The post is made over a year ago, but the bug is still there even in the new version. So it looks like nobody cares, and since I am quite busy with other stuff, I think my best course of action is to just leave it be. $\endgroup$