直角坐标系分离变量

求解如下边值问题:
在一沿xyz轴长度分别为abc的长方体中,只有一个面上电势不为零

2φ=0φz=c=f(x,y)φx=0=φx=a=0φy=0=φy=b=0φz=0=0\begin{aligned} &\nabla^2 \varphi = 0 \\ &\varphi |_{z=c} = f(x,y)\\ &\varphi_{x=0} = \varphi_{x=a} = 0\\ &\varphi_{y=0} = \varphi_{y=b} = 0\\ &\varphi_{z=0} = 0 \end{aligned}

解:考虑如下可分离变量的形式的解

φ(x,y,z)=X(x)Y(y)Z(z)\varphi(x,y,z) = X(x)Y(y)Z(z)

代入方程中,得到

2φ=d2Xdx2Y(z)Z(z)+X(x)d2Ydy2Z(z)+X(x)Y(y)d2Zdz2=0\nabla^2 \varphi = \frac{d^2X}{dx^2}Y(z)Z(z) + X(x)\frac{d^2Y}{dy^2}Z(z) + X(x)Y(y)\frac{d^2Z}{dz^2} = 0\\

1Xd2Xdx2+1Yd2Ydy2+1Zd2Zdz2=0\frac{1}{X}\frac{d^2X}{dx^2} + \frac{1}{Y}\frac{d^2Y}{dy^2} + \frac{1}{Z}\frac{d^2Z}{dz^2} = 0

三项都只与一个变量有关,因此每一项都应该等于一个常数

1Xd2Xdx2=const=kx21Yd2Ydy2=const=ky21Zd2Zdz2=const=kz2kx2+ky2+kz2=0\frac{1}{X}\frac{d^2X}{dx^2} = \text{const} = -k_x^2\\ \frac{1}{Y}\frac{d^2Y}{dy^2} = \text{const} = -k_y^2\\ \frac{1}{Z}\frac{d^2Z}{dz^2} = \text{const} = -k_z^2\\ k_x^2 + k_y^2 + k_z^2 = 0

边界条件

φx=0=0X(0)=0φx=a=0X(a)=0φy=0=0Y(0)=0φy=b=0Y(b)=0φz=0=0Z(0)=0φz=c=f(x,y)X(x)Y(y)Z(c)=f(x,y)\begin{aligned} \varphi|_{x=0} &= 0 \Rightarrow X(0) = 0\\ \varphi|_{x=a} &= 0 \Rightarrow X(a) = 0\\ \varphi|_{y=0} &= 0 \Rightarrow Y(0) = 0\\ \varphi|_{y=b} &= 0 \Rightarrow Y(b) = 0\\ \varphi|_{z=0} &= 0 \Rightarrow Z(0) = 0\\ \varphi|_{z=c} &= f(x,y) \nRightarrow X(x)Y(y)Z(c) = f(x,y) \end{aligned}

X(x)X(x)可能的解为:

  • kx2=0,X(x)=Ax+Bk_x^2 = 0,X(x) = Ax+B
  • kx2>0,X(x)=Asin(kxx)+Bcos(kxx)k_x^2 > 0,X(x) = A\sin(k_xx) + B\cos(k_xx)
  • kx2<0,X(x)=Aexp(kxx)+Bexp(kxx)=Ashkxx+Bchkxxk_x^2 < 0,X(x) = A\exp(k_xx) + B\exp(-k_xx) = A\sh k_xx+B\ch k_xx

双曲正弦:shx=exex2\sh x = \frac{e^x - e^{-x}}{2}
双曲余弦:chx=ex+ex2\ch x = \frac{e^x + e^{-x}}{2}

根据边界条件X(0)=0,X(a)=0X(0) = 0,X(a) = 0,我们可以得知只有

kx2>0,X(x)=Asin(kxx)+Bcos(kxx)k_x^2 > 0,X(x) = A\sin(k_xx) + B\cos(k_xx)

成立,并且根据边界条件可以得到

X(x)=Asinkxx,kx=mπa,m=1,2,3,X(x) = A\sin k_xx,k_x = \frac{m\pi}{a},m=1,2,3,\cdots

同理有

Y(y)=Csinkyy,ky=nπb,n=1,2,3,Y(y) = C\sin k_yy,k_y = \frac{n\pi}{b},n=1,2,3,\cdots

由于

kx2+ky2+kz2=0k_x^2 + k_y^2 + k_z^2 = 0

我们得到

kz2=kx2ky2=m2π2a2n2π2b2=Kmn2<0k_z^2 = -k_x^2 - k_y^2 = -\frac{m^2\pi^2}{a^2} - \frac{n^2\pi^2}{b^2} = -K_{mn}^2 < 0

Z(0)=0Z(0) = 0得到F=0F=0
所以Z(z)=EshKmnzZ(z) = E\sh K_{mn}z
至此可以得到

φmn(x,y,z)=AsinkxxsinkyyshKmnz\varphi_{mn}(x,y,z) = A\sin k_xx \sin k_yy \sh K_{mn}z

φmn(x,y,z)\varphi_{mn}(x,y,z)的线性组合

φ(x,y,z)=m=1n=1AmnsinkxxsinkyyshKmnz\varphi(x,y,z) = \sum_{m=1}^{\infty}\sum_{n=1}^{\infty}A_{mn}\sin k_xx \sin k_yy \sh K_{mn}z

φ(x,y,z)z=c=f(x,y)\varphi(x,y,z)|_{z=c} = f(x,y)

m=1n=1AmnsinkxxsinkyyshKmnc=f(x,y)\sum_{m=1}^{\infty}\sum_{n=1}^{\infty}A_{mn}\sin k_xx \sin k_yy \sh K_{mn}c = f(x,y)

得到

Amn=40adx0bf(x,y)sinmπaxsinnπbydyabshKmncA_{mn} = \frac{4\int_0^a dx \int_0^b f(x,y) \sin \frac{m\pi}{a}x \sin \frac{n\pi}{b}y dy}{ab\sh K_{mn}c}

完备正交基

[0,a][0,a]上的完备正交基

  • Fourier级数:1,sin2πax,cos2πax,sin4πax,cos4πax,1,\sin \frac{2\pi}{a}x,\cos \frac{2\pi}{a}x,\sin \frac{4\pi}{a}x,\cos \frac{4\pi}{a}x,\cdots
  • Cos级数:1,cos2πax,cos4πax,1,\cos \frac{2\pi}{a}x,\cos \frac{4\pi}{a}x,\cdots
  • Sin级数:sin2πax,sin4πax,\sin \frac{2\pi}{a}x,\sin \frac{4\pi}{a}x,\cdots

应用举例

依旧在之前的长方体中,问题如下

2φ=0φz=c=f(x,y)φy=b=g(x,z)φ其余=0\begin{aligned} &\nabla^2 \varphi = 0 \\ &\varphi |_{z=c} = f(x,y)\\ &\varphi_{y=b} = g(x,z)\\ &\varphi_{\text{其余}} = 0 \end{aligned}

φ=φ1+φ2\varphi = \varphi_1 + \varphi_2
其中φ1\varphi_1满足

2φ1=0φ1z=c=f(x,y)φ其余=0\begin{aligned} &\nabla^2 \varphi_1 = 0 \\ &\varphi_1 |_{z=c} = f(x,y)\\ &\varphi_{\text{其余}} = 0 \end{aligned}

φ2\varphi_2满足

2φ2=0φ2y=b=g(x,z)φ其余=0\begin{aligned} &\nabla^2 \varphi_2 = 0 \\ &\varphi_2 |_{y=b} = g(x,z)\\ &\varphi_{\text{其余}} = 0 \end{aligned}

后面进行相似的求解即可

分离变量一般步骤

  1. 写出可分离变量的形式解
  2. 根据齐次边界条件,确定函数系φmn(x,y,z)\varphi_{mn}(x,y,z)
  3. 取通解:φ=m,nAmnφmn(x,y,z)\varphi = \sum_{m,n} A_{mn}\varphi_{mn}(x,y,z)
  4. 代入非齐次边界条件,得到AmnA_{mn}的表达式

球坐标分离变量

φ(r,θ,ϕ)=R(r)Θ(θ)Φ(ϕ)\varphi(r,\theta,\phi) = R(r)\Theta(\theta)\Phi(\phi)

2φ=1r2r(r2φr)ΘΦ+1r2sinθθ(sinθφθ)+1r2sin2θ2φϕ2=0\nabla^2 \varphi = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2\frac{\partial \varphi}{\partial r})\Theta\Phi + \frac{1}{r^2\sin\theta}\frac{\partial}{\partial \theta}(\sin\theta \frac{\partial \varphi}{\partial \theta}) + \frac{1}{r^2\sin^2\theta}\frac{\partial^2 \varphi}{\partial \phi^2} = 0

也即

d2Φdϕ2+m2Φ=0ddr(r2dRdr)n(n+1)R=01sinθddθ(sinθdΘdθ)+[n(n+1)m2sin2θ]Θ=0\begin{aligned} &\frac{d^2\Phi}{d\phi^2} + m^2\Phi = 0\\ &\frac{d}{dr}(r^2\frac{dR}{dr}) -n(n+1) R = 0\\ &\frac{1}{\sin\theta}\frac{d}{d\theta}(\sin\theta \frac{d\Theta}{d\theta}) + [n(n+1) - \frac{m^2}{\sin^2\theta}]\Theta = 0 \end{aligned}

最后一个方程被称为关联Legendre方程
对于Φ(ϕ)\Phi(\phi):只考虑轴对称的情况,Φ\Phiϕ\phi无关,所以Φ=const\Phi = \text{const}
对于R(r)R(r)

R(r)=Arn+Brn1,n20R(r)不存在,n2<0\begin{aligned} &R(r) = Ar^n + Br^{-n-1},n^2\geq0\\ &R(r) \text{不存在},n^2<0\\ \end{aligned}

对于Θ(θ)\Theta(\theta)

Θ(θ)=APn(cosθ)+BQn(cosθ),n=0,1,2,\Theta(\theta) = AP_n(\cos\theta) + BQ_n(\cos\theta),n=0,1,2,\cdots

其中Pn(θ)P_n(\theta)为第一类Legendre函数,Qn(θ)Q_n(\theta)为第二类Legendre函数
Recall:根据上学期PDE的内容,第二类Legendre函数通常会被消掉

Legendre函数性质

  • 在极轴附近θ0\theta \rightarrow 0cos(θ)±1\cos(\theta) \rightarrow \pm 1

Pn(±1)=1,Qn(±1)|P_n(\pm 1)| = 1,|Q_n(\pm 1)| \rightarrow \infty

  • 正交性

11Pn(x)Pm(x)dx=22n+1δmn\int_{-1}^1 P_n(x)P_m(x)dx = \frac{2}{2n+1}\delta_{mn}

  • 完备性
    [1,1][-1,1]上的任意函数f(x)f(x)都可以展开为

f(x)=n=0CnPn(x)f(x) = \sum_{n=0}^{\infty} C_n P_n(x)

其中

Cn=2n+1211f(x)Pn(x)dxC_n = \frac{2n+1}{2}\int_{-1}^1 f(x)P_n(x)dx

*求解区域包含极轴,并且解具有轴对称性质的情况

此时通解可以写作

φ(r,θ)=n=0(Anrn+Bnrn1)Pn(cosθ)\varphi(r,\theta) = \sum_{n=0}^{\infty} (A_n r^n + B_n r^{-n-1})P_n(\cos\theta)\\

常见的Legendre函数有

P0(cosθ)=1P1(cosθ)=cosθP2(cosθ)=12(3cos2θ1)\begin{aligned} &P_0(\cos\theta) = 1\\ &P_1(\cos\theta) = \cos\theta\\ &P_2(\cos\theta) = \frac{1}{2}(3\cos^2\theta - 1)\\ \end{aligned}

例题

无限大的均匀外场E0\vec{E_0}中放置一个不带电的导体球,球半径为aa,求空间电势

解:以球心为原点,E0\vec{E_0}方向为极轴,建立球坐标系
求解区域为球外空间,包含极轴,且有轴对称性
则通解可以写作

φ=n=0(Anrn+Bnrn1)Pn(cosθ)\varphi = \sum_{n=0}^{\infty} (A_n r^n + B_n r^{-n-1})P_n(\cos\theta)\\

  • rr\rightarrow \infty时,φE0rcosθ\varphi \rightarrow -{E_0} {r}\cos \theta,得到

n=0AnrnPn(cosθ)=E0rcosθ\sum_{n=0}^{\infty} A_n r^n P_n(\cos\theta) = -E_0 r \cos\theta

逐项比较得到

A0=0,A1=E0,An=0,n2A_0 = 0,A_1 = -E_0,A_n = 0,n\geq2

  • φr=a=const\varphi|_{r=a} = \text{const},得到

E0acosθ+n=0Bnan1Pn(cosθ)=const-E_0 a \cos\theta + \sum_{n=0}^{\infty} B_n a^{-n-1} P_n(\cos\theta) = \text{const}

逐项比较得到

B1=E0a3,Bn=0,n2B_1 = E_0a^3,B_n = 0,n\geq2

(目前还没有确定B0B_0的值)

  • 导体球总电荷为零

r=aφrdS=0r=a(E0cosθB0a22E0a3a3cosθ)dS=0B0=0\oint_{r=a} \frac{\partial \varphi}{\partial r} dS = 0\\ \oint_{r=a} (-E_0 \cos \theta - \frac{B_0}{a^2} - 2\frac{E_0a^3}{a^3} \cos\theta) dS = 0 \Rightarrow B_0 = 0

综上

φ=E0rcosθ+E0a3r2cosθ\varphi = -E_0 r \cos\theta + \frac{E_0 a^3}{r^2} \cos\theta

其中第一项为匀强外场的电势,第二项为感应电势

考虑原点处沿极轴方向的电偶极子P\vec{P}
电势:

φ=14πε0Prr3=14πε0Pcosθr2\varphi = \frac{1}{4\pi \varepsilon_0} \frac{\vec{P} \cdot \vec{r}}{r^3} = \frac{1}{4\pi \varepsilon_0} \frac{P\cos\theta}{r^2}

对比可知道

P=4πε0E0a3P = 4\pi \varepsilon_0 E_0 a^3

球面电荷密度

ρS=ε0φrr=a=3ε0E0cosθ\rho_S = -\varepsilon_0\frac{\partial \varphi}{\partial r} |_{r=a} = 3\varepsilon_0 E_0\cos\theta

*Green函数法

待求解问题

2φ=ρϵ边界条件φSφnS\begin{aligned} &\nabla^2 \varphi = -\frac{\rho}{\epsilon} \\ &\text{边界条件}\varphi|_{S} \text{或} \frac{\partial \varphi}{\partial n}|_{S} \end{aligned}

Green函数性质

2G(x,x)=δ(xx)ε\nabla^2 G(\vec{x},\vec{x'}) = -\frac{\delta(\vec{x}-\vec{x'})}{\varepsilon}

方程求解

使用Green第二恒等式

V(φ2ψψ2φ)dV=S(φψψφ)dS\int_V (\varphi \nabla^2 \psi - \psi \nabla^2 \varphi) dV = \oint_S (\varphi \nabla \psi - \psi \nabla \varphi) \cdot d\vec{S}

ψ=G(x,x)\psi = G(\vec{x},\vec{x'})

V(φ2GG2φ)dV=S(φGGφ)dSV(φδ(xx)εG2ρ(x)ε)dV=S(φGGφ)dS\int_V (\varphi \nabla^2 G - G \nabla^2 \varphi) dV = \oint_S (\varphi \nabla G - G \nabla \varphi) \cdot d\vec{S}\\ \int_V (-\varphi \frac{\delta(\vec{x}-\vec{x'})}{\varepsilon} - G \nabla^2 \frac{\rho(\vec{x}')}{\varepsilon}) dV = \oint_S (\varphi \nabla G - G \nabla \varphi) \cdot d\vec{S}

有形式解

ϕ(x)=VG(x,x)ρ(x)dV+εSG(x,x)φ(x)ndsεSφ(x)G(x,x)nds\phi(\vec{x'}) = \int_V G(\vec{x},\vec{x'}) \rho(\vec{x'}) dV + \varepsilon \oint_S G(\vec{x},\vec{x'}) \frac{\partial \varphi(\vec{x})}{\partial n}ds - \varepsilon \oint_S \varphi(\vec{x}) \frac{\partial G(\vec{x},\vec{x'})}{\partial n}ds

x,x\vec{x},\vec{x}'对换

ϕ(x)=VG(x,x)ρ(x)dV+εSG(x,x)φ(x)ndsεSφ(x)G(x,x)nds\phi(\vec{x}) = \int_V G(\vec{x},\vec{x'}) \rho(\vec{x'}) dV' + \varepsilon \oint_S G(\vec{x},\vec{x'}) \frac{\partial \varphi(\vec{x'})}{\partial n}ds' - \varepsilon \oint_S \varphi(\vec{x'}) \frac{\partial G(\vec{x},\vec{x'})}{\partial n}ds'

  • 第一类边值问题,φS\varphi|_S已知
    GS=0G|_{S} = 0,则

ϕ(x)=VG(x,x)ρ(x)dVεSφ(x)G(x,x)nds\phi(\vec{x}) = \int_V G(\vec{x},\vec{x'}) \rho(\vec{x'}) dV' - \varepsilon \oint_S \varphi(\vec{x'}) \frac{\partial G(\vec{x},\vec{x'})}{\partial n}ds'

  • 第二类边值问题,φnS\frac{\partial \varphi}{\partial n}|_S已知
    GnS=const=1εS\frac{\partial G}{\partial n}|_S = \text{const} = -\frac{1}{\varepsilon S},则

φ=VG(x,x)ρ(x)dV+εSG(x,x)φ(x)nds+φS\varphi = \int_V G(\vec{x},\vec{x'}) \rho(\vec{x'}) dV' + \varepsilon \oint_S G(\vec{x},\vec{x'}) \frac{\partial \varphi(\vec{x'})}{\partial n}ds' + \langle\varphi \rangle_S

其中

φS=1SSφ(x)dS\langle\varphi \rangle_S = \frac{1}{S} \oint_S \varphi(\vec{x'}) dS'

第一类边值问题

2G=δ(xx)εGS=0\begin{aligned} &\nabla^2 G = -\frac{\delta(\vec{x}-\vec{x'})}{\varepsilon}\\ &G|_S = 0 \end{aligned}

课本中可能出现的差异

《电磁场》

2G=δ(xx)\nabla^2 G = -\delta(\vec{x}-\vec{x'})\\

《电动力学》和《电磁场》中n^\hat{n}方向相反(前者为外法线,后者为内法线)

静电场部分结束

静磁场

虚晃一枪