Armijo Backtracking and Steepest Descent to find Local Minimum

610 Views Asked by At

I have to find the local minimum of the following function using Steepest Descent:

$f(x,y)=3x^2-3y^2+8xy$

Analytically, by equating the gradient to the zero vector, you get $(0,0)$ to be the local minimum.

I implemented the following function in MATLAB to get the answer:

function [x,xk]=SteepDesc(f,df,x0,tol,maxiter,tau,beta,ainit)

if nargin <8
    ainit=10;
end
    if nargin<7
        beta=0.1;
    end
    if nargin<6
        tau=0.5;
    end
    if nargin<5
        maxiter=100;
    end
    if nargin<4
        tol=1e-6;
    end

    x=x0;
    xk=x0;
    gradf=df(x);
    p=-gradf;
    k=0;

    while norm(p)>tol && k<maxiter
        alpha=ainit;
        while f(x+alpha*p)>f(x)+alpha*beta*p'*gradf
            alpha=alpha*tau;
        end
        x=x+alpha*p;
        gradf=df(x);
        p=-gradf;
        k=k+1;
        xk(:,k+1)=x;
    end

After implementing it, I got:

clear;
f= @(x) 3*(x(1))^2-3*(x(2))^2+8*x(1)*x(2);
df= @(x) [6*x(1)+8*x(2);-6*x(2)+8*x(1)];
x0=[0.0001;0.0001];

[z,zk]=SteepDesc(f,df,x0);
z

>>z =

  1.0e+194 *

   -1.1229
    2.8698

However, why does the Newton approach give me (0,0), while steepest descent gives me these values?