FDATA = Import["C:\\Users\\kfrin\\Desktop\\MPI\\funcdata.dat"];

FDATA[[1]]

ListPlot[FDATA]

FDATA[[1]]

FDATA[[1,1]]

We want to compute the difference between -sin(x) and the data set at each x-value in the data set

DiffDATA = Table[{FDATA[[k,1]],Abs[FDATA[[k,2]]+Sin[FDATA[[k,1]]]]},{k,1,Length[FDATA]}];

ListPlot[DiffDATA, PlotRange->All]

Length[FDATA]

DiffDATA2 = Table[{FDATA[[k,1]],Abs[FDATA[[k,2]]+Sin[FDATA[[k,1]]]]},{k,1001,Length[FDATA]-1000}];

ListPlot[DiffDATA2, PlotRange->All]

Plot[Cos[x],{x,0,10}]

Max[DiffDATA2[[All,2]]]

Position[DiffDATA2[[All,2]],Max[DiffDATA2[[All,2]]]]

DiffDATA2[[6676]]