blob: e105fed9046acc4011d0ef6db24f6516d07f79ae [file] [log] [blame]
Adrià Vilanova Martínez24d87012022-06-16 00:29:59 +02001#!/usr/bin/env -S gnuplot -c
2datafilename = '../data/tc.dat'
3
4set style line 101 lc rgb '#808080' lt 1 lw 1
5set border 3 front ls 101
6set tics nomirror out scale 0.75
7set linetype 99963 dashtype (6, 0, 0, 10)
8set style line 102 lc rgb '#d6d7d9' lt 99963 lw 1
9set grid back ls 102
10
11TC = 2.268
12
13# Temperatura crítica:
14
15t1(x) = a1*x + b1
16t2(x) = a2*x + b2
17
18fit t1(x) datafilename using (1/$1):2 via a1, b1
19fit t2(x) datafilename using (1/$1):4 via a2, b2
20
21do for [IDX = 0:1] {
22 if (IDX == 0) {
23 set terminal cairolatex size 8.5cm, 6cm
24 set output 'tc.tex'
25 set xlabel '$1/L$'
26 set ylabel '$T_c$'
27 tccv = '$(T_c)_{c_V}$'
28 tcsusc = '$(T_c)_\chi$'
29 set key spacing 2
30 } else {
31 set terminal svg dashed size 600, 400 font "Computer Modern,Tinos,Helvetica,15"
32 set output 'tc.svg'
33 set xlabel "1/L"
34 set ylabel "T_c"
35 tccv = '(T_c)_(c_V)'
36 tcsusc = '(T_c)_\chi'
37 set key spacing 1.25
38 }
39
40 set xrange [0:*]
41 set key top left
42 #set key outside top horizontal
43 plot datafilename using (1/$1):2:(0.005) with yerr title tccv, \
44 datafilename using (1/$1):4:(0.005) with yerr title tcsusc, \
45 t1(x) notitle, t2(x) notitle
46}
47
48set autoscale x
49
50# Exponent nu
51
52f1(x) = a1*x + b1
53f2(x) = a2*x + b2
54
55fit f1(x) datafilename using (log($1)):(log($2 - TC)) via a1, b1
56fit f2(x) datafilename using (log($1)):(log($4 - TC)) via a2, b2
57
58do for [IDX = 0:1] {
59 if (IDX == 0) {
60 set terminal cairolatex size 8.5cm, 6cm
61 set output 'nu.tex'
62 set xlabel '$\log(L)$'
63 set ylabel '$\log((T_c)_L - T_c)$'
64 nucv = '$c_V$'
65 nususc = '$\chi$'
66 set key spacing 2
67 } else {
68 set terminal svg dashed size 600, 400 font "Computer Modern,Tinos,Helvetica,15"
69 set output 'nu.svg'
70 set xlabel "log(L)"
71 set ylabel "log((T_c)_L - T_c)"
72 nucv = 'c_V'
73 nususc = '\chi'
74 set key spacing 1.25
75 }
76
77 set key top right
78 plot datafilename using (log($1)):(log($2 - TC)):(0.011/($2 - TC)) with yerr title nucv, \
79 datafilename using (log($1)):(log($4 - TC)):(0.011/($4 - TC)) with yerr title nususc, \
80 f1(x) notitle, f2(x) notitle
81}
82
83# Exponent alfa
84
85fa(x) = a*x + b
86
87fit fa(x) datafilename using (log($1)):(log($3)) via a, b
88
89do for [IDX = 0:1] {
90 if (IDX == 0) {
91 set terminal cairolatex size 8.5cm, 6cm
92 set output 'alpha.tex'
93 set xlabel '$\log(L)$'
94 set ylabel '$\log(c_V^\text{c})$'
95 set key spacing 2
96 } else {
97 set terminal svg dashed size 600, 400 font "Computer Modern,Tinos,Helvetica,15"
98 set output 'alpha.svg'
99 set xlabel "log(L)"
100 set ylabel "log(c_V c)"
101 set key spacing 1.25
102 }
103
104 set key top left
105 plot datafilename using (log($1)):(log($3)):($6/$3) with yerr title 'Dades', \
106 fa(x) notitle
107}
108
109# Exponent gamma
110
111fg(x) = a*x + b
112
113fit fg(x) datafilename using (log($1)):(log($5)) via a, b
114
115do for [IDX = 0:1] {
116 if (IDX == 0) {
117 set terminal cairolatex size 8.5cm, 6cm
118 set output 'gamma.tex'
119 set xlabel '$\log(L)$'
120 set ylabel '$\log(\chi^\text{c})$'
121 set key spacing 2
122 } else {
123 set terminal svg dashed size 600, 400 font "Computer Modern,Tinos,Helvetica,15"
124 set output 'gamma.svg'
125 set xlabel "log(L)"
126 set ylabel "log(chi c)"
127 set key spacing 1.25
128 }
129
130 set key top left
131 plot datafilename using (log($1)):(log($5)):($7/$5) with yerr title 'Dades', \
132 fa(x) notitle
133}
134
135# Exponent beta
136
137fb1(x) = a1*x + b1
138fb2(x) = a2*x + b2
139
140fit fb1(x) datafilename using (log($1)):(log($8/$1**2)) via a1, b1
141fit fb2(x) datafilename using (log($1)):(log($9/$1**2)) via a2, b2
142
143do for [IDX = 0:1] {
144 if (IDX == 0) {
145 set terminal cairolatex size 8.5cm, 6cm
146 set output 'beta.tex'
147 set xlabel '$\log(L)$'
148 set ylabel '$\log(\langle |m|^\text{c} \rangle)$'
149 nucv = '$c_V$'
150 nususc = '$\chi$'
151 set key spacing 2
152 } else {
153 set terminal svg dashed size 600, 400 font "Computer Modern,Tinos,Helvetica,15"
154 set output 'beta.svg'
155 set xlabel "log(L)"
156 set ylabel "log(<|m|^c>)"
157 nucv = 'c_V'
158 nususc = '\chi'
159 set key spacing 1.25
160 }
161
162 set key top right
163 plot datafilename using (log($1)):(log($8/$1**2)):($10/($8)) with yerr title nucv, \
164 datafilename using (log($1)):(log($9/$1**2)):($11/($9)) with yerr title nususc, \
165 f1(x) notitle, f2(x) notitle
166}