Skip to main content
added 19 characters in body
Source Link
azerbajdzan
  • 34k
  • 2
  • 29
  • 79

I think your dat can be fitted by an even function so the model could be a type of cosine Fourier series. Choose nn for how many terms you need.

dat = {{0, 0.183453}, {10, 0.18317}, {20, 0.182312}, {30, 
    0.180844}, {40, 0.178713}, {50, 0.175843}, {60, 0.172141}, {70, 
    0.167506}, {80, 0.161841}, {90, 0.155074}, {100, 0.147198}, {110, 
    0.138308}, {120, 0.128652}, {130, 0.118654}, {140, 
    0.108915}, {150, 0.100168}, {160, 0.093188}, {170, 
    0.0886728}, {180, 0.0871093}, {190, 0.0886728}, {200, 
    0.093188}, {210, 0.100168}, {220, 0.108915}, {230, 
    0.118654}, {240, 0.128652}, {250, 0.138308}, {260, 
    0.147198}, {270, 0.155074}, {280, 0.161841}, {290, 
    0.167506}, {300, 0.172141}, {310, 0.175843}, {320, 
    0.178713}, {330, 0.180844}, {340, 0.182312}, {350, 0.18317}, {360,
     0.183453}};

nn = 3;

su = Sum[a[n] Cos[n Φ Degree], {n, 0, nn}];

fit = NonlinearModelFit[dat, su, Cases[su, x_a, All], Φ];
su /. fit["BestFitParameters"]

ListLinePlot[{Table[{Φ, su /. fit["BestFitParameters"]}, {Φ,
     0, 360, 10}], dat}, PlotStyle -> {Gray, RedDirective[Red, Dashed]}, 
 PlotLegends -> {"fit", "dat"}]

enter image description hereenter image description here

For nn=6 we have the following (amplitude of 6-th cosine is already very small):

enter image description hereenter image description here

I think your dat can be fitted by an even function so the model could be a type of cosine Fourier series. Choose nn for how many terms you need.

dat = {{0, 0.183453}, {10, 0.18317}, {20, 0.182312}, {30, 
    0.180844}, {40, 0.178713}, {50, 0.175843}, {60, 0.172141}, {70, 
    0.167506}, {80, 0.161841}, {90, 0.155074}, {100, 0.147198}, {110, 
    0.138308}, {120, 0.128652}, {130, 0.118654}, {140, 
    0.108915}, {150, 0.100168}, {160, 0.093188}, {170, 
    0.0886728}, {180, 0.0871093}, {190, 0.0886728}, {200, 
    0.093188}, {210, 0.100168}, {220, 0.108915}, {230, 
    0.118654}, {240, 0.128652}, {250, 0.138308}, {260, 
    0.147198}, {270, 0.155074}, {280, 0.161841}, {290, 
    0.167506}, {300, 0.172141}, {310, 0.175843}, {320, 
    0.178713}, {330, 0.180844}, {340, 0.182312}, {350, 0.18317}, {360,
     0.183453}};

nn = 3;

su = Sum[a[n] Cos[n Φ Degree], {n, 0, nn}];

fit = NonlinearModelFit[dat, su, Cases[su, x_a, All], Φ];
su /. fit["BestFitParameters"]

ListLinePlot[{Table[{Φ, su /. fit["BestFitParameters"]}, {Φ,
     0, 360, 10}], dat}, PlotStyle -> {Gray, Red}, 
 PlotLegends -> {"fit", "dat"}]

enter image description here

For nn=6 we have the following (amplitude of 6-th cosine is already very small):

enter image description here

I think your dat can be fitted by an even function so the model could be a type of cosine Fourier series. Choose nn for how many terms you need.

dat = {{0, 0.183453}, {10, 0.18317}, {20, 0.182312}, {30, 
    0.180844}, {40, 0.178713}, {50, 0.175843}, {60, 0.172141}, {70, 
    0.167506}, {80, 0.161841}, {90, 0.155074}, {100, 0.147198}, {110, 
    0.138308}, {120, 0.128652}, {130, 0.118654}, {140, 
    0.108915}, {150, 0.100168}, {160, 0.093188}, {170, 
    0.0886728}, {180, 0.0871093}, {190, 0.0886728}, {200, 
    0.093188}, {210, 0.100168}, {220, 0.108915}, {230, 
    0.118654}, {240, 0.128652}, {250, 0.138308}, {260, 
    0.147198}, {270, 0.155074}, {280, 0.161841}, {290, 
    0.167506}, {300, 0.172141}, {310, 0.175843}, {320, 
    0.178713}, {330, 0.180844}, {340, 0.182312}, {350, 0.18317}, {360,
     0.183453}};

nn = 3;

su = Sum[a[n] Cos[n Φ Degree], {n, 0, nn}];

fit = NonlinearModelFit[dat, su, Cases[su, x_a, All], Φ];
su /. fit["BestFitParameters"]

ListLinePlot[{Table[{Φ, su /. fit["BestFitParameters"]}, {Φ,
     0, 360, 10}], dat}, PlotStyle -> {Gray, Directive[Red, Dashed]}, 
 PlotLegends -> {"fit", "dat"}]

enter image description here

For nn=6 we have the following (amplitude of 6-th cosine is already very small):

enter image description here

Source Link
azerbajdzan
  • 34k
  • 2
  • 29
  • 79

I think your dat can be fitted by an even function so the model could be a type of cosine Fourier series. Choose nn for how many terms you need.

dat = {{0, 0.183453}, {10, 0.18317}, {20, 0.182312}, {30, 
    0.180844}, {40, 0.178713}, {50, 0.175843}, {60, 0.172141}, {70, 
    0.167506}, {80, 0.161841}, {90, 0.155074}, {100, 0.147198}, {110, 
    0.138308}, {120, 0.128652}, {130, 0.118654}, {140, 
    0.108915}, {150, 0.100168}, {160, 0.093188}, {170, 
    0.0886728}, {180, 0.0871093}, {190, 0.0886728}, {200, 
    0.093188}, {210, 0.100168}, {220, 0.108915}, {230, 
    0.118654}, {240, 0.128652}, {250, 0.138308}, {260, 
    0.147198}, {270, 0.155074}, {280, 0.161841}, {290, 
    0.167506}, {300, 0.172141}, {310, 0.175843}, {320, 
    0.178713}, {330, 0.180844}, {340, 0.182312}, {350, 0.18317}, {360,
     0.183453}};

nn = 3;

su = Sum[a[n] Cos[n Φ Degree], {n, 0, nn}];

fit = NonlinearModelFit[dat, su, Cases[su, x_a, All], Φ];
su /. fit["BestFitParameters"]

ListLinePlot[{Table[{Φ, su /. fit["BestFitParameters"]}, {Φ,
     0, 360, 10}], dat}, PlotStyle -> {Gray, Red}, 
 PlotLegends -> {"fit", "dat"}]

enter image description here

For nn=6 we have the following (amplitude of 6-th cosine is already very small):

enter image description here