function dydt = tough_deriv ( t, y )

%*****************************************************************************80
%
%% tough_deriv() returns the right hand side of the tough ODE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Ernst Hairer, Syvert Norsett, Gerhard Wanner,
%    Solving Ordinary Differential Equations, I: Nonstiff Problems,
%    Springer, 1987.
%
%  Input:
%
%    real T, the current time.
%
%    real Y(4), the current state values.
%
%  Output:
%
%    real DYDT(4), the time derivatives of the current state values.
%
  y1 = y(1);
  y2 = y(2);
  y3 = y(3);
  y4 = y(4);

  dy1dt = 2.0 * t * y2.^0.2 .* y4;
  dy2dt = 10.0 * t * exp ( 5.0 * ( y2 - 1.0 ) ) * y4;
  dy3dt = 2.0 * t * y4;
  dy4dt = - 2.0 * t * log ( y1 );

  dydt = [ dy1dt; dy2dt; dy3dt; dy4dt ];

  return
end

