-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathgrand-canonical-occupation-fluctuations.typ
78 lines (70 loc) · 1.77 KB
/
grand-canonical-occupation-fluctuations.typ
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#import "@preview/cetz:0.3.2": canvas, draw
#import "@preview/cetz-plot:0.1.1": plot
#set page(width: auto, height: auto, margin: 8pt)
#let size = (8, 5)
#canvas({
draw.set-style(
axes: (
y: (label: (anchor: "north-west", offset: -0.2), mark: (end: "stealth", fill: black)),
x: (label: (anchor: "north", offset: 0.1), mark: (end: "stealth", fill: black)),
),
)
// First plot (Bose fluctuations)
plot.plot(
size: size,
x-min: 0,
x-max: 4.2,
y-min: 0,
x-label: $T$,
y-label: $Delta n_k^+$,
x-tick-step: 1,
y-tick-step: 10,
axis-style: "left",
name: "bose-plot",
{
// Define constants
let (ek, mu) = (1, 0)
// Add the Bose fluctuation curve
plot.add(
style: (stroke: blue + 1.5pt),
domain: (0.01, 4.2), // Avoid x=0 due to division
samples: 200, // More samples for smoother curve
x => {
let beta = 1 / x
let sinh_term = calc.sinh(beta / 2 * (ek - mu))
1 / (2 * sinh_term * sinh_term)
},
)
},
)
// Second plot (Fermi fluctuations)
draw.translate((size.at(0) + 2.5, 0))
plot.plot(
size: size,
x-min: 0,
x-max: 4.2,
y-min: 0,
y-max: 0.28,
x-label: $T$,
y-label: $Delta n_k^-$,
x-tick-step: 1,
y-tick-step: 0.05,
axis-style: "left",
name: "fermi-plot",
{
// Define constants
let (ek, mu) = (1, 0)
// Add the Fermi fluctuation curve
plot.add(
style: (stroke: blue + 1.5pt),
domain: (0.01, 4.2), // Avoid x=0 due to division
samples: 200, // More samples for smoother curve
x => {
let beta = 1 / x
let cosh_term = calc.cosh(beta * (ek - mu))
1 / (2 + 2 * cosh_term)
},
)
},
)
})