function F = biharmonic_fd2d_rhs ( X, Y )

%*****************************************************************************80
%
%% biharmonic_fd2d_rhs() evaluates the right hand side of the biharmonic equation.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 June 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X(*), Y(*): evaluation points.
%
%  Output:
%
%    real F(*): the value of the right hand side.
%
  [ k, xmin, xmax, ymin, ymax ] = biharmonic_fd2d_parameters ( );

  if ( k == 1 )
    F = 8.0 * ones ( size ( X ) );
  elseif ( k == 2 )
    F = zeros ( size ( X ) );
  elseif ( k == 3 )
    F = 56400.0 * ( 1.0 - 10.0 * X + 15.0 * X.^2 ) .* ( 1.0 - Y ).^2 * Y.^4 ...
      + 18800.0 * X.^2 * ( 6.0 - 20.0 * X + 15.0 * X.^2 ) ...
                * Y.^2 * ( 6.0 - 20.0 * Y + 15.0 * Y.^2 ) ...
      + 56400.0 * ( 1.0 - X ).^2 * X.^4 .* ( 1.0 - 10.0 * Y + 15.0 * Y.^2 );
  elseif ( k == 4 )
    F = 4.0 * pi^4 * sin ( pi * X ) .* sin ( pi * Y );
  end

  return
end

