How to do integration using MATLAB

4 ビュー (過去 30 日間)
Mahesha MG
Mahesha MG 2013 年 7 月 1 日
how to get integral of (u^4*exp(u)/(exp(u)-1)^2) du with limit 0 to T (where T is temperature) in MATLAB. I want analytic solution in T where T value will be assigned later. I tried the following: >> u=sym('u')
u =
u
>> int((u^4*exp(u)/(exp(u)-1)^2)) Warning: Explicit integral could not be found.
ans =
int((u^4*exp(u))/(exp(u) - 1)^2, u)
>>
  1 件のコメント
Mahesha MG
Mahesha MG 2013 年 7 月 2 日
編集済み: Mahesha MG 2013 年 7 月 2 日
Is there any way in symbolic math? I tried the following. >> syms u theta t >> int(u^4*exp(u)/(exp(u)-1)^2,0,theta/t) Warning: Explicit integral could not be found.
ans =
int((u^4*exp(u))/(exp(u) - 1)^2, u = 0..theta/t)

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

採用された回答

Pourya Alinezhad
Pourya Alinezhad 2013 年 7 月 1 日
編集済み: Pourya Alinezhad 2013 年 7 月 1 日
instead of using symbolic math you can use numerical integration .
function answer=myfunction(T)
%* Labatto quadrature –
q =quadl('(u.^4.*exp(u))./((exp(u)-1).^2)',0, T)
%you can use quad() and trapz() functions instead
end
  1 件のコメント
Mahesha MG
Mahesha MG 2013 年 7 月 2 日
編集済み: Mahesha MG 2013 年 7 月 2 日
Thank you... It is working.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by