# set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 # set output 'fit.18.png' set key bmargin center horizontal Right noreverse enhanced autotitles nobox set title "the scattered points, and the initial parameter" set xlabel "Temperature T [deg Cels.]" set ylabel "Density [g/cm3]" l(x) = y0 + m*x high(x) = mh*(x-Tc) + dens_Tc lowlin(x) = ml*(x-Tc) + dens_Tc curve(x) = b*tanh(g*(Tc-x)) density(x) = x < Tc ? curve(x)+lowlin(x) : high(x) h(x,y) = sqrt(r*r - (abs(x-x0))**2.2 - (abs(y-y0))**1.8) + z0 y0 = 0.2 m = -0.000943519626921127 GPFUN_l = "l(x) = y0 + m*x" FIT_CONVERGED = 1 FIT_NDF = 31 FIT_STDFIT = 5.38882119844972e-05 FIT_WSSR = 9.00221211174692e-08 ml = -0.00100003942457045 mh = -0.000831266464088135 dens_Tc = 1.02497044549157 Tc = 46.0899236389968 g = 3.85585054766573 b = 0.00153901241268336 GPFUN_high = "high(x) = mh*(x-Tc) + dens_Tc" GPFUN_lowlin = "lowlin(x) = ml*(x-Tc) + dens_Tc" GPFUN_curve = "curve(x) = b*tanh(g*(Tc-x))" GPFUN_density = "density(x) = x < Tc ? curve(x)+lowlin(x) : high(x)" FIT_LIMIT = 1e-05 r = 0.5 x0 = 0.1 z0 = 0.3 GPFUN_h = "h(x,y) = sqrt(r*r - (abs(x-x0))**2.2 - (abs(y-y0))**1.8) + z0" FIT_MAXITER = 50 splot 'hemisphr.dat' using 1:2:3, h(x,y) ## fit density(x) 'lcdemo.dat' via 'start.par'