<<  polyFit`

MAX & MIN

The error on the periods (errT) and on the distances (errS)

errS = 0.001;
errT = 0.01;

The period T for each data array :

T = {220, 240, 260, 280, 300, 320, 340};

The values to be fitted :

max1 = {24.6, 26.4, 27.6, 28.1, 28.0, 27.2, 
          25.9};
min1 = {9.1, 8.0, 7.4, 7.3, 7.8, 8.7, 
          10.0};
max2 = {21.9, 22.8, 23.4, 23.6, 23.4, 22.8, 
          21.9};
min2 = {11.8, 11.2, 11.0, 11.0, 11.4, 12.0, 
          12.8};
max3 = {20.0, 20.6, 20.9, 21.0, 20.7, 20.3, 
          19.8};
min3 = {14.2, 13.7, 13.4, 13.3, 13.4, 13.7, 
          14.1};
max4 = {19.0, 19.2, 19.4, 19.4, 19.2, 18.8, 18.5};
min4 = {15.1, 14.8, 14.7, 14.7, 14.8, 15.0, 15.3};
max5 = {18.0, 18.2, 18.3, 18.4, 18.3, 18.2, 18.0};
min5 = {15.9, 15.7, 15.6, 15.6, 15.7, 15.7, 15.8};
max6 = {17.5, 17.7, 17.8, 17.8, 17.8, 17.7, 17.6};
min6 = {16.1, 16.0, 16.0, 16.0, 16.0, 16.1, 16.2};
max7 = {17.3, 17.4, 17.5, 17.5, 17.4, 17.4, 17.3};
min7 = {16.4, 16.3, 16.3, 16.3, 16.3, 16.4, 16.5};
max8 = {17.1, 17.1, 17.2, 17.2, 17.2, 17.1, 17.1};

"values" contains the previous data converted in metres.
We create this array to easily perform all the 15 regression.

values = {max1, min1, max2, min2, max3, min3, max4, min4, max5, min5, 
            max6, min6, max7, min7, max8}/100;

We are looking for parabolic relations :

\(Do[
Block[{}, 
Print["
", 
          StyleForm[StringJoin[ToString[i], "° FIT"], 
            FontSize -> 24, \ FontWeight -> "Bold", 
            FontColor -> RGBColor[1, 0, 0]]]; 
Off[
          Inverse::luc]; 

parabolicFit[{T, 
            errT}, {values[\([i]\)], errS}, 0, 
          AxesLabel -> {"T (s)", "S (cm)"}]; 

On[Inverse::luc];], 
{i, 
        Length[values]}]\)

We save all the results in a mathematical format :

fits = 
        Table[parabolicFit[{T, errT}, {values[[i]], errS}, 1], {i, 
            Length[values]}];

The best-fitting curves follow :

Table[fits[[i, 1]], {i, Length[fits]}]