필터 지우기
필터 지우기

integral method gives an answer of zero

조회 수: 2 (최근 30일)
Stashu Kozlowski
Stashu Kozlowski 2023년 4월 2일
답변: Walter Roberson 2023년 4월 2일
Hello,
I have been trying compute
where β is a fixed constant. My code consists of the following:
k = 1.380649*10^(-23);
t = 5800;
beta = (k*t)^(-1);
fun = @(x) x.^3 ./ (exp(beta .* x) - 1);
q = integral(fun,0,Inf)
This results in the integral being evaluate as 0. However, I know that this integral is infact not zero over the domain
Am I making somekind of mistake?

채택된 답변

Walter Roberson
Walter Roberson 2023년 4월 2일
The values are so small relative to your constants that they might as well be zero.
With your beta being 1/(k*t) you are ending up with some large exponents in the exp() -- large enough that you are going to overflow numerically.
syms x
Q = @(v) sym(v);
k = Q(1380649)*Q(10)^(-29);
t = Q(5800);
beta = (k*t)^(-1);
fun = x.^3 ./ (exp(beta .* x) - 1)
fun = 
int(fun, 0, Inf)
ans = 
vpa(ans)
ans = 
2.6702586874891152137386272298896e-76

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by