In this paper, a multifrequency, multimode gyrotron has been designed, which can operate at 28, 29, 31, and 32 GHz with corresponding modes TE0.3, TE+5.2, TE−3.3, and TE+6.2, respectively. For all operating status, the mode competitions have been investigated carefully with the help of a new time-dependent, multimode, self-consistent code, which is built on the trajectory approach. For the operating at 28 GHz, it also has been simulated by CST Particle Studio. They have similar results when comparing two results. For the operating at other status, the changes of electron parameters caused by the changed dc-magnetic field have been analyzed in detail. In the analyzes, the guiding center radius and Larmor radius would not be influenced severely, but the velocity ratio would be influenced seriously, such as, the velocity ratio of operating at 32 GHz would be reduced to about 0.9787, which caused a severe reduction in the efficiency. In order to alleviate the influences, a compensation magnetic coil (CMC) has been used in the magnetron injection gun region, in which the changes of electron parameters have been analyzed too. The simulation results show that the electron efficiency of operating at 32 GHz can be increased from 24.6% to 31% by applying CMC. The multimode multifrequency gyrotron operated at ka -band gyrotron has been investigated in theory, which can provide new possibilities in high-power millimeter source development.