Electrodynamic coupling of the magnetosphere and ionosphere