# SuanShu, a Java numerical and statistical library

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

## Class WaveEquation1D

• java.lang.Object
• com.numericalmethod.suanshu.analysis.differentialequation.pde.finitedifference.hyperbolic.dim1.WaveEquation1D
• All Implemented Interfaces:
PDE

public class WaveEquation1D
extends Object
implements PDE
A one-dimensional wave equation is a hyperbolic PDE that takes the following form. $\frac{\partial^2 u}{\partial t^2} = \beta \frac{\partial^2 u}{\partial x^2}$ with both boundary ends fixed at 0, that is, $u(t, 0) = u(t, a) = 0$ and two initial conditions, namely u and its first time derivative ut: $u(0, x) = f(x), 0 < x < a \\ u_t(0, x) = g(x), 0 < x < a$
Wikipedia: Wave equation
• ### Constructor Summary

Constructors
Constructor and Description
WaveEquation1D(double beta, double T, double a, UnivariateRealFunction f, UnivariateRealFunction g)
Constructs an one-dimensional wave equation.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double a()
Gets the size of the one-dimensional space, that is, the range of x, (0 < x < a).
double beta()
Gets the value of the wave coefficient β
double f(double x)
Gets the value of the initial condition of u at x.
double g(double x)
Gets the value of the initial condition of the time derivative of u at x.
double T()
Gets the time period of interest, that is, the range of t, (0 < t < T).
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### WaveEquation1D

public WaveEquation1D(double beta,
double T,
double a,
UnivariateRealFunction f,
UnivariateRealFunction g)
Constructs an one-dimensional wave equation.
Parameters:
beta - the wave coefficient β in the equation
T - the time period of interest (0, T)
a - the region of interest (0, a)
f - the initial condition of u, i.e., u(0, x)
g - the initial condition of the time-derivative of u, i.e., ut(0,x)
• ### Method Detail

• #### beta

public double beta()
Gets the value of the wave coefficient β
Returns:
the wave coefficient β
• #### T

public double T()
Gets the time period of interest, that is, the range of t, (0 < t < T).
Returns:
the time period of interest
• #### a

public double a()
Gets the size of the one-dimensional space, that is, the range of x, (0 < x < a).
Returns:
the size of the space
• #### f

public double f(double x)
Gets the value of the initial condition of u at x.
Parameters:
x - the position
Returns:
f(x) = u(0, x)
• #### g

public double g(double x)
Gets the value of the initial condition of the time derivative of u at x.
Parameters:
x - the position
Returns:
g(x) = ut(0, x)