Adaptive numerical limit (and residue) estimation

Numerical extrapolation of a limit (with an error estimate) from only function values

이 제출물을 팔로우합니다

LIMEST will find the limit of a general function (specified only for evaluation) at a given point. You might think of limest like quad, but for limits.
While to me this seems to appear more often as a homework exercise than anything else, it was an interesting problem to solve as robustly as possible for a general case.

As an example, I'll use a moderately difficult one that is simple to analyze, but more difficult to deal with numerically.

fun = @(x) (exp(x)-1-x)./x.^2;

This function cannot be evaluated in MATLAB at x = 0, returning a NaN. While a Taylor series expansion shows the limit to be 1/2, the brute force evaluation of fun anywhere near zero results in numerical trash because of the two orders of cancellation.

fun(0)
ans =
NaN

fun(1e-15)
ans =
110223024625156

fun(1e-10)
ans =
827.403709626582

fun(1e-5)
ans =
0.500000696482408

fun(1e-2)
ans =
0.501670841679489

Limest computes the limit, also returning an approximate error estimate.

[lim,err] = limest(fun,0)
lim =
0.499999999681485
err =
2.20308196660258e-09

I've now added the residueEst tool, for computation of the residue of a function at a known pole. For example, here is a function with a first order pole at z = 0

[r,e]=residueEst(@(z) 1./(1-exp(2*z)),0)
r =
-0.5
e =
4.5382e-12

Again, both an estimate of the residue, as well as an uncertainty around that estimate are provided. Next, consider a function with a second order pole around z = pi.

[r,e]=residueEst(@(z) 1./(sin(z).^2),pi,'poleorder',2)

r =
1
e =
2.6336e-11

See the included demos for many other examples of use.

인용 양식

John D'Errico (2026). Adaptive numerical limit (and residue) estimation (https://kr.mathworks.com/matlabcentral/fileexchange/20058-adaptive-numerical-limit-and-residue-estimation), MATLAB Central File Exchange. 검색 날짜: .

도움

도움 받은 파일: Adaptive Robust Numerical Differentiation

카테고리

Help CenterMATLAB Answers에서 Linear Algebra에 대해 자세히 알아보기

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
1.1.0.0

Included residueEst

1.0.0.0

Change the website description & the title