function [ u, ut, utt, ux, uxx ] = traveling_wave_exact ( x, t )

%*****************************************************************************80
%
%% traveling_wave_exact() evaluates an exact solution of the 1D wave equation.
%
%  Discussion:
%
%    d^2u/dt^2 = c^2 d^2u/dx^2
%    u[x,t] = a * sin ( k * x + w * t + phi )
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 April 2025
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real x, t: the position and time.
%
%  Output:
%
%    real u, ut, utt, ux, uxx: the values of the exact solution, its time
%    derivative, and its first and second spatial derivatives at (x,t).
%
  [ a, k, w, phi, xmin, xmax, t0, tstop ] = traveling_wave_parameters ( );

  u = a * sin ( k * x + w * t + phi );

  ut = a * w * cos ( k * x + w * t + phi );

  utt = - a * w^2 * sin ( k * x + w * t + phi );

  ux = a * k * cos ( k * x + w * t + phi );

  uxx = - a * k^2 * sin ( k * x + w * t + phi );

  return
end
