Theories and simulations of elves, sprites and blue jets