Clear[liens,cparmodcom];

Octonacci[k_]:=Module[{octo,i},
octo=Table[0,{i,1,k}];
octo[[1]]=1;
octo[[2]]=2;
Do[ octo[[i]]=octo[[i-2]]+2*octo[[i-1]],{i,3,k}];
octo];

Mat=Table[0,{x,ll},{y,ll}];


Do[{dx=cparmodcom[[liens[[m,1]],1]]-cparmodcom[[liens[[m,2]],1]];dy=cparmodcom[[liens[[m,1]],2]]-cparmodcom[[liens[[m,2]],2]];If[(Abs[dx]>cut)&&(Abs[dy]>cut),{Mat[[liens[[m,1]],liens[[m,2]]]]=-Exp[I*(kx*rat*(dx-Sign[dx])+ky*rat*(dy-Sign[dy]))],Mat[[liens[[m,2]],liens[[m,1]]]]=-Exp[-I*rat*(kx*(dx-Sign[dx])+ky*(dy-Sign[dy]))]},If[(Abs[dx]>cut),{Mat[[liens[[m,1]],liens[[m,2]]]]=-Exp[I*rat*(kx*(dx-Sign[dx])+ky*(dy))],Mat[[liens[[m,2]],liens[[m,1]]]]=-Exp[-I*rat*(kx*(dx-Sign[dx])+ky*(dy))]},If[(Abs[dy]>cut),{Mat[[liens[[m,1]],liens[[m,2]]]]=-Exp[I*rat*(kx*(dx)+ky*(dy-Sign[dy]))],Mat[[liens[[m,2]],liens[[m,1]]]]=-Exp[-I*rat*(kx*(dx)+ky*(dy-Sign[dy]))]},{Mat[[liens[[m,1]],liens[[m,2]]]]=-Exp[I*rat*(kx*(dx)+ky*(dy))],Mat[[liens[[m,2]],liens[[m,1]]]]=-Exp[-I*rat*(kx*(dx)+ky*(dy))]}]]]},{m,1,l}];

ll

Eigenvalues[Mat/.kx->0/.ky->0,1]

spx5={};
Do[{Print[n],AppendTo[spx5,Flatten[{Pi*n/(100*70*Sqrt[2]),Eigenvalues[Mat/.kx->Pi*n/(100*70*Sqrt[2])/.ky->0][[1]]}]]},{n,-10,10,1}];
spy5={};
Do[{Print[n],AppendTo[spy5,Flatten[{Pi*n/(100*70*Sqrt[2]),Eigenvalues[Mat/.ky->Pi*n/(100*70*Sqrt[2])/.kx->0][[1]]}]]},{n,-10,10,1}];
spxy5={};
Do[{Print[n],AppendTo[spxy5,Flatten[{Pi*n/(100*70*Sqrt[2]),Eigenvalues[Mat/.kx->Pi*n/(100*70*Sqrt[2])/.ky->Pi*n/(100*70*Sqrt[2])][[1]]}]]},{n,-10,10,1}];

Fit[spx5,{1,xx,(xx^(2  ))},xx]

Fit[spy5,{1,xx,(xx^(2  ))},xx]

Fit[spxy5,{1,xx,(xx^(2  ))},xx]

alphax5=2*1.443380682881414` ;
alphay5=2*1.4433806781797727`;
alphaxy5=2.8867335678577346`-1.443380682881414`-1.4433806781797727`;
Sqrt[alphax5*alphay5-(alphaxy5^2)]

ListPlot[spx5]

liens[[6]]

Norm[cparmodcom[[2]]-cparmodcom[[3220]]]*rat

2.8867613609273928`*Pi

spx5v2={};
Do[{Print[n],AppendTo[spx5v2,Flatten[{Pi*n/(1000*70*Sqrt[2]),Eigenvalues[Mat/.kx->Pi*n/(1000*70*Sqrt[2])/.ky->0][[1]]}]]},{n,-2,2,1}];
spy5v2={};
Do[{Print[n],AppendTo[spy5v2,Flatten[{Pi*n/(1000*70*Sqrt[2]),Eigenvalues[Mat/.ky->Pi*n/(1000*70*Sqrt[2])/.kx->0][[1]]}]]},{n,-2,2,1}];
spxy5v2={};
Do[{Print[n],AppendTo[spxy5v2,Flatten[{Pi*n/(1000*70*Sqrt[2]),Eigenvalues[Mat/.kx->Pi*n/(1000*70*Sqrt[2])/.ky->Pi*n/(1000*70*Sqrt[2])][[1]]}]]},{n,-2,2,1}];

Length[Mat]

Fit[spx5v2,{1,xx,(xx^(2  ))},xx]
Fit[spy5v2,{1,xx,(xx^(2  ))},xx]
Fit[spxy5v2,{1,xx,(xx^(2  ))},xx]

alphax5v2=2*1.4434823139189228` ;
alphay5v2=2*1.4435072696922793`;
alphaxy5v2=2.8871399232397863`-1.4434823139189228`-1.4435072696922793`;
Sqrt[alphax5v2*alphay5v2-(alphaxy5v2^2)]