Routines for fitting kinetic models with one or more state   variables to chemical degradation data