Convolution of a gaussian and an exponential
조회 수: 42 (최근 30일)
이전 댓글 표시
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))
B = N0*exp(-a*E0)
int(A*B,E0,-inf,Emax)
댓글 수: 0
답변 (1개)
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))
B = N0*exp(-a*E0)
int(A*B,E0,-inf,Emax)
Why does the Question refer to convolution? Asking because this integral is not a convolution integral, if convolution is really what is desired.
댓글 수: 2
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 Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!