Class ExplicitCentralDifference2D
- java.lang.Object
-
- dev.nm.analysis.differentialequation.pde.finitedifference.hyperbolic.dim2.ExplicitCentralDifference2D
-
- All Implemented Interfaces:
PDESolver
public class ExplicitCentralDifference2D extends Object implements PDESolver
This explicit central difference method is a numerical technique for solving the two-dimensional wave equation by the following explicit three-point central difference equation. \[ \frac{u^{k+1}_{ij} - 2u^k_{ij} + u^{k-1}_{ij}}{\Delta t^2} = \beta \left( \frac{u^{k}_{i+1,j} - 2u^k_{ij} + u^{k}_{i-1,j}}{\Delta x^2} + \frac{u^{k}_{i,j+1} - 2u^k_{ij} + u^{k}_{i,j-1}}{\Delta y^2} \right) \] where \(u^k_{ij} = u(t_k,x_i,y_j)\) is the estimate at \((k, i, 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 + \Delta y^2}{4 \beta} \] where \(\Delta t = \frac{T}{m}\), \(\Delta x = \frac{a}{n+1}\) and \(\Delta y = \frac{b}{p+1}\), by specifying the grid resolution parametersm
,n
, andp
. This is a second-order method with a truncation error of order \(O(\Delta t^2 + \Delta x^2 + \Delta y^2)\).
-
-
Constructor Summary
Constructors Constructor Description ExplicitCentralDifference2D()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDESolutionTimeSpaceGrid2D
solve(WaveEquation2D pde, int m, int n, int p)
Solve a two-dimensional wave equation, with the resolution parameters of the solution grid.
-
-
-
Method Detail
-
solve
public PDESolutionTimeSpaceGrid2D solve(WaveEquation2D pde, int m, int n, int p)
Solve a two-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-axis (excluding the initial condition)n
- the number of grid points along the x-axis (excluding the two boundaries)p
- the number of grid points along the y-axis (excluding the two boundaries)- Returns:
- the solution grid
-
-