Short-term optimal operation of a hydroelectric system