calc_rate function

Calculate rate of change in oxygen over time