function dxyzdt = anishchenko_deriv ( t, xyz )

%*****************************************************************************80
%
%% anishchenko_deriv() evaluates the right hand side of anishchenko_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 September 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Vadim Anishchenko, Vladimir Astakhov,
%    Experimental study of the mechanism of the appearance and the
%    structure of a strange attractor in an oscillator with inertial
%    nonlinearity,
%    Radiotekhnika i Elektronika,
%    Volume 28, 1983, pages 1109-1115.
%
%    Stephen Lucas, Evelyn Sander, Laura Taalman,
%    Modeling dynamical systems for 3D printing,
%    Notices of the American Mathematical Society,
%    Volume 67, Number 11, December 2020, pages 1692-1705.
%
%  Input:
%
%    real t: the value of the independent variable.
%
%    real xyz: the values of the dependent variables at time T.
%
%  Output:
%
%    real dxyzdt: the right hand side of the ODE.
%
  [ mu, eta, t0, xyz0, tstop ] = anishchenko_parameters ( );

  x = xyz(1);
  y = xyz(2);
  z = xyz(3);

  dxdt = mu * x + y - x * z;
  dydt = - x;
  dzdt = - eta * z + eta * heaviside ( x ) * x^2;

  dxyzdt = [ dxdt; dydt; dzdt ];

  return
end

