Fast estimation of nonlinearities in atomic force microscopy