2.4 Solving Poisson’s equation in 1d

This example shows how to solve a 1d Poisson equation with boundary conditions.

poisson eq 1d
from pde import CartesianGrid, ScalarField, solve_poisson_equation

grid = CartesianGrid([[0, 1]], 32, periodic=False)
field = ScalarField(grid, 1)
result = solve_poisson_equation(field, bc=[{"value": 0}, {"derivative": 1}])


Total running time of the script: (0 minutes 0.059 seconds)