## Created: 2021-06-05
function retval = newton_steepest_descent_MD_opt(f,x)
  k=length(x);
  nmax=10;
  tolerance=1.0e-10;
  total=0;
  for i=1:nmax        
    fx=dfn(f,x);
    dfx=d2fn(f,x);
    fx1=@(alpha)f1dim(f,alpha,x,fx);
    alpha=1.0;
    alpha=newton_opt(fx1,alpha)   
    dx1=dfx\fx';
    dx=alpha.*dx1';
    for j=1:k
      x(j)=x(j)-dx(j);
    end
    total=0;
    for j=1:k
      total=total+abs(fx(j));
    end
    if total<tolerance
      break;
    end
  end
  retval=x;
endfunction
