Optimising Harmonic Mitigation in AC Railway Systems