function [ t, y ] = stiff_euler ( n )

%*****************************************************************************80
%
%% stiff_euler applies the Euler method to the stiff ODE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    07 February 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N: the number of steps to take.
%
%  Output:
%
%    real t(n+1), y(n+1): the times and solution values.
%
  t = zeros ( n + 1, 1 );
  y = zeros ( n + 1, 1 );

  a = 0.0;
  b = 1.0;
  dt = ( b - a ) / n;

  t(1) = a;
  y(1) = 0.0;

  for i = 1 : n
    t(i+1) = t(i) + dt;
    y(i+1) = y(i) + dt * 50.0 * ( cos ( t(i) ) - y(i) );
  end

  return
end

