function w = wave_exact ( t )

%*****************************************************************************80
%
%% wave_exact returns the exact solution for the wave PDE.
%
%  Discussion:
%
%    This solution satisfies the wave PDE:
%
%    u' = v
%    v' = c * uxx
%
%    u(x,t0) =       sin ( x ) * cos ( c * t0 )
%    v(x,t0) = - c * sin ( x ) * sin ( c * t0 )
%
%    u(0,t) = u(2*pi,t) = 0.0
%    v(0,t) = v(2*pi,t) = 0.0
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 December 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real t(:): the current time.
%
%  Output:
%
%    real w(nx*2): the exact solution.
%
  [ xmin, xmax, nx, dx, c, t0 ] = wave_parameters ( );

  x = linspace ( xmin, xmax, nx );

  u =       sin ( x ) .* cos ( c * t );
  v = - c * sin ( x ) .* sin ( c * t );

  w = [ u, v ];

  return
end

