calculating energy production