Design of an intelligent traction power supply system for power supply within the railway power grid and to optimise the interface with the public power grid.