The task pertains to choosing an algorithm based on the data, requirements and constraints.
I have a number of electrical devices ($d_1,d_2,\dots,d_n$) with batteries. Throughout the day I will receive these devices with arbitrary battery storage (from 0 to 100%). Batteries have varying capacity. My job is to refill the batteries.
I have to consider the price of charging these devices (cost per unit), since the price of charging a device changes throughout the day, for each day we have 24 different prices for 24 different intervals ($c_1,c_2,\dots,c_{24}$).
My goal is to charge these devices optimally, that is determine how much to charge each available device for each time interval in the future, while minimizing the cost of charging them, while also taking into account that I have a limited amount of charging capacity (upper bound) at any one time at $x$ units.
Ideally I would like to run this each time I get a new device, to get the current optimal solution. If possible, I would like to avoid having sharp peaks of aggressive charging followed by low (no) charging.
What kind of algorithm can I use for this task? How would I formulate it? Can LP be used for this?