function bioconvection_ode45 ( )

%*****************************************************************************80
%
%% bioconvection_ode45() uses ode45() to solve bioconvection_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 January 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bioconvection_ode45\n' );
  fprintf ( 1, '  Use ode45() to solve bioconvection_ode().\n' );
%
%  Get the parameter values.
%
  [ ~, ~, ~, t0, xyz0, tstop ] = bioconvection_parameters ( );

  f = @ bioconvection_deriv;
  tspan = [ t0, tstop ];
%
%  Set some parameters to improve accuracy.
% 
  opt = odeset ( "RelTol", 0.1E-09, "AbsTol", realmin );
%
%  Compute the approximate solution at equally spaced times.
%
  [ t, xyz ] = ode45 ( f, tspan, xyz0, opt );

  n = size ( t, 1 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of variable size steps = %d\n', n );
%
%  Plot the data.
%
  clf ( );
  plot3 ( xyz(:,1), xyz(:,2), xyz(:,3) );
  grid ( 'on' );
  xlabel ( '<-- X -->' );
  ylabel ( '<-- Y -->' );
  zlabel ( '<-- Z -->' );
  title ( 'bioconvection\_ode(): ode45()' );
  filename = 'bioconvection_ode45.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s\n', filename );

  return
end

