Most comments focus on consumer electronics where battery replacement is around $70-200. However the biggest impact is actually on EVs, where replacement costs are of much greater concern.
For large batteries supporting buildings or power plants, there's usually an optimization software that balances energy usage opportunity costs, and the amortized costs of battery degradation (personally built one in my previous job).
Michelangelo only had one real passion: sculpture. He was later asked to do the other works, like the Chapel, and if you notice it's clearly visible the "sculptor" style transfer to the paintings. That's not the case of Caravaggio.
For large batteries supporting buildings or power plants, there's usually an optimization software that balances energy usage opportunity costs, and the amortized costs of battery degradation (personally built one in my previous job).