function fsolve_test02 ( )

%*****************************************************************************80
%
%% fsolve_test02 tests fsolve() on systems of nonlinear equations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 October 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../test_nonlin' );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'fsolve_test02\n' );
  fprintf ( 1, '  Use fsolve() to solve systems of nonlinear equations.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   #    ------------------------------------------' );
  fprintf ( 1, 'Title    N     ||F(start)||   ||F(root)||\n' );
  fprintf ( 1, '\n' );

  for problem = 1 : 5

    title = p00_title ( problem );
    fprintf ( 1, '  %2d  %50s', problem, title );

    n = p00_n ( problem );
    if ( n < 0 )
      n = 10;
    end
    fprintf ( 1, '  %2d', n );

    x0 = p00_start ( problem, n );
    fx0 = p00_fx ( problem, n, x0 );
    fprintf ( 1, '  %12g', norm ( fx0 ) );

    x1 = fsolve ( @(x)p00_fx(problem,n,x), x0 );
    fx1 = p00_fx ( problem, n, x1 );
    fprintf ( 1, '  %12g\n', norm ( fx1 ) );

  end

  rmpath ( '../test_nonlin' );

  return
end

