Fix bugs, how to model linearly charge and discharge cannot be done at the same time