Hi eveyrone,
I'd like to fit a curve for my data and displaying the equation for that
curve
in the graph itself. Is this possible, and how do I modify this script
to do this?
Also is my fitting using all the points, it seems a bit of the final graphs,
but maybe
that's the best it can do.
f1(x) = a1*x*x + b1*x + c1 # define the function to be fit
#a1 = 200; b1 = 50; c1 = 3; # NO initial guess for a1 and
b1
fit f1(x) "../forcedata/force.txt" u 1:($3/$2) via a1, b1, c1
f2(x) = a2*x*x + b2*x + c2 # define the function to be fit
#a2 = 300; b2 = 0.005; c2 = 3; # NO initial guess for a and
b
fit f2(x) "../forcedata/acc.txt" u 1:($3/$2) via a2, b2, c2
set key 0.018,150 title "F(x) = A tanh (x/B)" # title to key!
set title "Curve fit" # note newline!
set pointsize 1.5 # larger point!
set xlabel 'Deflection, {/Symbol D}_x (m)' # Greek symbols!
set ylabel 'Force, {/Times-Italic F}_A, (kN)' # italics!
plot "../forcedata/force.txt" u 1:($3/$2) every :::0::0 ti 'line2' with
points 3, \
"../forcedata/acc.txt" u 1:($3/$2) every :::0::0 ti 'line1' with
points 4, \
a1*x*x + b1*x + c1 title 'Column-fit', \
a2*x*x + b2*x + c2 title 'Beam-fit'
Ted.
--
View this message in context: http://old.nabble.com/Displaying-equations-tp29720781p29720781.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|