function stiff_euler ( n )

%*****************************************************************************80
%
%% stiff_euler applies the euler method to the stiff equation.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 September 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N: the number of steps to take.
%
  if ( nargin < 1 )
    n = 25;
  end

  dydt = @ stiff_deriv;
  t0 = 0.0;
  tstop = 1.0;
  tspan = [ t0, tstop ];
  y0 = 0.0;

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

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

  plot ( t1, y1, 'r-o', t2, y2, 'b-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y(t) -->' );
  s = sprintf ( 'Stiff ODE, euler method, n = %d', n );
  title ( s );
  legend ( 'Computed', 'Exact' );
  filename = sprintf ( 'stiff_euler_%d.png', n );
  print ( '-dpng', filename );

  return
end
