I wanted to solve a numerical integral of the following equation:
fun = ((x.^4 .* exp(x))) ./ ((exp(x) - 1) .* (exp(x) - 1) );
The limits are from: 0 to Inf
Can anyone ehelp me here?
Thanks in advance.

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 3 日

0 投票

If you have symbolic toolbox
syms x
y = ((x.^4 .* exp(x))) ./ ((exp(x) - 1) .* (exp(x) - 1) );
I = int(y, x, 0, inf)
Result
>> I
I =
(4*pi^4)/15
>> double(I)
ans =
25.9758

4 件のコメント

Raj Patel
Raj Patel 2020 年 10 月 3 日
Thanks Ameer. I had one more question.
I could not write the whole problem in Matlab so I have attached a jpg file for you so that you can understand the question.
Also, note that T = logspace(0, 5), and there is a prefactor of T^3 before the integral as well.
I want some help plotting a loglog plot of (T, Cv). Could you please help me?
Thank you.
Raj Patel.
Ameer Hamza
Ameer Hamza 2020 年 10 月 4 日
Check this code
fun = @(x) (x.^4) ./ (exp(x).*(1 - 1./exp(x)).^2 );
C = @(T) integral(fun, 0, 500/T);
Tv = linspace(0, 1000);
Cv = arrayfun(C, Tv);
loglog(Tv, Cv)
Raj Patel
Raj Patel 2020 年 10 月 4 日
Thanks Ameer. It helped me. Appreciate your efforts.
Ameer Hamza
Ameer Hamza 2020 年 10 月 4 日
I am glad to be of help!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 10 月 3 日

0 投票

integral(fun,0,683)

1 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 10 月 3 日
An alternative by rearranging the terms
fun = @(x) (x.^4) ./ (exp(x).*(1 - 1./exp(x)).^2 );
integral(fun, 0, inf)

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

カテゴリ

質問済み:

2020 年 10 月 3 日

コメント済み:

2020 年 10 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by