  The mathematical theory for optimal switching is by now relatively well
developed, but the number of concrete applications of this theoretical
framework remains few. In this paper, we bridge parts of this gap by applying
optimal switching theory to a set of production planning problems related to
hydropower plants. In particular, we study two different cases involving small
run-of-river hydropower plants and show how optimal switching can be used to
create fully automatic production schemes in these cases, with non-zero cost of
switching between different states of production. Along the way of deriving
these schemes, we also create a model for the random flow of water based on
stochastic differential equations and fit this model to historical data. This
stochastic flow model, which should be of independent interest, mimics the long
term seasonal behaviour of the flow while still allowing for stochastic
fluctuations and can incorporate a given forecast to damp the impact of such
fluctuations in near time. We benchmark the performance of our model using
actual flow data from a small river in Sweden and find that our production
scheme lies close to the optimal, within 2 % and 5 %, respectively, in a long
term investigation of the two plants considered.
