Module pde

This module contains class for solving Partial Differential Equations (PDE) with Dirichlet and Neumann Boundary Conditions.

class findiff.pde.BoundaryConditions(shape)

Represents Dirichlet or Neumann boundary conditions for a PDE.

Initializes the BoundaryCondition object.

The BoundaryCondition objects needs information about the grid on which to solve the PDE, specifically the shape of the (equidistant) grid.

Parameters

shape: tuple of ints

the number of grid points in each dimension

class findiff.pde.PDE(lhs, rhs, bcs)

Representation of a partial differential equation.

Initializes the PDE.

You need to specify the left hand side (lhs) in terms of derivatives as well as the right hand side in terms of an array.

Parameters

lhs: FinDiff object or combination of FinDiff objects

the left hand side of the PDE

rhs: numpy.ndarray

the right hand side of the PDE

bcs: BoundaryConditions

the boundary conditions for the PDE

solve()

Solves the PDE.

Returns

out: numpy.ndarray

Array with the solution of the PDE.