-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHyperbolicEquation.java
More file actions
66 lines (61 loc) · 2.61 KB
/
HyperbolicEquation.java
File metadata and controls
66 lines (61 loc) · 2.61 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
55
56
57
58
59
60
61
62
63
64
65
66
package io.github.andreipunko.math.pde.equation;
import io.github.andreipunko.math.pde.border.BorderCondition;
import io.github.andreipunko.math.pde.solver.HyperbolicEquationSolver;
/**
* Represents a hyperbolic partial differential equation, which typically describes
* wave propagation and oscillation processes. The equation has the form:
* <p>
* 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)
* <p>
* where U = U(x,t) is the unknown function (displacement, pressure, etc.).
* <p>
* This is a special case of the general second-order PDE where the coefficient
* of the second-order time derivative (M) is one, representing the standard form
* of wave equations.
*
* @see HyperbolicEquationSolver
* @see Equation
*/
public class HyperbolicEquation extends Equation {
/**
* Creates a new hyperbolic 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 HyperbolicEquation(double x1, double x2, double t2,
BorderCondition leftBorderCondition,
BorderCondition rightBorderCondition) {
super(x1, x2, t2, leftBorderCondition, rightBorderCondition);
}
/**
* Returns the coefficient M(x,t,U) of the second-order time derivative term.
* For hyperbolic equations, this coefficient is always 1, representing the
* standard form of wave equations.
*
* @param x spatial coordinate
* @param t time coordinate
* @param U value of the solution at (x,t)
* @return coefficient M(x,t,U) = 1
*/
@Override
public double gM(double x, double t, double U) {
return 1;
}
/**
* Returns the initial condition for the time derivative ∂U/∂t at time t = 0.
* This method should be overridden by specific hyperbolic equation types to provide
* the actual initial velocity or rate of change.
*
* @param x spatial coordinate
* @return initial value of ∂U/∂t(x,0)
*/
public double gdU_dt0(double x) {
return 0;
}
}