Getting "reached maximum number of intervals in use" error message on simple integration
31 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Matthew Chadder
el 23 de Mayo de 2020
Comentada: Walter Roberson
el 24 de Mayo de 2020
I am trying to do a simple intergration, but am getting the "Reached maximum number of intervals in use" error message and the wrong answer:
This is the code:
fun=@(x) 1./(5 - x.^4)
answer = integral(fun,-10,10)
The answer should be 0.47
0 comentarios
Respuesta aceptada
Walter Roberson
el 23 de Mayo de 2020
your function has discontinuities at +/- 1.495, which is within the range of integration. Numeric integration is not able to resolve the value.
2 comentarios
Walter Roberson
el 24 de Mayo de 2020
No, it is not a removable discontinuity. There function goes to +infinity from the left near 5^(1/4) and to -infinity from the right near 5^(1/4) .
If you examine the interval int(1/(5-x^4), 5^(1/4)-2*10^(-N), 5^(1/4)-10^(-N)) and take the limit as N -> infinity, then Maple says it is 5^(1/4)*ln(2)/20 -- so from 10^(-1001) to 10^(-1000) there is an area about 0.052, from 10^(-1001) to 10^(-1002) there is an area of about 0.052, and so on. And there are an infinite number of these, so the area must approach infinity * 0.052, which would be infinite.
Then you get the same thing on the other side of the discontinuity, except with negative sign. So you have infinity - infinity which is not defined.
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown 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!