Secular variation of activity in comets 2P/Encke and 9P/Tempel 1