🌐 EN | đŸ‡ŻđŸ‡” JP | Last sync: 2025-11-16

Chapter 3: Laplace Equation and Potential Theory

Laplace Equation and Potential Theory

🎯 Learning Objectives

📖 What is the Laplace Equation?

Definition of the Laplace Equation

The Laplace equation is an elliptic partial differential equation of the following form:

\[ \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 \]

Solutions to the Laplace equation are called harmonic functions.

The Poisson equation is the case where the right-hand side is non-zero:

\[ \nabla^2 u = f(x,y,z) \]

where \(f\) represents heat sources or charge density.

Physical Significance

Properties of Harmonic Functions

Maximum Principle: Harmonic functions do not have extrema in the interior; maximum and minimum values are attained on the boundary.

Mean Value Theorem: The value of a harmonic function at a point \((x_0, y_0)\) equals the average value on a circle centered at that point:

\[ 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 \]

Uniqueness: Under Dirichlet boundary conditions, the solution to the Laplace equation is unique.

đŸ’» Example 3.1: Verification of Harmonic Functions and Maximum Principle

Python implementation: Verification of harmonic function properties
# Requirements:
# - Python 3.9+
# - matplotlib>=3.7.0
# - numpy>=1.24.0, <2.0.0

"""
Example: đŸ’» Example 3.1: Verification of Harmonic Functions and Maximu

Purpose: Demonstrate data visualization techniques
Target: Intermediate
Execution time: 2-5 seconds
Dependencies: None
"""

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Example of a harmonic function: u(x,y) = x^2 - y^2 (real part of z^2)
def harmonic_function(x, y):
 return x**2 - y**2

# Create 2D grid
x = np.linspace(-2, 2, 100)
y = np.linspace(-2, 2, 100)
X, Y = np.meshgrid(x, y)
U = harmonic_function(X, Y)

# Calculate Laplacian (numerical differentiation)
dx = x[1] - x[0]
dy = y[1] - y[0]

# Second partial derivatives
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

# Visualization
fig = plt.figure(figsize=(15, 5))

# Harmonic function
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('Harmonic function: u = xÂČ - yÂČ')

# Contour plot
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('Contour plot')
ax2.axis('equal')

# Laplacian
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'Laplacian (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()

# Verification of maximum principle
print("=== Verification of Maximum Principle ===")
print(f"Maximum in interior: {np.max(U[10:-10, 10:-10]):.4f}")
print(f"Maximum on boundary: {np.max([np.max(U[0,:]), np.max(U[-1,:]), np.max(U[:,0]), np.max(U[:,-1])]):.4f}")
print(f"Minimum in interior: {np.min(U[10:-10, 10:-10]):.4f}")
print(f"Minimum on boundary: {np.min([np.min(U[0,:]), np.min(U[-1,:]), np.min(U[:,0]), np.min(U[:,-1])]):.4f}")

Output explanation:

📚 Summary

💡 Exercise Problems

  1. Verification of harmonic functions: Verify by calculating the Laplacian that \(u(x,y) = xy\) is not a harmonic function.
  2. Solution in polar coordinates: Find the solution to the Laplace equation on a disk of radius \(a\) satisfying the boundary condition \(u(a,\theta) = \cos(2\theta)\), and visualize it.
  3. Application of Green's function: Using the Green's function for a rectangular domain, find the temperature distribution for a heat source \(f(x,y) = \delta(x-0.5, y-0.5)\).
  4. Comparison of convergence: Vary the relaxation parameter \(\omega\) for the SOR method from 1.0 to 2.0, and find the optimal \(\omega\).
  5. Complex geometry: Solve the Laplace equation in a rectangular domain with a circular hole, and visualize the temperature distribution around the hole.

Disclaimer