function r = f_residual ( f, fz, fzz )

%*****************************************************************************80
%
%% f_residual() computes a residual related to the KPP Fisher equation.
%
%  Discussion:
%
%    The KPP Fisher equation is
%
%      ut = uxx + u * ( 1 - u )
%
%    For a particular value of c, and function f(z), the KPP Fisher 
%    equation admits a traveling wave solution of the form
%
%      u(x,t) = f(x-ct) = f(z)
%
%    where the function f(z) satisfies the ODE
%
%      f'' + cf' + f - f^2 = 0
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 May 2024
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Mark Ablowitz, Anthony Zeppetella,
%    Explicit solutions of Fisher's equation for a special wave speed,
%    Bulletin of Mathematical Biology,
%    Volume 41, pages 835-840, 1979.
%
%    Daniel Arrigo,
%    Analytical Techniques for Solving Nonlinear Partial Differential Equations,
%    Morgan and Clayfoot, 2019,
%    ISBN: 978 168 173 5351.
%
%  Input:
%
%    real F, FZ, FZZ: the associated function and derivatives.
%
%  Output:
%
%    real R: the residual of the f(z) solution at that time and position.
%
  [ a, c, k ] = fisher_parameters ( );

  r = fzz + c * fz + f - f.^2;

  return
end
