how to calculate energy level transition