function [base,alpha]=basisnull2(v,d)
global flag_con A n W
%================================================================
lambdamin=d;
if flag_con==1
    alpha=[];base=[];
    flag_shd=1;
    nA = normest(A,1);
    nAn=nA/sqrt(n);
    base=[base,v];
    alpha=[alpha;nAn];
    while flag_shd
        opts.v0=randn(n-1,1);
        opts.issym=1;
        opts.isreal=0;
        [v,d]=eigs(@Asecfunone,n-1,1,'sr',opts);
        v=v/norm(v);
        if d>1e-6
            break;
        else
            alpha=[alpha;nAn];
            base=[base,v];
            
        end
    end
end

    function [v] = Asecfunone(u)
        if  flag_con==1
            v=W'*(A*(W*u))+lambdamin*(W'*(W*u))+(base*(alpha.*(base'*u)));
        end
    end
end
