Following is the GNUPLOT script to plot the data and to perform the Stretched exponential decay curve fitting with time-series data.
The stretched exponential function
gnuplot << EOF
reset
set terminal pngcairo background "#ffffff" enhanced font "Times-New-Roman-Bold,10" fontscale 1.0 size 500, 500
set key on b c inside horizontal
set output 'Data.png'
set title "Stretched exponential curve"
set xlabel "Time" rotate parallel
set ylabel "AU" rotate parallel
set style line 1 lt 1 dt 1 pi 0 ps 1 # lt = color; pt = point type; dt = dash type; ps = size
set style line 2 lt 2 dt 1 pi 0 ps 1
g(x) = a * exp(-(x/t)**b)
fit g(x) "data.xvg" u (column(1)):(column(2)) via a,t,b
set xtic
set label 1 sprintf("g(x) =%3.7f * exp(-(x/%3.7f)**(%3.7f))",a,t,b) at graph 0.10,0.95 font "arialbd,8"
chi2=(FIT_STDFIT*FIT_STDFIT)
set label 2 sprintf("{/Symbol c}^2 = %.7f", chi2) at graph 0.65,0.63 font "arialbd,8" @chi2
set table "FexpDecayFit-stretched.dat"
p g(x), "data.xvg" u (column(1)):(column(2))
unset table
p g(x) ls 2 t "Stretched ex-fit", "data.xvg" u (column(1)):(column(2)) w l ls 1 lw 3 t "Data"
EOF
The stretched exponential function
- also called the Kohlrausch–Williams–Watts (KWW) function.
gnuplot << EOF
reset
set terminal pngcairo background "#ffffff" enhanced font "Times-New-Roman-Bold,10" fontscale 1.0 size 500, 500
set key on b c inside horizontal
set output 'Data.png'
set title "Stretched exponential curve"
set xlabel "Time" rotate parallel
set ylabel "AU" rotate parallel
set style line 1 lt 1 dt 1 pi 0 ps 1 # lt = color; pt = point type; dt = dash type; ps = size
set style line 2 lt 2 dt 1 pi 0 ps 1
g(x) = a * exp(-(x/t)**b)
fit g(x) "data.xvg" u (column(1)):(column(2)) via a,t,b
set xtic
set label 1 sprintf("g(x) =%3.7f * exp(-(x/%3.7f)**(%3.7f))",a,t,b) at graph 0.10,0.95 font "arialbd,8"
chi2=(FIT_STDFIT*FIT_STDFIT)
set label 2 sprintf("{/Symbol c}^2 = %.7f", chi2) at graph 0.65,0.63 font "arialbd,8" @chi2
set table "FexpDecayFit-stretched.dat"
p g(x), "data.xvg" u (column(1)):(column(2))
unset table
p g(x) ls 2 t "Stretched ex-fit", "data.xvg" u (column(1)):(column(2)) w l ls 1 lw 3 t "Data"
EOF
Comments
Post a Comment