Modeling of electrochemical capacitors under dynamical cycling