  We study the optimal control of storage which is used for arbitrage, i.e. for
buying a commodity when it is cheap and selling it when it is expensive. Our
particular concern is with the management of energy systems, although the
results are generally applicable. We consider a model which may account for
nonlinear cost functions, market impact, input and output rate constraints and
inefficiencies or losses in the storage process. We develop an algorithm which
is maximally efficient in then sense that it incorporates the result that, at
each point in time, the optimal management decision depends only a finite, and
typically short, time horizon. We give examples related to the management of a
real-world system.
