function dxyzdt = sphere_deriv ( t, xyz )

%*****************************************************************************80
%
%% sphere_deriv evaluates the derivative of the sphere ODE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 February 2020
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Ernst Hairer,
%    Solving differential equations on manifolds,
%    Universite de Geneve,
%    June 2011.
%
%  Input:
%
%    real T, XYZ(3): the arguments of the derivative.
%
%  Output:
%
%    real DXYZDT(3): the value of the derivative.
%
  i1 = 1.6;
  i2 = 1.0;
  i3 = 2.0 / 3.0;

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

  dxdt = ( 1.0 / i3 - 1.0 / i2 ) * z * y;
  dydt = ( 1.0 / i1 - 1.0 / i3 ) * x * z;
  dzdt = ( 1.0 / i2 - 1.0 / i1 ) * y * x;

  dxyzdt = [ dxdt; dydt; dzdt ];

  return
end

