fix bug of calculating the t matrix, when begin is not period, and when add the tauInt to endInt