Class ExplicitCentralDifference1D
- java.lang.Object
-
- dev.nm.analysis.differentialequation.pde.finitedifference.hyperbolic.dim1.ExplicitCentralDifference1D
-
- All Implemented Interfaces:
PDESolver
public class ExplicitCentralDifference1D extends Object implements PDESolver
This explicit central difference method is a numerical technique for solving the one-dimensional wave equation by the following explicit three-point central difference equation. \[ \frac{u^{k+1}_j - 2u^k_j + u^{k-1}_j}{\Delta t^2} = \beta \frac{u^{k}_{j+1} - 2u^k_j + u^{k}_{j-1}}{\Delta x^2} \] where \(u^k_j = u(t_k, x_j)\) is the estimate at \((k, j)\) in the grid. This method is NOT unconditionally stable. Specifically, it is up to the user to ensure that: \[ \Delta t^2 \leq \frac{\Delta x^2}{\beta} \] where \(\Delta t = \frac{T}{m}\) and \(\Delta x = \frac{a}{n+1}\), by specifying the grid resolution parametersm
andn
. This is a second-order method with a truncation error of order \(O(\Delta t^2 + \Delta x^2)\).
-
-
Constructor Summary
Constructors Constructor Description ExplicitCentralDifference1D()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDESolutionTimeSpaceGrid1D
solve(WaveEquation1D pde, int m, int n)
Solve an one-dimensional wave equation, with the resolution parameters of the solution grid.
-
-
-
Method Detail
-
solve
public PDESolutionTimeSpaceGrid1D solve(WaveEquation1D pde, int m, int n)
Solve an one-dimensional wave equation, with the resolution parameters of the solution grid.- Parameters:
pde
- the wave equation problemm
- the number of grid points along the time-axisn
- the number of grid points along the space-axis- Returns:
- the solution grid
-
-