File: density.fnc

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (26 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
#   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)