Development and control of a rail vehicle model to reduce energy consumption and carbon dioxide emissions