calc_dtmax_dr function

Calculate dTmax by the double regression method