function exp_euler ( n )

%*****************************************************************************80
%
%% exp_euler() uses the Euler method on exp_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N: the number of steps to take.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'exp_euler()\n' );
  fprintf ( 1, '  Solve exp_ode() using euler().\n' );

  [ alpha, t0, y0, tstop ] = exp_parameters ( );

  f = @ exp_deriv;
  tspan = [ t0, tstop ];

  [ t1, y1 ] = euler ( f, tspan, y0, n );

  t2 = linspace ( t0, tstop, 101 );
  y2 = exp_exact ( t2 );

  plot ( t1, y1, 'r-o', t2, y2, 'b-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y(t) -->' );
  title ( 'exp\_ode(): Euler method' );
  legend ( 'Computed', 'Exact' );
  filename = 'exp_euler.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  y2 = exp_exact ( t1 );
  e = rms ( y1 - y2 );
  fprintf ( 1, '  RMS error norm = %g\n', e );

  return
end

