(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]\mathbf{f} = [0,\,0.001,\,0.008,\,0.027,\,0.064,\,0.125] holds f(x)=x3f(x)=x^3 sampled at x=0,0.1,0.2,0.3,0.4,0.5x=0,0.1,0.2,0.3,0.4,0.5 with step h=0.1h=0.1. Form the second difference Dj2f=(fj+1−2fj+fj−1)/h2D^2_jf = (f_{j+1}-2f_j+f_{j-1})/h^2 by offset slicing (using entries j−1j-1, jj, j+1j+1 of f\mathbf{f}) for every interior index, state how many entries the resulting array has, and compare each value with the exact f′′(x)=6xf''(x)=6x at the corresponding xx. (b) For f(x)=ln⁡(1+x)f(x)=\ln(1+x) at x=1x=1, central differences give D0.2f=0.501677D_{0.2}f = 0.501677 (step h=0.2h=0.2) and D0.1f=0.500417D_{0.1}f = 0.500417 (step h=0.1h=0.1). Combine these two estimates by Richardson extrapolation for a second-order formula, A=4Dh/2−Dh3,A = \frac{4D_{h/2} - D_h}{3}, and compare the result with the exact f′(1)=1/2f'(1)=1/2.

Browse the problem library