Convolution of a gaussian and an exponential
40 ビュー (過去 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!