# SuanShu, a Java numerical and statistical library

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

## Class WaveEquation2D

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

public class WaveEquation2D
extends Object
implements PDE
A two-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} + \frac{\partial^2 u}{\partial y^2})$ with fixed boundary condition, that is, $u(t, 0, 0) = u(t, a, 0) = u(t, 0, b) = u(t, a, b) = 0$ and two initial conditions, namely $$u$$ and its first time derivative $$u_t$$: $u(0, x, y) = f(x, y), 0 < x < a, 0 < y < b \\ u_t(0, x, y) = g(x, y), 0 < x < a, 0 < y < b$
Wikipedia: Wave equation
• ### Constructor Summary

Constructors
Constructor and Description
WaveEquation2D(double beta, double T, double a, double b, BivariateRealFunction f, BivariateRealFunction g)
Create a two-dimensional wave equation.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double a()
Get the size of the two-dimensional space along the x-axis, that is, the range of x, (0 < x < a).
double b()
Get the size of the two-dimensional space along the y-axis, that is, the range of y, (0 < y < b).
double beta()
Get the value of the wave coefficient β
double f(double x, double y)
Get the initial condition of u at the given point (x,y).
double g(double x, double y)
Get the initial condition of the time derivative of u at the given point (x,y).
double T()
Get 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

• #### WaveEquation2D

public WaveEquation2D(double beta,
double T,
double a,
double b,
BivariateRealFunction f,
BivariateRealFunction g)
Create a two-dimensional wave equation.
Parameters:
beta - the beta in the equation
T - the time period of interest (0, T)
a - the size of the region along the x-axis, x ∈ (0, a)
b - the size of the region along the y-axis y ∈ (0, b)
f - the initial condition of u, i.e., u(0, x, y)
g - the initial condition of the time-derivative of u, i.e., ut(0,x,y)
• ### Method Detail

• #### beta

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

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

public double a()
Get the size of the two-dimensional space along the x-axis, that is, the range of x, (0 < x < a).
Returns:
the size of the space along the x-axis
• #### b

public double b()
Get the size of the two-dimensional space along the y-axis, that is, the range of y, (0 < y < b).
Returns:
the size of the space along the y-axis
• #### f

public double f(double x,
double y)
Get the initial condition of u at the given point (x,y).
Parameters:
x - the x-coordinate
y - the y-coordinate
Returns:
u(0, x, y)
• #### g

public double g(double x,
double y)
Get the initial condition of the time derivative of u at the given point (x,y).
Parameters:
x - the x-coordinate
y - the y-coordinate
Returns:
ut(0, x, y)