Numerical study for electromagnetic wave emission in thin samples of intrinsic Josephson junctions