Numerical modeling of magnetron generators with allowance for the mode competition