In this workshop, we will start with a pre-defined set of data and a pre-defined script in order to repeat the Thermistor Calibration done before with the spreadsheet.

In another tab or window of your browser, open up www.plotshare.com. In the Options section enter the appropriate text to prove to plotshare that you are human.

Copy / paste the script below into the Gnuplot-Script box on plotshare, then Add external data and copy / paste the data at the bottom of the page into the text box ExtData1.

Click Execute to fit the calibration curve and plot the end result. That’s all it takes to do curve fitting with Gnuplot. Modify the label and ranges in the script and use your own data to help in working with lab practicals.

Gnuplot-Script:


# =========== Proposed function ===============
g(x) = b0 + b1 * log(x) + b2 * (log(x)**2) + b3 * (log(x)**3 )
# ========================================
#
# ==== Fitting transformed data ==========
set autoscale
fit g(x) 'ExtData1' using 3:(1/($1+273.15)) via b0, b1, b2, b3
# ========================================
#
# ======== Plotting the results ==========
T(x) = 1/g(x) - 273.15
set xrange [80:150]
set yrange [-50:130]
set xlabel 'R, Ohms'
set ylabel 'T, degrees C'
set title 'RTD calibration curve'
set key inside bottom right box 3
set linetype 1 lw 2 lc rgb "black"
set linetype 2 lw 2 lc rgb "red"
set pointsize 2
plot 'ExtData1' using 3:1 title 'Calibration Data', T(x) title 'Calibration Curve'
# ========================================

 

ExtData1:


# T,C T,F R,Ohms
-50 -58 80.306
-40 -40 84.271
-30 -22 88.222
-20 -4 92.160
-10 14 96.086
0 32 100.000
10 50 103.903
20 68 107.794
25 77 109.735
30 86 111.673
40 104 115.541
50 122 119.397
60 140 123.242
70 158 127.075
80 176 130.897
90 194 134.707
100 212 138.506
110 230 142.293
120 248 146.068
130 266 149.832