# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentialequation.pde.finitedifference.elliptic.dim2

## Class PoissonEquation2D

• java.lang.Object
• com.numericalmethod.suanshu.analysis.differentialequation.pde.finitedifference.elliptic.dim2.PoissonEquation2D
• All Implemented Interfaces:
PDE

public class PoissonEquation2D
extends Object
implements PDE
Poisson's equation is an elliptic PDE that takes the following general form. $\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = f(x, y)$ with Dirichlet boundary conditions: $u(0, y) = g(0, y) \\ u(a, y) = g(a, y) \\ u(x, 0) = g(x, 0) \\ u(x, b) = g(x, b)$ assuming that the domain of the independent variables is a rectangular region in the x-y plane.

Note that LaPlace's equation emerges as a special case when $$f(x, y) = 0$$.

Wikipedia: Poisson's equation
• ### Constructor Summary

Constructors
Constructor and Description
PoissonEquation2D(double a, double b, BivariateRealFunction f, BivariateRealFunction g)
Constructs a Poisson's equation problem.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double a()
Gets the width (x-axis) of the rectangular region.
double b()
Gets the height (y-axis) of the rectangular region.
double f(double x, double y)
The forcing term.
double g(double x, double y)
The boundary value function.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### PoissonEquation2D

public PoissonEquation2D(double a,
double b,
BivariateRealFunction f,
BivariateRealFunction g)
Constructs a Poisson's equation problem.
Parameters:
a - the region of interest (0, a)
b - the region of interest (0, b)
f - the forcing term in the equation f(x, y)
g - the Dirichlet boundary condition g(x, y)
• ### Method Detail

• #### a

public double a()
Gets the width (x-axis) of the rectangular region.
Returns:
the x size of the region
• #### b

public double b()
Gets the height (y-axis) of the rectangular region.
Returns:
the y size of the region
• #### f

public double f(double x,
double y)
The forcing term.
Parameters:
x - the first independent variable
y - the second independent variable
Returns:
f(x, y), the forcing function
• #### g

public double g(double x,
double y)
The boundary value function. These are Dirichlet (or first-type) boundary conditions.
Parameters:
x - the first independent variable
y - the second independent variable
Returns:
g(x, y), the boundary condition