function [ c, f, s ] = tumor_fun ( x, t, u, DuDx )

%*****************************************************************************80
%
%% tumor_fun() defines the coefficient functions for the tumor PDE.
%
%  Discussion:
%
%    pdepe() assumes we are treating one or more parabolic PDE's of the form
%
%      c(x,t,u,dudx) * du/dt = x^(-m) d/dx x^m f(x,t,u,dudx) + s(x,t,u,dudx)
%    
%    where for our problem, m = 0.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 May 2021
%
%  Author:
%
%    Original version by Chiara Villa.
%    Modifications by John Burkardt
%
%  Input:
%
%    real X, the spatial coordinate.
%
%    real T, the time coordinate.
%
%    real U(2), the solution at (X,T).
%
%    real DUDX(2), the spatial derivative of the solution at (X,T).
%
%  Output:
%
%    real C(2), the coefficients of dUdT
%
%    real F(2), the flux terms.
%
%    real S(2), the source terms.
%

%
%  Set physical parameters:
%
  [ alpha, beta, cstar, delta, epsilon, gamma, k, lambda, mu, t0, tstop, ...
    xmin, xmax ] = tumor_parameters ( );

  c = [ 1.0; 1.0 ];

  f = [ delta * DuDx(1); ...
       epsilon * DuDx(2) - k * u(2) * DuDx(1) ];

  g = max ( u(1) - cstar, 0.0 );

  s = [ - alpha * u(1) * u(2) / ( gamma + u(1) ) - lambda * u(2); ...
        mu * u(2) * ( 1.0 - u(2) ) * g - beta * u(2) ];

  return
end

