Modeling long-term capacity degradation of lithium-ion batteries