(a) The array holds sampled at with step . Form the second difference by offset…
PHYSICS · Subjective · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics
Computational Physics, Ch Differentiating and integrating numbers
Problem
(a) The array f=[0,0.001,0.008,0.027,0.064,0.125] holds f(x)=x3 sampled at x=0,0.1,0.2,0.3,0.4,0.5 with step h=0.1. Form the second difference Dj2f=(fj+1−2fj+fj−1)/h2 by offset slicing (using entries j−1, j, j+1 of f) for every interior index, state how many entries the resulting array has, and compare each value with the exact f′′(x)=6x at the corresponding x.
(b) For f(x)=ln(1+x) at x=1, central differences give D0.2f=0.501677 (step h=0.2) and D0.1f=0.500417 (step h=0.1). Combine these two estimates by Richardson extrapolation for a second-order formula, A=34Dh/2−Dh, and compare the result with the exact f′(1)=1/2.