Effects of lightning and sprites on the ionospheric potential, and threshold effects on sprite initiation, obtained using an analog model of the global atmospheric electric circuit