Please help me. I want to integrate the following function from 0 to plus infinity.

syms r r0 sg g(r)=r*exp(-(log(r)-log(r0))^2/(2*sg^2));

6 件のコメント

John D'Errico
John D'Errico 2023 年 2 月 1 日
I would assume you REALLY want to integrate from r0 to infinity.
El Houssain Sabour
El Houssain Sabour 2023 年 2 月 1 日
I'm supposed to integrate from 0 to infinity. I'm almost desperate. I have to calculate that.
Torsten
Torsten 2023 年 2 月 1 日
It's the lognormal distribution.
Look here which functions MATLAB supplies:
David Goodmanson
David Goodmanson 2023 年 2 月 2 日
編集済み: David Goodmanson 2023 年 2 月 2 日
Hi ES,
As Torsten has pointed out, you have a log-normal distribution, and that's all you need to start searching around. In your 18.55.57 jpeg expression for zeta, the integral is the log-normal's second moment about the origin. If you go to Wikipedia for example, you can find an algebraic expression for the nth moment..
El Houssain Sabour
El Houssain Sabour 2023 年 2 月 2 日
It's also about the integral, which is in the equation. And that's my problem. I can't implement this with Matlab.
Torsten
Torsten 2023 年 2 月 2 日
編集済み: Torsten 2023 年 2 月 2 日
As you can see under
integral_{r=0}^{r=Inf} r^n * 1/(r*sqrt(2*pi*sigma^2)) * exp(-1/2 * (log(r)-mu)^2 / sigma^2) dr
=
exp( n*mu + 1/2 * n^2*sigma^2)
Both of your two integrals in question follow from this relation for n=2 and n=3.
So your integral becomes
integral_{r=0}^{r=Inf} r^(n-1) * exp(-1/2 * (log(r)-log(r0))^2 / sg^2) dr =
sqrt(2*pi*sg^2) * exp( n*log(r0) + 1/2 * n^2*sg^2)
for n = 2: sqrt(2*pi*sg^2) * r0^2* exp( 2*sg^2)
for n = 3: sqrt(2*pi*sg^2) * r0^3* exp( 4.5*sg^2)

サインインしてコメントする。

回答 (1 件)

Dr. JANAK TRIVEDI
Dr. JANAK TRIVEDI 2023 年 2 月 2 日
編集済み: Torsten 2023 年 2 月 2 日
syms r r0 sg
g(r) = r * exp(-(log(r) - log(r0))^2 / (2 * sg^2));
int_g = int(g,r,0,inf)
int_g = 
Note that the inf keyword represents infinity. The integral of g(r) is calculated over the interval [0,inf). You can also specify other intervals of integration as needed.

1 件のコメント

Torsten
Torsten 2023 年 2 月 2 日
I don't see that the integral can be calculated by using "int".

サインインしてコメントする。

カテゴリ

質問済み:

2023 年 2 月 1 日

編集済み:

2023 年 2 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by