Computational Physics, Python, Interpolation, Differentiation, Integration.
dh[i]=derivative(h,xI[i],dx=1e-5,order=7) dh_fnc=interpolate.interp1d(xI,dh,kind='cubic') plt.plot(xI,h(xI)) plt.plot(xI,dh_fnc(xI),color='red') Now we can look for maxima max_h=optimize.newton(dh_fnc,1.2) print(max_h) plt.plot(xI,h(xI)) plt.plot([max_h,max_h],[-1,1.5]) plt.xlim(0.5,1.1)