Consider an array with same isotropic antennas, $P_{ele}^n$ is the input power of the nth antenna. As I consider antenna radiation efficiency = 1, the $P_{ele}^n$ is also the radiated power of the nth antenna. If the antenna is matched, this normalized power input is proportional to the square of the input signals, or (in a normalized form) $$P_{ele}^n=|w_n|^2\tag{1}$$ where the $w_n$ is the complex weight of the nth antenna. Then, the radiated power for the whole array is given by the sum of the excitation coefficients at each antenna, $$P_{rad}=\sum_{n}P_{ele}^n=\sum_{n}|w_n|^2\tag{2}$$
Meanwhile, as mentioned in [1], [2], the total radiated power can be calculated by the integral of the radiated intensity and the square of beampattern is proportional to the radiated intensity. Therefore, the beampattern can be used to calculated the total radiated power, $$P_{rad}=\int |B(\theta,\phi)|^2d\Omega=\int_{0}^{2\pi}\int_{0}^{\pi}|\mathbf{w}^H\mathbf{a}(\theta,\phi)|^2\sin\theta d\theta d\phi\tag{3}\label{eq3}$$ where $B(\theta,\phi)$ is the beampattern, $\mathbf{w}\in \mathbb{C}$ is the weight, $\mathbf{a}(\theta,\phi)$ is the array manifold, $\theta$, $\phi$ are azimuth and elvation angles, and $d\Omega=\sin\theta d\theta d\phi$ is the infinitesimal solid angle.
However, the simulation results im MATLAB of this two calculations are not equal. For a half-wavelength spaced 64-antenna URA (uniform rectangular array), with uniform beamformers applied ($|w_n|=1$), the total radiated can be calculated as $$P_{rad}= \sum_{n}|w_n|^2=64 W\tag{4}$$ However, the result based on \eqref{eq3} is much larger than 64$W$. Then, I thought that the excitation coefficients in calculating beampattern $B(\theta,\phi)$ should be $\mathbf{w^{\prime}}=\frac{1}{2\sqrt{\pi}}(w_1,...,w_{64})$, as each isotropic antenna radiates equally in angular space. Therefore, each isotrropic antenna has $\frac{1}{4\pi}$ power intensity, and $\frac{1}{2\sqrt{\pi}}$ field intensity, which indicates $\mathbf{w^{\prime}}=\frac{1}{2\sqrt{\pi}}(w_1,...,w_{64})$. But the result is still not equal to the 64$W$.
I don't know why these two results are not the same. Is there a scaling factor that I miss? Or I just calclulated wrong? If the scaling factor exists, then why the second calculation does not guarantee energy conservation?
Reference
[1]Balanis, Constantine A. Antenna theory: analysis and design. John wiley & sons, 2015.
[2]Element and Array Radiation and Response Patterns