Optimising AC electric railway power flows with power electronic control