How does integral2 work?

17 visualizaciones (últimos 30 días)
Peter Uwsen
Peter Uwsen el 1 de Jul. de 2019
Comentada: Peter Uwsen el 2 de Jul. de 2019
Hello,
I'm using the integral2 function for a project. In my report I have to explain what numerical concept integral2 is based on.
I alraedy checked out the referenced papers in the MATLAB documentation, but those where going only into details, so to complicated for me since I don't know much about numerical integration..
Any ideas where I could find some informtaion about the basic principle of the function?
Thank you very much in advance!

Respuesta aceptada

Josh Meyer
Josh Meyer el 2 de Jul. de 2019
Editada: Josh Meyer el 2 de Jul. de 2019
The basic principle of numeric integration is you are calculating the area under the curve by splitting it up into smaller pieces and then adding up the results. There are several different methods to do that, and I recommend reading this Wikipedia page to get started:
Adaptive algorithms like the ones used in integral/integral2 track the error in the calculation, and continually subdivide the integration interval until the tolerance is met. Since they are able to automatically determine that some intervals require tiny pieces while others can use large pieces, they are able to handle "problematic" integrands but at the same time are very fast when the integrand is not problematic:
A common theme you will see in numerical solutions of ODEs and quadrature problems is balancing computation time with accuracy. You can always increase accuracy by using more intervals, or taking tinier steps, but it greatly increases the computation time. So adaptive algorithms that can automatically change the number of intervals/step size to meet the specified error tolerance provide a good balance.
Finally, note that integral2 has two different methods it uses depending on whether the integration interval is infinite or not:
  1 comentario
Peter Uwsen
Peter Uwsen el 2 de Jul. de 2019
Thank you very much for this little guide! :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations 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