function dxyzdt = chen_deriv ( t, xyz )

%*****************************************************************************80
%
%% chen_deriv() evaluates the right hand side of chen_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 September 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Guanrong Chen, Tetsushi Ueta,
%    Yet another chaotic attractor,
%    International Journal of Bifurcation and Chaos in Applied Sciences and Engineering,
%    Volume 9, Number 7, 1999, pages 1465-1466.
%
%    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.
%
  [ a, b, c, t0, xyz0, tstop ] = chen_parameters ( );

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

  dxdt = a * ( y - x );
  dydt = ( c - a ) * x - x * z + c * y;
  dzdt = x * y - b * z;

  dxyzdt = [ dxdt; dydt; dzdt ];

  return
end

