Interaction of modes in gyrotrons with a high-frequency field whose longitudinal structure is variable