贡献者: 待更新
空间中一个电阻不计的金属盒中有电磁波。金属盒的大小为 $(0 \leqslant x \leqslant a, 0 \leqslant y \leqslant b, 0 \leqslant z \leqslant c)$,电场的波动方程为
\begin{equation}
\boldsymbol{\nabla}^2 \boldsymbol\cdot \boldsymbol{\mathbf{E}} = \frac{1}{c^2} \frac{\partial^{2}{ \boldsymbol{\mathbf{E}} }}{\partial{t}^{2}} ~.
\end{equation}
矢量相等的充要条件是三个分量分别相等
\begin{equation}
\boldsymbol{\nabla}^2 E_x = \frac{1}{c^2} \frac{\partial^{2}{E_x}}{\partial{t}^{2}} ~,\qquad
\boldsymbol{\nabla}^2 E_y = \frac{1}{c^2} \frac{\partial^{2}{E_x}}{\partial{t}^{2}} ~,\qquad
\boldsymbol{\nabla}^2 E_z = \frac{1}{c^2} \frac{\partial^{2}{E_x}}{\partial{t}^{2}} ~.
\end{equation}
下面以 $E_x$ 为例,用分离变量法得出通解。
先令 $E_x = X(x) Y(y) Z(z) T(t)$。代入上式,两边同除 $X(x) Y(y) Z(z) T(t)$ 得
\begin{equation}
\left. \frac{\mathrm{d}^{2}{X}}{\mathrm{d}{x}^{2}} \middle/ X + \frac{\mathrm{d}^{2}{Y}}{\mathrm{d}{y}^{2}} \middle/ Y + \frac{\mathrm{d}^{2}{Z}}{\mathrm{d}{z}^{2}} \middle/ Z = \frac{1}{c^2} \frac{\mathrm{d}^{2}{T}}{\mathrm{d}{t}^{2}} \middle/ T\right.~.
\end{equation}
由于上式每一项都是一个独立变量的函数,所以每一项都等于一个常数。令这些常数为
\begin{equation}\begin{aligned}
&\left. \frac{\mathrm{d}^{2}{X}}{\mathrm{d}{x}^{2}} \middle/ X \right. = -k_x^2 ~,\qquad
\left. \frac{\mathrm{d}^{2}{Y}}{\mathrm{d}{y}^{2}} \middle/ Y \right. = -k_y^2~,\\
&\left. \frac{\mathrm{d}^{2}{Z}}{\mathrm{d}{z}^{2}} \middle/ Z \right. = -k_z^2 ~,\qquad
\frac{1}{c^2} \left. \frac{\mathrm{d}^{2}{T}}{\mathrm{d}{t}^{2}} \middle/ T \right. = -\omega^2~.
\end{aligned}\end{equation}
(取负号是因为我们只对三角函数解感兴趣,指数函数解在这里无关)代入上式,这些常数满足
\begin{equation}
k_x^2 + k_y^2 + k_z^2 = \omega ^2~.
\end{equation}
上面三式的通解是
\begin{equation}
\begin{cases}
X = C_1 \cos\left(k_x x\right) + C_2 \sin\left(k_x x\right) \\
Y = C_3 \cos\left(k_y y\right) + C_4 \sin\left(k_y y\right) \\
Z = C_5 \cos\left(k_z z\right) + C_6 \sin\left(k_z z\right)
\end{cases}~
\end{equation}
时间函数的解取 $T = C \cos\left(\omega t\right) $(时间函数的相位不重要)
由理想导体的电磁场边界条件
\begin{equation}
E_{//} = 0 ~,\qquad \frac{\partial E_\bot}{\partial n} = 0~,
\end{equation}
$ \partial E_x/\partial x = 0$($x \to a$ 时); $E_x = 0$($y \to b$ 或 $z \to c$ 时)。把上面的通解代入条件,得
\begin{equation}
X = C_1 \cos\left(\frac{n_x \pi}{a} x\right) ~,
\qquad
Y = C_4 \sin\left(\frac{n_y \pi}{b} y\right) ~,
\qquad
Z = C_6 \sin\left(\frac{n_z \pi}{c} z\right) ~.
\end{equation}
三个变量相乘,令 $C_1 C_4 C_6 = E_{x0}$, 得
\begin{equation}
E_x = E_{x0} \cos\left(\frac{n_x \pi}{a} x\right) \sin\left(\frac{n_y \pi}{b} y\right) \sin\left(\frac{n_z \pi}{c} z\right) ~.
\end{equation}
同理对 $E_y$, $E_z$ 分析,得到电场的三个分量在盒内的分布
\begin{equation}
\left\{\begin{aligned}
E_x = E_{x0} \cos\left(\frac{n_x \pi}{a} x\right) \sin\left(\frac{n_y \pi}{b} y\right) \sin\left(\frac{n_z \pi}{c} z\right) \\
E_y = E_{y0} \sin\left(\frac{n_x \pi}{a} x\right) \cos\left(\frac{n_y \pi}{b} y\right) \sin\left(\frac{n_z \pi}{c} z\right) \\
E_z = E_{z0} \sin\left(\frac{n_x \pi}{a} x\right) \sin\left(\frac{n_y \pi}{b} y\right) \cos\left(\frac{n_z \pi}{c} z\right)
\end{aligned}\right. ~\end{equation}
\begin{equation}
T = C \cos\left(\omega t\right) ~.
\end{equation}
且满足 $\omega = \pi \sqrt{n_x^2/a^2 + n_y^2/b^2 + n_z^2/c^2}$
特殊地,当盒子是立方体的时候,$a = b = c = L$ 时,$\omega = \pi \sqrt{n_x^2 + n_y^2 + n_z^2}/L $。