Application of dynamic programming to optimal energy management of grid-independent hybrid railcars | Synapse