mathematica 验证离散导数格式
数值计算中,需要用差分代替差商,离散常微分方程或者偏微分方程的导数。
比如已知\(f_{i+1},f_{i+3},f_{i+4}\) 求\(f_i\)使得\(f^{(3)}(i)=0\)近似成立,误差为四阶精度
已知\(f_{i}=f_{i+4}-2*(f_{i+3}-f_{i+1})\) 使上述条件成立
如何验证该公式,在mathematica中输入如下命令
a1 = Series[f[i + h], {h, 0, 3}]
a2 = Series[f[i + 3 h], {h, 0, 3}]
a3 = Series[f[i + 4 h], {h, 0, 3}]
a = a3 - 2*(a2 - a1)
\(f_{i+4}-2*(f_{i+3}-f_{i+1})=a=f(i)+2 h^3 f^{(3)}(i)+O\left(h^4\right)\)
如果忽略掉四阶小量\(O\left(h^4\right)\),那么\(f_i=f_{i+4}-2*(f_{i+3}-f_{i+1})\)使得\(f^{(3)}(i)=0\),离散误差\(O\left(h^4\right)\)
The purview of science grows rapidly with time. It is the responsibility of each generation to join new insights to old wisdom, and to distill the key ideas for the next generation --James P. Sethna