Package by.andd3dfx.math.pde.equation
Class Equation
java.lang.Object
by.andd3dfx.math.pde.equation.Equation
- Direct Known Subclasses:
HyperbolicEquation
,ParabolicEquation
Abstract base class representing a second-order partial differential equation.
The equation has the general form:
M(x,t,U)*∂²U/∂t² + L(x,t,U)*∂U/∂t = ∂U( K(x,t,U)*∂U/∂x )/∂x + V(x,t,U)*∂U/∂x + F(x,t,U)
where U = U(x,t) is the unknown function.
The equation is defined on a space-time domain [x1,x2]×[0,t2] with boundary conditions specified on the left and right boundaries. This class provides default implementations for the coefficient functions that can be overridden by specific equation types.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEquation
(double x1, double x2, double t2, BorderCondition leftBorderCondition, BorderCondition rightBorderCondition) Creates a new partial differential equation with specified domain and boundary conditions. -
Method Summary
Modifier and TypeMethodDescriptiondouble
gF
(double x, double t, double U) Returns the source term F(x,t,U) of the equation.double
gK
(double x, double t, double U) Returns the coefficient K(x,t,U) of the second-order space derivative term.double
gL
(double x, double t, double U) Returns the coefficient L(x,t,U) of the first-order time derivative term.double
gM
(double x, double t, double U) Returns the coefficient M(x,t,U) of the second-order time derivative term.double
gU0
(double x) Returns the initial condition U(x) at time t = 0.double
gV
(double x, double t, double U) Returns the coefficient V(x,t,U) of the first-order space derivative term.
-
Constructor Details
-
Equation
public Equation(double x1, double x2, double t2, BorderCondition leftBorderCondition, BorderCondition rightBorderCondition) Creates a new partial differential equation with specified domain and boundary conditions.- Parameters:
x1
- left boundary of the spatial domainx2
- right boundary of the spatial domaint2
- right boundary of the temporal domainleftBorderCondition
- boundary condition at x = x1rightBorderCondition
- boundary condition at x = x2- Throws:
IllegalArgumentException
- if x1 >= x2 or t2 <= 0
-
-
Method Details
-
gU0
public double gU0(double x) Returns the initial condition U(x) at time t = 0. This method should be overridden by specific equation types to provide the actual initial condition.- Parameters:
x
- spatial coordinate- Returns:
- initial value U(x,0)
-
gM
public double gM(double x, double t, double U) Returns the coefficient M(x,t,U) of the second-order time derivative term. This coefficient represents the mass or inertia term in the equation. The default implementation returns 0, which should be overridden for equations containing second-order time derivatives.- Parameters:
x
- spatial coordinatet
- time coordinateU
- value of the solution at (x,t)- Returns:
- coefficient M(x,t,U)
-
gL
public double gL(double x, double t, double U) Returns the coefficient L(x,t,U) of the first-order time derivative term. This coefficient represents damping or dissipation in the equation. The default implementation returns 0, which should be overridden for equations containing first-order time derivatives.- Parameters:
x
- spatial coordinatet
- time coordinateU
- value of the solution at (x,t)- Returns:
- coefficient L(x,t,U)
-
gK
public double gK(double x, double t, double U) Returns the coefficient K(x,t,U) of the second-order space derivative term. This coefficient represents diffusion or conductivity in the equation. The default implementation returns 1, which should be overridden for equations with variable diffusion coefficients.- Parameters:
x
- spatial coordinatet
- time coordinateU
- value of the solution at (x,t)- Returns:
- coefficient K(x,t,U)
-
gV
public double gV(double x, double t, double U) Returns the coefficient V(x,t,U) of the first-order space derivative term. This coefficient represents convection or advection in the equation. The default implementation returns 0, which should be overridden for equations containing convective terms.- Parameters:
x
- spatial coordinatet
- time coordinateU
- value of the solution at (x,t)- Returns:
- coefficient V(x,t,U)
-
gF
public double gF(double x, double t, double U) Returns the source term F(x,t,U) of the equation. This term represents external forces or sources in the equation. The default implementation returns 0, which should be overridden for equations containing source terms.- Parameters:
x
- spatial coordinatet
- time coordinateU
- value of the solution at (x,t)- Returns:
- source term F(x,t,U)
-