Applications of active compensators to magnet power supplies