The bottom side boundary equation is
The finite difference equations shown as Fortran code are Code Fragments I, II, III, and IV, respectively. These difference equations are all second order in space and second order in time. The difference approximations for the boundary conditions must match or nearly match those of the wave equation . If the degree of approximation for the wave equation is k, the boundary condition approximation must be k or k-1.