Calculation of electron speed