Class HeatEquation1D
- java.lang.Object
-
- dev.nm.analysis.differentialequation.pde.finitedifference.parabolic.dim1.heatequation.HeatEquation1D
-
- All Implemented Interfaces:
PDE
public class HeatEquation1D extends Object implements PDE
A one-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}, \] The initial condition has this form: \[ u(0,x) = f(x), 0 < x < a \] The mixed boundary conditions have this form: \[ (1-c_1)u(t,0) - c_1\frac{\partial u}{\partial x}(t,0) = g_1(t), \\ (1-c_2)u(t,a) + c_2\frac{\partial u}{\partial x}(t,a) = g_2(t) \] where \(0 \leq c_k \leq 1, k = 1, 2\).
-
-
Constructor Summary
Constructors Constructor Description HeatEquation1D(double beta, double a, double T, UnivariateRealFunction f, double c1, UnivariateRealFunction g1, double c2, UnivariateRealFunction g2)Constructs a heat equation problem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublea()Gets the size of the one-dimensional space, that is, the range of x, (0 < x < a).doublebeta()Gets β in the equation (also called thermal diffusivity in case of the heat equation).doublec1()Gets the coefficient c1 in the mixed boundary condition at the boundary x = 0.doublec2()Gets the coefficient c2 in the mixed boundary condition at the boundary x = a.doublef(double x)Gets the initial condition of u at the given position x.doubleg2(double t)Gets the value of the linear combination of \(u\) and \(\frac{\partial u}{\partial x}\) at the boundary \(x = a\) at the given time \(t\).doubleT()Gets the time period of interest, that is, the range of t, (0 < t < T).
-
-
-
Constructor Detail
-
HeatEquation1D
public HeatEquation1D(double beta, double a, double T, UnivariateRealFunction f, double c1, UnivariateRealFunction g1, double c2, UnivariateRealFunction g2)Constructs a heat equation problem.- Parameters:
beta- the beta in the equationa- the region of interest (0, a)T- the time period of interest (0, T)f- the initial condition of u, i.e., u(0,x)c1- the coefficient in the mixed boundary condition at x = 0g1- the mixed boundary condition at x = 0c2- the coefficient in the mixed boundary condition at x = ag2- the mixed boundary condition at x = a
-
-
Method Detail
-
beta
public double beta()
Gets β in the equation (also called thermal diffusivity in case of the heat equation).- Returns:
- β
-
a
public double a()
Gets the size of the one-dimensional space, that is, the range of x, (0 < x < a).- Returns:
- the size of the space
-
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
-
f
public double f(double x)
Gets the initial condition of u at the given position x.- Parameters:
x- the position- Returns:
- u(0, x)
-
c1
public double c1()
Gets the coefficient c1 in the mixed boundary condition at the boundary x = 0. \[ (1-c_1)u(t,0) - c_1\frac{\partial u}{\partial x}(t,0) = g_1(t) \] where \(0 \leq c_1 \leq 1\). If \(c_1 = 0\), this is the Dirichlet boundary condition. If \(c_1 = 1\), this is the Neumann boundary condition.- Returns:
- the coefficient c1
-
c2
public double c2()
Gets the coefficient c2 in the mixed boundary condition at the boundary x = a. \[ (1-c_2)u(t,a) + c_2\frac{\partial u}{\partial x}(t,a) = g_2(t) \] where \(0 \leq c_2 \leq 1\). If \(c_2 = 0\), this is the Dirichlet boundary condition. If \(c_2 = 1\), this is the Neumann boundary condition.- Returns:
- the coefficient c2
-
g2
public double g2(double t)
Gets the value of the linear combination of \(u\) and \(\frac{\partial u}{\partial x}\) at the boundary \(x = a\) at the given time \(t\). \[ (1-c_2)u(t,a) + c_2\frac{\partial u}{\partial x}(t,a) = g_2(t) \]- Parameters:
t- the time- Returns:
- \(g_2(t)\)
-
-