curve fitting for exponential function