Mathematica: Convolution between Lorentzian and Gaussian

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
Niles
Messages
1,834
Reaction score
0
Hi

I have the following code:

Code:
lorentz[A_, Ox_, Oy_, FWHM_, x_] := 
  A (1/3.14) FWHM/((x - Ox)^2 + FWHM^2) + Oy;
gauss[A_, Ox_, Oy_, x_, C_] := A Exp[-(x - Ox)^2 C] + Oy;

Convolve[lorentz[1, 0, 0, 1, x], gauss[1, 0, 0, x, 1], x, y]

It takes extremely long time for this to finish -- is it just an example, where Mathematica is the wrong tool?Niles.
 
Physics news on Phys.org
It only takes 15 seconds on my laptop, but the result probably is not what you want:

0.318471 Convolve[1/(1 + x^2), E^-x^2, x, y]

You may want to use ListConvolve and do it numerically.
 
Last edited: