Terahertz radiation of the stack of intrinsic Josephson junctions in the mesa structure of the layered high- superconductors is analyzed and presented in this paper. The dependence of the radiated power to the geometrical parameters, cavity-waveguide boundaries, and magnetic and electric biases has been investigated. This has been done by numerical calculation of the previously proposed coupled sine-Gordon equations, which characterize the electromagnetic dynamics of the stack of the intrinsic Josephson junctions. Using the obtained numerical results from these coupled equations, the effect of the design parameters, such as dimensions of the mesa structure, the magnitude of the applied magnetic field, and the direct current on the enhancement of the radiated power, is studied. Thus, the radiated power is optimized with respect to these considered parameters. By variation of the number of layers, we also investigate the effect of the number of intrinsic Josephson junctions on the total radiated power. The results from this part are also compared with the previous analytical models.