Borrar filtros
Borrar filtros

Best integration method to integrate this oscilating function

17 visualizaciones (últimos 30 días)
Lucas Pollito
Lucas Pollito el 26 de Nov. de 2015
Respondida: Josh Meyer el 9 de Jul. de 2019
Hi. What method of integration, in matlab, should i use ? integral ? quadgk ? gausslegendre ?? any ideas ? this function oscilates a lot. I used trapz, but is was not a good idea
>>
  1 comentario
Neekar Mohammed
Neekar Mohammed el 11 de Jun. de 2019
Hi,
Did you find an answer for your problem?if you do please share it with us. I have the same problem.

Iniciar sesión para comentar.

Respuestas (1)

Josh Meyer
Josh Meyer el 9 de Jul. de 2019
integral can handle oscillatory integrands as long as there aren't too many oscillations, and you supply plenty of WayPoints in the difficult-to-evaluate areas. Think of this input as you telling the solver "these are the interesting areas you'll want to be aware of".
If that doesn't work, you should switch to using quadgk with the same waypoints, but also a large value for MaxIntervalCount. integral uses a large enough default value for MaxIntervalCount so that it rarely needs to be adjusted, but when it does, quadgk let's you make it as large as you want for really problematic integrands. If you don't make it large enough, quadgk will return a message instructing you how much larger to make MaxIntervalCount to complete another iteration.

Categorías

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