[BACK]Return to density.fnc CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot / demo

File: [local] / OpenXM_contrib / gnuplot / demo / Attic / density.fnc (download)

Revision 1.1.1.1 (vendor branch), Sun Jan 9 17:01:00 2000 UTC (24 years, 4 months ago) by maekawa
Branch: GNUPLOT
CVS Tags: maekawa-ipv6, VERSION_3_7_3, VERSION_3_7_1, VERSION_3_7, RELEASE_20000124, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, RELEASE_1_1_3, RELEASE_1_1_2
Changes since 1.1: +0 -0 lines

Import gnuplot 3.7

#
#   This is a rough approach to fit a model function to the density
#   data of a liquid crystal. The function consists of a linear
#   branch for the high temperature region and of a curved branch with
#   linear asymptote for the low temperatuer branch
#

#   free parameters:
#   m1, m2  slopes of the linear function in the low and high T region
#   Tc	    transition temperature
#   dens_Tc density at the transition temperature
#   g	    factor to scale tanh function

ml	= -0.0001
mh	= -0.0001
dens_Tc = 1.020
Tc	= 45
g	= 1
b	= 0.1


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)