function h = sling_conserved ( y )

%*****************************************************************************80
%
%% sling_conserved() returns a conserved quantity for the sling ODE.
%
%  Discussion:
%
%    This is not a typical conservation quantity.
%    The value of H is only conserved when H=1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 May 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real Y(:,2): the current solution.
%
%  Output:
%
%    real H(:): the value of the conserved quantity.
%
  u = y(:,1);
  v = y(:,2);

  [ s, t0, y0, tstop ] = sling_parameters ( );

  h = u.^2 + v.^2;

  return
end

