# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentialequation.pde.finitedifference.hyperbolic.dim1

## Class ExplicitCentralDifference1D

• java.lang.Object
• com.numericalmethod.suanshu.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 parameters m and n.

This is a second-order method with a truncation error of order $$O(\Delta t^2 + \Delta x^2)$$.

• ### Constructor Detail

• #### ExplicitCentralDifference1D

public ExplicitCentralDifference1D()
• ### 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 problem
m - the number of grid points along the time-axis
n - the number of grid points along the space-axis
Returns:
the solution grid