function test_nonlin_test03 ( )

%*****************************************************************************80
%
%% test_nonlin_test03 uses fsolve() to seek a solution.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 October 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_nonlin_test03\n' );
  fprintf ( 1, '  Seek a root using fsolve()\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   #    ------------------------------------------' );
  fprintf ( 1, 'Title    N     ||F(start)||   ||F(root)||\n' );
  fprintf ( 1, '\n' );

  problem_num = p00_problem_num ( );

  options = optimoptions ( 'fsolve', 'Display', 'off' );

  for problem = 1 : problem_num

    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, options );
    fx1 = p00_fx ( problem, n, x1 );
    fprintf ( 1, '  %12g\n', norm ( fx1 ) );

  end

  return
end
