1. A method for controlling a plurality of energy storage systems coupled to a power grid, the method comprising: providing a plurality of energy storage systems; providing a central processor and a plurality of storage system processors, the central processor being in communication with the plurality of storage system processors, each storage system processor being coupled to one of the plurality of energy storage systems; the central processor being programmed to generate a lookup table approximating a value function having four dimensions including: state of the storage system, price of electricity, prior low bid, and prior high bid; the central processor or the plurality of storage system processors being programmed to generate near-optimal charge/discharge instructions for the plurality of energy storage systems based on the generated lookup table; and charging/discharging the plurality of energy storage systems based on the generated charge/discharge instructions; wherein generation of the lookup table comprises: observing an initial numeric value for a first set of dimensions and exploiting monotonicity of the value function to update a first region of the lookup table; and iteratively observing subsequent numeric values for a next set of dimensions and exploiting monotonicity of the value function to update subsequent regions of the lookup table, the lookup table having numeric values for all possible sets of dimensions.