📖 ラプラス方程式とは
ラプラス方程式の定義
ラプラス方程式(Laplace equation)は、以下の形式の楕円型偏微分方程式です:
\[
\nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2} = 0
\]
ラプラス方程式の解を調和関数(harmonic function)と呼びます。
ポアソン方程式(Poisson equation)は、右辺が非ゼロの場合です:
\[
\nabla^2 u = f(x,y,z)
\]
ここで \(f\) は熱源や電荷密度を表します。
物理的意義
- 静電ポテンシャル: 電荷のない領域での電位 \(V\) は \(\nabla^2 V = 0\)
- 定常熱伝導: 熱源のない領域での温度分布 \(T\) は \(\nabla^2 T = 0\)
- 流体ポテンシャル: 非圧縮・非粘性流体の速度ポテンシャル \(\phi\) は \(\nabla^2 \phi = 0\)
- 重力ポテンシャル: 質量のない領域での重力ポテンシャル
調和関数の性質
最大値原理(Maximum Principle): 調和関数は内部に極値を持たず、最大値・最小値は境界上で達成されます。
平均値定理(Mean Value Theorem): 点 \((x_0, y_0)\) における調和関数の値は、その点を中心とする円周上の平均値に等しい:
\[
u(x_0, y_0) = \frac{1}{2\pi} \int_0^{2\pi} u(x_0 + r\cos\theta, y_0 + r\sin\theta) d\theta
\]
一意性: ディリクレ境界条件のもとで、ラプラス方程式の解は一意的です。
💻 例題3.1: 調和関数と最大値原理の検証
Python実装: 調和関数の性質確認
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# 調和関数の例: u(x,y) = x^2 - y^2 (実部 z^2 の調和関数)
def harmonic_function(x, y):
return x**2 - y**2
# 2次元グリッド作成
x = np.linspace(-2, 2, 100)
y = np.linspace(-2, 2, 100)
X, Y = np.meshgrid(x, y)
U = harmonic_function(X, Y)
# ラプラシアンの計算(数値微分)
dx = x[1] - x[0]
dy = y[1] - y[0]
# 2次偏微分
d2u_dx2 = np.zeros_like(U)
d2u_dy2 = np.zeros_like(U)
for i in range(1, len(x)-1):
for j in range(1, len(y)-1):
d2u_dx2[j, i] = (U[j, i+1] - 2*U[j, i] + U[j, i-1]) / dx**2
d2u_dy2[j, i] = (U[j+1, i] - 2*U[j, i] + U[j-1, i]) / dy**2
laplacian = d2u_dx2 + d2u_dy2
# 可視化
fig = plt.figure(figsize=(15, 5))
# 調和関数
ax1 = fig.add_subplot(131, projection='3d')
ax1.plot_surface(X, Y, U, cmap='viridis', alpha=0.8)
ax1.set_xlabel('x')
ax1.set_ylabel('y')
ax1.set_zlabel('u(x,y)')
ax1.set_title('調和関数: u = x² - y²')
# 等高線図
ax2 = fig.add_subplot(132)
contour = ax2.contour(X, Y, U, levels=20, cmap='viridis')
ax2.clabel(contour, inline=True, fontsize=8)
ax2.set_xlabel('x')
ax2.set_ylabel('y')
ax2.set_title('等高線図')
ax2.axis('equal')
# ラプラシアン
ax3 = fig.add_subplot(133)
laplacian_plot = ax3.imshow(laplacian[1:-1, 1:-1], extent=[-2, 2, -2, 2],
origin='lower', cmap='RdBu', vmin=-0.1, vmax=0.1)
plt.colorbar(laplacian_plot, ax=ax3, label='∇²u')
ax3.set_xlabel('x')
ax3.set_ylabel('y')
ax3.set_title(f'ラプラシアン (max: {np.max(np.abs(laplacian[1:-1,1:-1])):.2e})')
plt.tight_layout()
plt.savefig('laplace_harmonic_function.png', dpi=300, bbox_inches='tight')
plt.show()
# 最大値原理の検証
print("=== 最大値原理の検証 ===")
print(f"内部の最大値: {np.max(U[10:-10, 10:-10]):.4f}")
print(f"境界の最大値: {np.max([np.max(U[0,:]), np.max(U[-1,:]), np.max(U[:,0]), np.max(U[:,-1])]):.4f}")
print(f"内部の最小値: {np.min(U[10:-10, 10:-10]):.4f}")
print(f"境界の最小値: {np.min([np.min(U[0,:]), np.min(U[-1,:]), np.min(U[:,0]), np.min(U[:,-1])]):.4f}")
出力解説:
- \(u = x^2 - y^2\) は調和関数(\(\nabla^2 u = 2 - 2 = 0\))
- ラプラシアンが数値誤差の範囲内でゼロであることを確認
- 最大値原理により、極値は境界上に存在