function h = double_well_conserved ( q, p )

%*****************************************************************************80
%
%% double_well_conserved() returns a conserved quantity for the double_well ODE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 June 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real Q(:), P(:): the current solution.
%
%  Output:
%
%    real H(:): the value of the conserved quantity.
%
  [ u, dudq ] = double_well_potential ( q, p );

  h = u + 0.5 * p.^2;

  return
end

