A method for charging a battery, the method comprising: providing a dynamic representation of cell dynamics for the battery, wherein the dynamic representation of cell dynamics is a representation in which an independent variable of time is expressly incorporated; employing an optimization routine for determining an optimized charging profile for the battery based, at least in part, on the dynamic representation and on tracking one or more system state variables for the battery, wherein employing the optimization routine involves applying the optimization routine to maximize or minimize an objective function derived from the dynamic representation subject to a set of constraints; and applying a charging current to the battery based, at least in part, on the optimized charging profile, characterized in that determining the optimized charging profile further comprises: while charging the battery, repeatedly deriving updated dynamic representations of cell dynamics for the battery by using system identification techniques; and using the repeatedly updated dynamic representations to determine the optimized charging profile, and wherein using system identification techniques to repeatedly derive updated dynamic representations of cell dynamics for the battery involves applying a perturbation signal to the battery that provides an excitation over a frequency range of interest. providing a dynamic representation of cell dynamics for the battery, wherein the dynamic representation of cell dynamics is a representation in which an independent variable of time is expressly incorporated; employing an optimization routine for determining an optimized charging profile for the battery based, at least in part, on the dynamic representation and on tracking one or more system state variables for the battery, wherein employing the optimization routine involves applying the optimization routine to maximize or minimize an objective function derived from the dynamic representation subject to a set of constraints; and applying a charging current to the battery based, at least in part, on the optimized charging profile, characterized in that determining the optimized charging profile further comprises: while charging the battery, repeatedly deriving updated dynamic representations of cell dynamics for the battery by using system identification techniques; and using the repeatedly updated dynamic representations to determine the optimized charging profile, and wherein using system identification techniques to repeatedly derive updated dynamic representations of cell dynamics for the battery involves applying a perturbation signal to the battery that provides an excitation over a frequency range of interest. while charging the battery, repeatedly deriving updated dynamic representations of cell dynamics for the battery by using system identification techniques; and using the repeatedly updated dynamic representations to determine the optimized charging profile, and wherein using system identification techniques to repeatedly derive updated dynamic representations of cell dynamics for the battery involves applying a perturbation signal to the battery that provides an excitation over a frequency range of interest.