Lesson 12 of 15
Green's Functions
Green's Functions
A Green's function is the impulse response of a differential operator — the solution when the source term is a Dirac delta. If is a linear differential operator, then:
Once we have G, the solution to is:
1D Poisson Equation
For on with :
This has a characteristic "tent" shape — it is continuous with a kink at .
The solution is then:
For example, if (constant forcing), the solution is — a parabolic profile that satisfies the boundary conditions and the equation.
Free-Space Green's Function (1D Laplacian)
In 1D free space (no boundary conditions), the Green's function for is:
Numerical Solution via Green's Function
We discretise into points and approximate the integral as a sum:
where and .
Implementation
greens_1d_poisson(x, x_prime, L)— returns for the 1D Poisson problemgreens_free_space_1d(x, x_prime)— returnspoisson_solution(x, f_values, L, N=100)— evaluates by summing
import math
def greens_1d_poisson(x, x_prime, L):
return (1.0 / L) * min(x, x_prime) * (L - max(x, x_prime))Python runtime loading...
Loading...
Click "Run" to execute your code.