1. A controller of an electrical system that includes a battery, the controller comprising: a communication interface to receive a measurement of a current state of a battery of the electrical system; and one or more processors to: determine a throughput component of degradation of the battery for a time period; determine an aging component of degradation of the battery for the time period; sum the throughput component and the aging component to determine a total battery degradation for the time period; and determine a battery degradation cost based on the total battery degradation for the time period.