1
votes

What is the problem with fitting, please?

A = -100
C = -0.3
D = 22
f(x) = A*sin(2*pi*x+C)+D
fit f(x) 'RV_phase' via A,C,D
g(x) = -100*sin(2*pi*x-0.3)+22

plot 'RV_phase' u 3:2 with points pt 7 ps 1 notitle, f(x) lc rgb "black" title "Fitted", g(x) lc rgb "red" title "Manual setting"

Is manual set curve sufficiently? enter image description here

1
You must also specify the data columns when fitting: fit f(x) 'RV_phase' using 3:2 via A,C,D - Christoph
@Alex: My impression is that you are fitting radial velocity curves. Have a look to the Fortran version of the GLS periodogram. It contains a gnuplot script to fit circular and Keplerian orbits. - Friedrich

1 Answers

2
votes

For the fitting you must specify the same data columns with using like you use when plotting:

fit f(x) 'RV_phase' using 3:2 via A,C,D 
plot 'RV_phase' using 3:2 with points, f(x) with lines