Geomagnetic Perturbations and Upper-Atmosphere Heating