function J = p20_j ( m, n, x )

%*****************************************************************************80
%
%% p20_j() evaluates the jacobian for problem 20.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%  Modified:
%
%    03 March 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of equations.
%
%    integer N, the number of variables.
%
%    real X(N), the evaluation point.
%
%  Output:
%
%    real J(M,N), the jacobian matrix.
%
  J = zeros ( m, n );

  a = [ ...
    0.0;  1.0;  2.0;  3.0;  4.0; ...
    5.0;  6.0;  8.0; 10.0; 12.0; ...
   15.0; 20.0; 25.0; 30.0; 40.0; ...
   50.0 ];

  for i = 1 : m
    J(i,1) =               exp ( x(2) * a(i) ) * sin ( x(3) * a(i) );
    J(i,2) = a(i) * x(1) * exp ( x(2) * a(i) ) * sin ( x(3) * a(i) );
    J(i,3) = a(i) * x(1) * exp ( x(2) * a(i) ) * cos ( x(3) * a(i) );
  end

  return
end
