A method includes monitoring the voltage of a power source connector for
charging a battery. A determination is made that the battery has entered
a transition phase based on sensing an abrupt change in the voltage. In
response to determining that the battery is in the transition phase, a
capacity of the battery is determined based on a transition phase battery
capacity model that defines the battery's capacity as a function of the
battery's voltage.