The calculation of electron energy distribution functions in the ionosphere