Borrar filtros
Borrar filtros

integration help function 1/x(e^x -1) from 10^-19 ish to infinity

1 visualización (últimos 30 días)
Sofia Wood
Sofia Wood el 8 de Sept. de 2019
Comentada: Rik el 8 de Sept. de 2019
I want to integrate 1/x(exp(x) -1) from a very small number of order 10^(-19) to infinity. The integral function refuses to do this. Any help?

Respuestas (1)

Jackson Burns
Jackson Burns el 8 de Sept. de 2019
Hi Sofia!
Since you didn't post any code or errors, I don't know what was wrong. It was likely an error with your function definition. Functions that are going to be called with matrices need to be able to operate on matrices, so instead of using / we would use ./ which is elementwise division (otherwise we would be attempting matrix divison, which is not defined).
Here's my solution:
f = @(x) (exp(x) - 1)./x
sol = integral(f,1*10^-19,Inf)
I can't tell exactly what function you are trying to integrate, so I apologize if it is the incorrect one.
Good luck!
  1 comentario
Rik
Rik el 8 de Sept. de 2019
I suspect it should be f=@(x)1./(x.*(exp(x) -1)); instead, but your point still stands.

Iniciar sesión para comentar.

Categorías

Más información sobre Parallel Computing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by