function F=root7d(x,p,w,alpha,wii)
  [s1,s2] = size(w);
  [p1,p2] = size(p);


  su = 0;
     for j = 1:s1
         ss = 0;
         for k = 1:s1
             if j ~= k
                 ss = ss + w(j,k+1)*sigm(x(1,k)) + alpha * abs(w(j,k+1)) * wii(k+1,j);
                 
                 %ss = ss + w(j,k+1)*sigm(x(1,k));
                 %su = su + abs(w(j,k+1));
             end
         end
         ss = ss + w(j,1);
         sss = x(1,j) - ss - p(1,j+1);
         F(j) = sss;
     end
