Best integration method to integrate this oscilating function

조회 수: 36 (최근 30일)
Lucas Pollito
Lucas Pollito 2015년 11월 26일
답변: Josh Meyer 2019년 7월 9일
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
Neekar Mohammed
Neekar Mohammed 2019년 6월 11일
Hi,
Did you find an answer for your problem?if you do please share it with us. I have the same problem.

댓글을 달려면 로그인하십시오.

답변 (1개)

Josh Meyer
Josh Meyer 2019년 7월 9일
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.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by