Protecting generators, inverters, and battery-backup systems from an EMP