# SuanShu, a Java numerical and statistical library

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

## Class HeatEquation2D

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

public class HeatEquation2D
extends Object
implements PDE
A two-dimensional heat equation (or diffusion equation) is a parabolic PDE that takes the following form. $\frac{\partial u}{\partial t} = \beta (\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}),$ with an initial condition of the form: $u(0, x, y) = f(x, y), 0 < x < a, 0 < y < b$ and Dirichlet boundary conditions of the form: $u(t, x, y) = g(t, x, y), (x, y) \in \delta R,$ where $$\delta R$$ is the boundary of the surface R. This class of PDE problem is used to model heat or diffusion in two dimensions.
Wikipedia: Parabolic partial differential equation, Wikipedia: Heat equation
• ### Constructor Summary

Constructors
Constructor and Description
HeatEquation2D(double beta, double T, double a, double b, BivariateRealFunction f, TrivariateRealFunction g)
Constructs a two-dimensional heat equation problem.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double a()
Gets the size of the two-dimensional space along the x-axis, that is, the range of x, (0 < x < a).
double b()
Gets the size of the two-dimensional space along the y-axis, that is, the range of y, (0 < y < b).
double beta()
Gets the coefficient in the PDE (thermal diffusivity in case of the heat equation).
double f(double x, double y)
Gets the initial condition of u at the given point (x,y).
double g(double t, double x, double y)
Gets the boundary condition at the given boundary point (x,y) at the given time point t.
double T()
Gets the time period of interest, that is, the range of t, (0 < t < T).
• ### Methods inherited from class java.lang.Object

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

• #### HeatEquation2D

public HeatEquation2D(double beta,
double T,
double a,
double b,
BivariateRealFunction f,
TrivariateRealFunction g)
Constructs a two-dimensional heat equation problem.
Parameters:
beta - the beta in the equation
T - the time period of interest (0, T)
a - the size of the region along the x-axis, x ∈ (0, a)
b - the size of the region along the y-axis y ∈ (0, b)
f - the initial condition of u, i.e., u(0,x,y)
g - the boundary condition at x = 0, a and y = 0, b
• ### Method Detail

• #### beta

public double beta()
Gets the coefficient in the PDE (thermal diffusivity in case of the heat equation).
Returns:
β
• #### T

public double T()
Gets the time period of interest, that is, the range of t, (0 < t < T).
Returns:
the time period of interest
• #### a

public double a()
Gets the size of the two-dimensional space along the x-axis, that is, the range of x, (0 < x < a).
Returns:
the size of the space along the x-axis
• #### b

public double b()
Gets the size of the two-dimensional space along the y-axis, that is, the range of y, (0 < y < b).
Returns:
the size of the space along the y-axis
• #### f

public double f(double x,
double y)
Gets the initial condition of u at the given point (x,y).
Parameters:
x - the x-coordinate
y - the y-coordinate
Returns:
u(0, x, y)
• #### g

public double g(double t,
double x,
double y)
Gets the boundary condition at the given boundary point (x,y) at the given time point t.
Parameters:
t - the time point
x - the x-coordinate
y - the y-coordinate
Returns:
u(t, x, y)