According to the coupled-mode theory of variable crosssection waveguide and differential equations which the axial profile function of electric field satisfies, the program with auto optimized function was written. The influence of taper angle, cavity dissipation and mismatch of output cavity and external circuit on resonant frequency, quality factor and field profile was studied in detail. It further established the base of the interaction of highfrequency field with electron beam and of output cavity.