n=36; dt=2Pi/n;
pts=Table[{Cos[k*dt],Sin[k*dt]},{k,0,n-1}];
Graphics[Point[pts]]

p=3; idx[j_]=Mod[j,n,1];
Graphics[Map[Line[{pts[[  #[[1]]  ]],pts[[ #[[2]]  ]]}]&,Flatten[Table[ Drop[Table[{i,idx[j]},{j,i-p,i+p}],{p+1}],{i,n}],1]]]

a=N[pts];

u=Table[{(Subscript[u1, i]),(Subscript[u2, i])},{i,1,n}];

c=Flatten[u]

Length[c]

norm[v_]:=Sqrt[((v[[1]])^2)+((v[[2]])^2)];

norm[u[[2]]-u[[1]]]

D[D[norm[u[[2]]-u[[1]]],u[[1,1]]],u[[2,2]] ]

Δl[ij_] := norm[ u[[ij[[2]]]] - u[[ij[[1]]]] + a[[ij[[2]]]] - a[[ij[[1]]]]] - norm[ a[[ij[[2]]]] - a[[ij[[1]]]] ]

W=Total[Map[ Δl[#]&, Flatten[Table[ Drop[Table[{i,idx[j]},{j,i-p,i+p}],{p+1}],{i,n}],1]]];

Ku=0.5Table[ D[D[W,c[[i]] ],c[[j]]],{i,1,2n},{j,1,2n}];

cRules=Table[c[[i]]->0,{i,1,2n}];

K = Ku /. cRules;

ArrayPlot[K]

L=Eigenvalues[K]

R=Eigenvectors[K];

SetDirectory[NotebookDirectory[]];
Export["L16K.mat",K]; Export["L16L.mat",L]; Export["L16R.mat",R];

mode[k_]:=ArrayReshape[R[[k]],{n,2}];

add[l_]:= Append[l,l[[1]]];

Manipulate[Graphics[{Line[add[a]],{Red,Line[add[a+0.5 mode[k]]]}}],{k,1,n,1}]