Optimal taxation with intermittent generation