public class HeatEquation1D extends Object implements PDE
Use one consistent system of space and time units: beta has units of space squared divided by time, a is the interval length, and T is the terminal time. The constructor requires positive beta, a and T, and c1/c2 in [0,1]. Initial data f is evaluated only at interior spatial points.
For Dirichlet boundaries choose c1 = c2 = 0 and supply endpoint values as functions of time. For pure Neumann boundaries choose c1 = c2 = 1. The left condition uses the negative spatial derivative, while the right uses the positive derivative; the signs must be accounted for when translating flux data. Intermediate c values represent the mixed conditions shown above.
Ensure the initial profile and boundary functions are compatible at time zero when a smooth classical solution is intended. Constructing the PDE stores the problem data; it does not solve or sample the functions.
| Constructor and Description |
|---|
HeatEquation1D(double beta,
double a,
double T,
UnivariateRealFunction f,
double c1,
UnivariateRealFunction g1,
double c2,
UnivariateRealFunction g2)
Constructs a heat equation problem.
|
| Modifier and Type | Method and Description |
|---|---|
double |
a()
Gets the size of the one-dimensional space, that is, the range of x,
(0 < x < a).
|
double |
beta()
Gets β in the equation (also called thermal diffusivity in case of the
heat equation).
|
double |
c1()
Gets the coefficient \(c_{1}\) 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\).
|
double |
c2()
Gets the coefficient \(c_{2}\) 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\).
|
double |
f(double x)
Gets the initial condition of u at the given position x.
|
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)
\]
|
double |
T()
Gets the time period of interest, that is, the range of t,
(0 < t < T).
|
public HeatEquation1D(double beta,
double a,
double T,
UnivariateRealFunction f,
double c1,
UnivariateRealFunction g1,
double c2,
UnivariateRealFunction g2)
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 = apublic double beta()
public double a()
public double T()
public double f(double x)
x - the positionpublic double c1()
public double c2()
public double g2(double t)
t - the timeCopyright © 2010-2026 NM Group. All Rights Reserved.