Libracija lune
Domen Mlakar, Milan Grkovski, Gabriela Hladnik, Alexander Jerman
Skupaj z 'libracijaLune.pdf'

Teorija

M[E_, ϵ_] := E + ϵ Sin[E];

Plot[M[E, 0.6], {E, 0, 2  π}]

auxKotE[M_, ϵ_, n_] := 
      Module[{t}, 
        For[t = 0; c = M, t < n, c = M + ϵ Sin[c], t++]; 
        c]

kotE[M_, ϵ_] := 
      Module[{n = 0}, temp = 0; 
        While[N[auxKotE[M, ϵ, n], 5] ≠ N[temp, 5], 
          temp = auxKotE[M , ϵ, n]; n++]; temp]

Plot[kotE[M, 0.6], {M, 0, 2  π}]

kotϕ[M_, ϵ_] := 
      2 ArcTan[
          Sqrt[((1 + ϵ)/(1 - ϵ))] 
            Tan[kotE[M, ϵ]/2]]

Plot[kotϕ[M, 0.6], {M, 0, 2  π}]

radVec[
        M_, ϵ_] := {Cos[kotϕ[M, ϵ]], 
          Sin[kotϕ[
              M, ϵ]]} (1 - ϵ Cos[
                kotE[M, ϵ]])

radij = 
        Table[radVec[2  π t/101, 0.6], {t, 1, 100}];

Radij = ListPlot[radij, PlotStyle -> PointSize[0.01]]

lunaObraz[M_] = 0.1 {Cos[M], Sin[M]};

lunaObrazSmer[t_, ϵ_] := 
        Line[{radVec[t, ϵ], 
            lunaObraz[ t] + radVec[t, ϵ]}];

smer = 
        Table[lunaObrazSmer[2  π t/101, 0.6], {t, 1, 100}];

Show[Radij, Graphics[smer], Axes -> True]

alfa[t_, ϵ_, δ_] := 
        ArcSin[Cross[radVec[t, ϵ]] . lunaObraz[t + δ]/(0.1  Sqrt[radVec[t, ϵ] . radVec[t, ϵ]])];

ϵ = 0.5;
T = 1;
δ = 0;
alfaPlot = 
      Plot[180/π alfa[2  π t/T, ϵ, δ], {t, 0, 1}, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}]

povprečni radij

r[t_, ϵ_] = 
        a (1 - ϵ^2)/(1 + ϵ Cos[t]);

1/(2  π) (∫_0^(2  π))r[t, 
            0.0554] \[DifferentialD]t

MERITVE in PODATKI
podatki v fulldata[ime slike, R, x, y]
podatki v data[x,y]
velikost napake je Δ (slikovni piki)/podatek

pot=ToString["\\\Atlas\jermana$\_system\desktop\libracijaLune"];

<< Graphics`MultipleListPlot`

fulldata1=Import[StringJoin[{pot, \}],"Table"];

data1=Import[StringJoin[{pot, "\\data1.txt"}],"Table"];

d1 = 
      ListPlot[data1, PlotJoined ->  False, 
        PlotStyle -> {PointSize[0.02], Hue[0.6]}, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}]

fulldata2=Import[StringJoin[{pot, \}],"Table"];

data2=Import[StringJoin[{pot, "\\data2.txt"}],"Table"];

d2 = 
      ListPlot[data2, PlotJoined ->  False, 
        PlotStyle -> {PointSize[0.02], Hue[0. ]}, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}]

d = 
      MultipleListPlot[data1,  data2,  PlotJoined  ->  True, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}]

ϵ = 0.0554;
T = 27.3;

t0 = 17;
δ = 0.81;
alfaPlot1 = 
      Plot[180/π alfa[
            2  π (t - t0)/T, ϵ, δ], {t, 0, 41}, 
        AxesLabel -> {t [dan], α [°]}]

Show[d1, alfaPlot1, 
      AxesLabel -> {t [dan], α [°]}, 
      TextStyle -> {FontFamily -> "Courier", 
          FontSize -> 14}]

t0 = 14;
δ = -0.0250;
alfaPlot2 = 
      Plot[180/π alfa[
            2  π (t - t0)/T, ϵ, δ], {t, 0, 41}, 
        AxesLabel -> {t [dan], α [°]}]

Show[d2, alfaPlot2, 
      AxesLabel -> {t [dan], α [°]}, 
      TextStyle -> {FontFamily -> "Courier", 
          FontSize -> 14}]

ϕ[R_, x_, y_] = 
        ArcSin[(x/(R Cos[ArcSin[(y/R)]]))];

ΔϕR[R_, x_, y_, ΔR_]=N[Dt[ϕ[R, x, y],R,Constants ->{x, y}]ΔR];

Δϕx[R_, x_, y_, Δx_]=N[Dt[ϕ[R, x, y],x,Constants ->{R, y}]Δx];

Δϕy[R_, x_, y_, Δy_]=N[Dt[ϕ[R, x, y],y,Constants ->{R, x}]Δy];

Δϕ[R_, x_, 
          y_, Δ_] = ΔϕR[R, x, 
            y, Δ] + Δϕx[R, x, 
            y, Δ] + Δϕy[R, x, 
            y, Δ];

velikost napake:

Δ = 10;

For[i = 1, 
      i ≤ Length[data1], i++, 
data1 = 
        Insert[data1, 
          180/π Δϕ[Extract[fulldata1, {i, 2}], 
              Extract[fulldata1, {i, 3}], 
              Extract[fulldata1, {i, 4}], Δ], {i, 
            3}]]

For[i = 1, 
      i ≤ Length[data2], i++, 
data2 = 
        Insert[data2, 
          180/π Δϕ[Extract[fulldata2, {i, 2}], 
              Extract[fulldata2, {i, 3}], 
              Extract[fulldata2, {i, 4}], Δ], {i, 
            3}]]

dat1 = Table[0, {0}];

dat2 = Table[0, {0}];

For[i = 1, 
      i ≤ Length[data1], i++, 
dat1 = 
        Append[dat1, {{Extract[data1, {i, 1}], Extract[data1, {i, 2}]}, 
            ErrorBar[ Extract[data1, {i, 3}]]}] ]

For[i = 1, 
      i ≤ Length[data2], i++, 
dat2 = 
        Append[dat2, {{Extract[data2, {i, 1}], Extract[data2, {i, 2}]}, 
            ErrorBar[Extract[data2, {i, 3}]]}] ]

data1Plot = 
      MultipleListPlot[dat1,  PlotJoined  ->  False, 
        PlotStyle -> {Hue[0], Hue[ .6]}, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}, 
        PlotLabel -> prva točka]

data2Plot = 
      MultipleListPlot[dat2,  PlotJoined  ->  False, 
        PlotStyle -> {Hue[0], Hue[ .6]}, 
        AxesLabel -> {t [dan], α [°]}, 
        TextStyle -> {FontFamily -> "Courier", 
            FontSize -> 14}, 
        PlotLabel -> druga točka]

Show[data1Plot, alfaPlot1, 
      AxesLabel -> {t [dan], α [°]}, 
      TextStyle -> {FontFamily -> "Courier", 
          FontSize -> 14}]

Show[data2Plot, alfaPlot2, 
      AxesLabel -> {t [dan], α [°]}, 
      TextStyle -> {FontFamily -> "Courier", 
          FontSize -> 14}]