function ripple_euler ( n )

%*****************************************************************************80
%
%% ripple_euler() solves the ripple ODE using euler.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John D Cook,
%    Ripples and Hyperbolas,
%    https://www.johndcook.com/blog/2020/11/06/ripples-and-hyperbolas/
%    Posted 06 November 2020.
%
%    Wendell Mills, Boris Weisfeiler, Allan Krall,
%    Discovering Theorems with a Computer: The Case of y‘ = sin(xy). 
%    The American Mathematical Monthly, 
%    Volume 86, Number 9, November 1979, pages 733-739.
%
%  Input:
%
%    integer N: the number of steps to take.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ripple_euler()\n' );
  fprintf ( 1, '  Use euler() to solve the ripple ODE.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of equal step = %d\n', n );

  [ t0, y0, tstop ] = ripple_parameters ( );

  f = @ ripple_deriv;
  tspan = [ t0, tstop ];
%
%  Plot the solution curve.
%  Alter the default value of Y0.
%
  hold ( 'on' );

  for y0 = 1 : 7
    
    [ t0, y0, tstop ] = ripple_parameters ( t0, y0, tstop );
    [ t, y ] = euler ( f, tspan, y0, n );
    plot ( t, y(:,1), 'r-', 'Linewidth', 3 );

  end

  plot ( tspan, [ 0.0, 0.0 ], 'k--', 'linewidth', 2 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<--- T --->' );
  ylabel ( '<--- X(T) --->'  );
  title ( 'euler: ripple ODE' );
  filename = 'ripple_euler.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
