-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathstatistical-energy-distributions.typ
63 lines (57 loc) · 1.49 KB
/
statistical-energy-distributions.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
#import "@preview/cetz:0.3.2": canvas, draw
#import "@preview/cetz-plot:0.1.1": plot
#set page(width: auto, height: auto, margin: 8pt)
// Distribution functions
#let bose-einstein(x) = 1 / (calc.exp(x) - 1)
#let boltzmann(x) = 1 / calc.exp(x)
#let fermi-dirac(x) = 1 / (calc.exp(x) + 1)
#canvas({
draw.set-style(
axes: (
y: (mark: (end: "stealth", fill: black), label: (anchor: "north-west", offset: -0.2)),
x: (mark: (end: "stealth", fill: black), label: (anchor: "south-east", offset: -0.2)),
),
)
plot.plot(
size: (8, 5),
x-label: $beta (epsilon - mu)$,
y-label: $angle.l n angle.r$,
x-min: -7,
x-max: 7,
y-min: 0,
y-max: 1.8,
x-tick-step: 2,
y-tick-step: 0.5,
axis-style: "school-book",
x-grid: true,
y-grid: true,
legend: "inner-north-east",
legend-style: (stroke: 0.5pt, scale: 80%),
{
// Bose-Einstein distribution
plot.add(
style: (stroke: blue + 1.5pt),
domain: (0.1, 7), // Avoid x=0 since BE diverges there
samples: 200,
label: "Bose-Einstein",
bose-einstein,
)
// Boltzmann distribution
plot.add(
style: (stroke: orange + 1.5pt),
domain: (-1, 7),
samples: 100,
label: "Boltzmann",
boltzmann,
)
// Fermi-Dirac distribution
plot.add(
style: (stroke: red + 1.5pt),
domain: (-7, 7),
samples: 100,
label: "Fermi-Dirac",
fermi-dirac,
)
},
)
})