Calculation of Energy or Number of Ions