A dynamic programming algorithm for optimal control of tidal range schemes | Synapse