reset # # Fit kB to V^2/(4B) vs R data. Below R is called x, and # y = V^2/(4B), so from error propagation # (sigma_y/y) = 2 * (V^2/(4B)) * (sigma_V/V) # # In the input file fitData.txt, (edit 2<-->3 as appropriate): # column 1 is R, # column 2 is V^2/(4B) for long cables # column 3 is V^2/(4B) for short cables # relerr_V = 0.02 relerr_y = 2*relerr_V T = 300.0 y(x) = x*kB*T kB = 1.e-23 FIT_LIMIT = 1e-10 fit y(x) "fitData.txt" using 1:2:(relerr_y*$2) via kB # # plot it # set bar small set xrange [0:1e6] set yrange [0:6e-15] set xlabel "R (Ohms)" set ylabel "V_{rms}^2/(4B) (V^2 s)" set style line 1 lt 1 set style line 2 lt 1 pt 7 ps 0.5 plot "fitData.txt" \ using 1:2:(relerr_y*$2) \ title "long cable data" with yerrorbars ls 2, \ y(x) title "fit" ls 1