Let's say I want to convolve two functions (f and g), a gaussian with a breit-wigner:
f[x_] := 1/(Sqrt[2 π] σ)Exp[-(1/2) ((x - μ)/σ)^2];
g[x_] := 1/π (γ/((x - μ)^2 + γ^2));
One way is to use Convolve like:
Convolve[f[x],g[x],x,y];
But that gives:
(γ Convolve[E^(-((x - μ)^2/(2 σ^2))),1/(γ^2 + (x - μ)^2), x, y])/(Sqrt[2] π^(3/2) σ)
,which means it couldn't do the convolution.
I then tried the integration (the definition of the convolution):
Integrate[f[x]*g[y - x], {x, 0, y}, Assumptions->{x > 0, y > 0}]
But again, it couldn't integrate. I know that there are functions that can't be integrated analytically, but it seems to me that whenever I go into convolution, I find another function that can't be integrated.
Is the numerical integration the only way to do convolution in Mathematica (besides those simple functions in the examples), or am I doing something wrong?
My target is to convolute a crystal-ball with a breit-weigner. The CB is something like:
Piecewise[{{norm*Exp[-(1/2) ((x - μ)/σ)^2], (
x - μ)/σ > -α},
{norm*(n/Abs[α])^n*
Exp[-(1/2) α^2]*((n/Abs[α] - Abs[α]) - (
x - μ)/σ)^-n, (x - μ)/σ <= -α}}]
I've done this in C++ but I thought I try it in Mathematica and use it to fit some data. So please tell me if I have to make a numerical integration routine in Mathematica or there's more to the analytic integration.
mu
inf
andg
should most likely be different variables, e.g. themu
inf
is the mass of a resonance whileg
(I guess you have a resolution function in mind) would be centered at zero. $\endgroup$