什么是中心差分近似?

对于具有多阶导数的连续函数 f(x)f(x), 根据泰勒展开公式有:

f(t)=f(t0)+f′(t0)(t−t0)+12!f′′(t0)(t−t0)2+13!f′′′(t0)(t−t0)3+…f(t)=f(t_0) + f^\prime(t_0)(t-t_0)+\frac{1}{2!}f^{\prime\prime}(t_0)(t-t_0)^2 + \frac{1}{3!}f^{\prime\prime\prime}(t_0)(t-t_0)^3 + \ldots

示意图如下:

令 h=t−t0h=t-t_0, t0=xt_0=x,则有:

f(x+h)=f(x)+hf′(x)+h22!f′′(x)+h33!f′′′(x)+…f(x−h)=f(x)−hf′(x)+h22!f′′(x)−h33!f′′′(x)+…f(x+h)=f(x) + hf^\prime(x)+\frac{h^2}{2!}f^{\prime\prime}(x) + \frac{h^3}{3!}f^ {\prime\prime\prime}(x) + \ldots\\ f(x-h)=f(x) - hf^\prime(x)+\frac{h^2}{2!}f^{\prime\prime}(x) - \frac{h^3}{3!}f^{\prime\prime\prime}(x) + \ldots

中心差分是近似计算 f(x)f(x) 导数的常用数值方法,根据上面的泰勒展开式有:

一阶中心差分: f′(x)≈f(x+h)−f(x−h)2hf^\prime(x) \approx \frac{f(x+h)-f(x-h)}{2h} 。

二阶中心差分:f′′(x)≈f(x+h)−2f(x)+f(x−h)h2f^{\prime\prime}(x) \approx \frac{f(x+h)-2f(x) + f(x-h)}{h^2}

以此类推,可以得到更高阶导数的近似数值解,其选取的项和系数见下表:

例如,根据该表,三阶导数为:

f′′′(x)≈f(x+2h)−2f(x+h)+2f(x−h)−f(x−2h)2h3f^{\prime\prime\prime}(x) \approx \frac{f(x+2h) - 2f(x+h) + 2f(x-h)-f(x-2h)}{2h^3}