Convolution of a gaussian and an exponential

조회 수: 42 (최근 30일)
Lamees Alkiyumi
Lamees Alkiyumi 2022년 9월 27일
댓글: Paul 2022년 9월 27일
Hello,
I am trying to get a fitting equation by calculating the integral of a gaussian with an exponential, however, I am unsure why matlab is giving me results with complex numbers. Any help would be appreciated.
Thanks :)
syms I0 E E0 s N0 a Emax
A = I0*exp(-(E-E0)^2/(2*s^2*pi))
A = 
B = N0*exp(-a*E0)
B = 
int(A*B,E0,-inf,Emax)
ans = 

답변 (1개)

Paul
Paul 2022년 9월 27일
편집: Paul 2022년 9월 27일
Are all of the parameters in the problem real? If so, then asserting them as such yields a simpler result.
syms I0 E E0 s N0 a Emax real
A = I0*exp(-(E-E0)^2/(2*s^2*pi))
A = 
B = N0*exp(-a*E0)
B = 
int(A*B,E0,-inf,Emax)
ans = 
Why does the Question refer to convolution? Asking because this integral is not a convolution integral, if convolution is really what is desired.
  댓글 수: 2
Lamees Alkiyumi
Lamees Alkiyumi 2022년 9월 27일
Yes all the parameters are real.
Thanks Paul appreciate it.
I was trying to replicate the following convultion but under different limits:
What should I add for it to be a convolution integral?
Many thanks.
Paul
Paul 2022년 9월 27일
Hi Lamees,
Using the notation in the linked reference, specifically in equation (3), the definition of convolution is:
given functions a(x) and b(x), their convolution is
c(y) = int(a(x)*b(y-x),x,0,inf) = int(a(y-x)*b(x),x,0,inf)
Note the argument of b in the first instance and of a in the second, and the lmits of integration, which implicitly assume that a(x) = b(x) = 0 for x < 0.
In your case, with x = E0, I think you just did
c(y) = int(a(x)*b(x),x,-inf,Emax)
That is, your equation doesn't do the "flip and slide" of b(x) (or alternatively a(x) ). Not sure what you're assuming for those limits of integration.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by