Computational Physics, Python, Interpolation, Differentiation, Integration.
making about a 10% error. Using a cubic instead, we get less than 1%. In fact, for the early points we do really well: plt.plot(x_fine,np.abs(f_cube(x_fine)-np.sin(2*x_fine**2))) plt.yscale('log') plt.show() So we are getting 1 part in a 100,000 up to about x=1 using only 40 data points for the