avoid warning "Covariance of the parameters could not be estimated" by changing curve_fit method to 'trf'