What means of tolerance in integral2 function?
8 ビュー (過去 30 日間)
In the help of integral2 function, there is sentence about error tolerance.
'AbsTol', absolute error tolerance
'RelTol', relative error tolerance
integral2 attempts to satisfy |Q - I| <= max(AbsTol,RelTol*|Q|),
where I denotes the exact value of the integral. Usually RelTol
determines the accuracy of the integration. However, if |Q| is
sufficiently small, AbsTol determines the accuracy of the
integration, instead. The default value of AbsTol is 1.e-10, and
the default value of RelTol is 1.e-6. Single precision integrations
may require larger tolerances.
what means of this sentence, "where I denotes the exact value of the integral" ? How to calculate exact value in this function?
回答 (1 件)
Jyotish Robin 2018 年 2 月 19 日
I guess you are confused because you seem to think that we need to know Q to estimate q-Q, not true in general. One can still estimate how far q is from Q without actually knowing Q because we know what is the error in the computation based on the theory.
Typically, in most numerical algorithms you can bound the error even if you don't know the exact solution because the theoretical underpinning of a numerical algorithm states that the solution is computed (q in this example) and the actual solution (Q) is related by:
q = Q +/- err(...)
where error(..) is a function of various algorithm parameter.
For example, if you were to write a Taylor expansion of a function, you state the error in terms of distance from the point around which you wrote the Taylor expansion. So if the algorithm is approximating the function, we can know how much error the approximation will have. All numerical algorithm have some way to estimate this error(..) and stop when error(..) goes below certain tolerance.
Hope this helps!