Partial discharge of batteries