function dxyzdt = bioconvection_deriv ( t, xyz )

%*****************************************************************************80
%
%% bioconvection_deriv() evaluates the right hand side of bioconvection_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 January 2024
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    A Avramenko, Yu. Kovetska, I Shevchuk,
%    Lorenz approach for analysis of bioconvection instability of
%    gyrotactic motile microorganisms,
%    Chaos, Solitons and Fractals,
%    Volume 166, 2023.
%
%  Input:
%
%    real t: the value of the independent variable.
%
%    real xyz(3): the values of the dependent variables.
%
%  Output:
%
%    real dxyzdt(3): the right hand side of the ODE.
%
  [ a, b, sc, ~, ~, ~ ] = bioconvection_parameters ( );

  x = xyz(1);
  y = xyz(2);
  z = xyz(3);

  dxdt = sc * ( y - x );
  dydt = a * x + x * z - y;
  dzdt = - x * y - b * z;

  dxyzdt = [ dxdt; dydt; dzdt ];

  return
end

