Blame demo/density.fnc

Packit 0986c0
#
Packit 0986c0
#   This is a rough approach to fit a model function to the density
Packit 0986c0
#   data of a liquid crystal. The function consists of a linear
Packit 0986c0
#   branch for the high temperature region and of a curved branch with
Packit 0986c0
#   linear asymptote for the low temperatuer branch
Packit 0986c0
#
Packit 0986c0
Packit 0986c0
#   free parameters:
Packit 0986c0
#   m1, m2  slopes of the linear function in the low and high T region
Packit 0986c0
#   Tc	    transition temperature
Packit 0986c0
#   dens_Tc density at the transition temperature
Packit 0986c0
#   g	    factor to scale tanh function
Packit 0986c0
Packit 0986c0
ml	= -0.0001
Packit 0986c0
mh	= -0.0001
Packit 0986c0
dens_Tc = 1.020
Packit 0986c0
Tc	= 45
Packit 0986c0
g	= 1
Packit 0986c0
b	= 0.1
Packit 0986c0
Packit 0986c0
Packit 0986c0
high(x) = mh*(x-Tc) + dens_Tc
Packit 0986c0
lowlin(x)  = ml*(x-Tc) + dens_Tc
Packit 0986c0
curve(x) = b*tanh(g*(Tc-x))
Packit 0986c0
Packit 0986c0
density(x) = x < Tc ? curve(x)+lowlin(x) : high(x)