Not having Integration result

2 ビュー (過去 30 日間)
Mohammad Humaun Kabir
Mohammad Humaun Kabir 2022 年 5 月 27 日
コメント済み: Torsten 2022 年 5 月 27 日
I am trying to integrate this function using the code -
----------------
syms x
xd = 700/319
fun = ((x^4)* exp(x))/((exp(x) -1)^2);
cv = int(fun,0,xd)
--------------
But, I am getting same form of the function like that -
>> Cv_calculatior
cv =
int((x^4*exp(x))/(exp(x) - 1)^2, x, 0, 700/319)
What's wrong here??

採用された回答

Torsten
Torsten 2022 年 5 月 27 日
編集済み: Torsten 2022 年 5 月 27 日
Using "int", MATLAB tries to find an analytical antiderivative for your function, but cannot find one.
Use numerical integraion using "integral" instead. Don't start at 0 since your function has a division by zero at this location.
fun = @(x) x.^4.*exp(x)./(exp(x) -1).^2;
xd = 700/319;
result = integral(fun,1e-16,xd)
  2 件のコメント
Mohammad Humaun Kabir
Mohammad Humaun Kabir 2022 年 5 月 27 日
編集済み: Mohammad Humaun Kabir 2022 年 5 月 27 日
Thanks. Would you like to help me to write the whole code. Here is my problem -
Varying temparature from 0 degree to 800 degree with 2 degree interval ( T = 0:2:800)
integrating this function, y = ((x.^4).* exp(x))./((exp(x) -1).^2) for 0 to T, where T has a range of data
Expecting result: a list of data, T vs y
Torsten
Torsten 2022 年 5 月 27 日
fun = @(x) x.^4.*exp(x)./(exp(x) -1).^2;
T = [1e-16,2:2:800];
y(1) = 0;
for i = 2:numel(T)
y(i) = y(i-1) + integral(fun,T(i-1),T(i));
end
plot(T,y)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by