Integral2 warning: minRectSizePass
5 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am using the integral2, specifally the tiled integral, and I get this warning
Warning: Reached the minimum rectangle size. The result passes the global error test.
So the result passed the global error test. I assume that some local test was not passed...? I am not sure how to interprete this warning and, eventually, how to solve it. Does anyone know about it, or give me some reference?
Best
0 件のコメント
採用された回答
Uday Pradhan
2020 年 8 月 12 日
編集済み: Uday Pradhan
2020 年 8 月 12 日
Hi Maria,
The "integral2" function with the "tiled" method is an adaptive quadrature that transforms the integration region to a rectangle, including a transform that weakens edge singularities. In the transformed domain, the rectangle is subdivided into 4 equal rectangles, each of which may be subdivided into 4 equal rectangles if the error estimate for that part indicates the need, and so forth. It uses a tensor product Gauss-Kronrod rule on each rectangle to approximate the integral over that rectangle and to estimate the error.
This function uses the values of "AbsTol" and "RelTol" variables to estimate the desired accuracy of the integral calculated. You can set these values manually by entering them as name - value pairs in the following manner:
q = integral2(fun,a,b,c,d,'AbsTol',1e-4,'RelTol',1e-4);
The integral2 function attempts to satisfy:
abs(q - Q) <= max(AbsTol,RelTol*abs(q))
Hence, the warning that you see is caused possibly by the error limits being small enough that the refinement of the domain of integration by the algorithm reached its minimum step size (i.e. rectangular size in this case). You can get rid of this by setting custom tolerance values as mentioned above. Also, your function may have a singularity over the region of integration. The global test passed part suggests that the error tolerance limits were satisfied by all the refinements of the region over which you are integrating. Do keep in mind that this is a warning not an error, so the answer is still acceptable within the given tolerance levels.
To get a better idea of the inner algorithm, I suggest you try the quad2d function to calculate your integral which is similar to integral2d but also allows to plot the regions which fail the error tolerance tests. Please refer to the following links to get a better understanding of the ideas mentioned above : blog, integral2 algorithm.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!