-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParabolicEquation.java
More file actions
54 lines (50 loc) · 2.21 KB
/
ParabolicEquation.java
File metadata and controls
54 lines (50 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package io.github.andreipunko.math.pde.equation;
import io.github.andreipunko.math.pde.border.BorderCondition;
import io.github.andreipunko.math.pde.solver.ParabolicEquationSolver;
/**
* Represents a parabolic partial differential equation, which typically describes
* heat conduction or mass diffusion processes. The equation has the form:
* <p>
* L(x,t,U)*∂U/∂t = ∂U( K(x,t,U)*∂U/∂x )/∂x + V(x,t,U)*∂U/∂x + F(x,t,U)
* <p>
* where U = U(x,t) is the unknown function (temperature or concentration).
* <p>
* This is a special case of the general second-order PDE where the coefficient
* of the second-order time derivative (M) is zero, and the coefficient of the
* first-order time derivative (L) is one.
*
* @see ParabolicEquationSolver
* @see Equation
*/
public class ParabolicEquation extends Equation {
/**
* Creates a new parabolic partial differential equation with specified domain
* and boundary conditions.
*
* @param x1 left boundary of the spatial domain
* @param x2 right boundary of the spatial domain
* @param t2 right boundary of the temporal domain
* @param leftBorderCondition boundary condition at x = x1
* @param rightBorderCondition boundary condition at x = x2
* @throws IllegalArgumentException see {@link Equation#Equation(double, double, double, BorderCondition, BorderCondition)}
*/
public ParabolicEquation(double x1, double x2, double t2,
BorderCondition leftBorderCondition,
BorderCondition rightBorderCondition) {
super(x1, x2, t2, leftBorderCondition, rightBorderCondition);
}
/**
* Returns the coefficient L(x,t,U) of the first-order time derivative term.
* For parabolic equations, this coefficient is always 1, representing the
* standard form of heat/mass transfer equations.
*
* @param x spatial coordinate
* @param t time coordinate
* @param U value of the solution at (x,t)
* @return coefficient L(x,t,U) = 1
*/
@Override
public double gL(double x, double t, double U) {
return 1;
}
}