A question of the function quadgk

12 次查看(过去 30 天)
Mathis
Mathis 2016-7-18
I recently use the function quadgk to solve the integration of a implicit function. However there is a warning"Reached the limit on the maximum number of intervals in use. Approximate bound on error is 4.0e+00. Increase MaxIntervalCount to 958 to enable QUADGK to continue for another iteration". I can not find the reason for this warning.please help me kindly. thanks very much

回答(1 个)

Walter Roberson
Walter Roberson 2016-7-18
According to the documentation,
'Reached the limit on the maximum number of intervals in use' indicates that the integration was terminated before meeting the tolerance requirements and that continuing the integration would require more than MaxIntervalCount subintervals. The integral may not exist, or it may be difficult to approximate numerically. Increasing MaxIntervalCount usually does not help unless the tolerance requirements were nearly met when the integration was previously terminated.
As indicated by the error message, you should add
'MaxIntervalCount', 958
to give it another try, but you should not be surprised if the integration fails again. "The integral may not exist, or it may be difficult to approximate numerically"
  2 个评论
Mathis
Mathis 2016-7-18
Thank you for you quick answer. The integral for my question do exist in theory.What are the others factors that may lead to this problem?
Walter Roberson
Walter Roberson 2016-7-18
... it may be difficult to approximate numerically.
Rewriting the integral might help.
For example if an integral involved exp(A)*exp(-B) then the exp(A) might overflow to inf and the exp(B) might underflow to 0, leaving a numeric mess, whereas exp(A-B) might be a perfectly comfortable computation.

请先登录,再进行评论。

类别

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