-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbose-einstein-distribution.typ
69 lines (62 loc) · 1.74 KB
/
bose-einstein-distribution.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
#import "@preview/cetz:0.3.4": canvas, draw
#import "@preview/cetz-plot:0.1.1": plot
#import draw: content, line, bezier
#set page(width: auto, height: auto, margin: 8pt)
// Bose-Einstein distribution function
#let n_B(x, T) = {
if x == 0 or T == 0 { return 0.5 }
let ratio = x / T
1 / (calc.exp(ratio) - 1) + 0.5
}
#canvas({
let mark = (end: "stealth", fill: black, scale: 0.7)
draw.set-style(
axes: (
y: (label: (anchor: "north-west", offset: -0.2), mark: mark),
x: (label: (anchor: "south-east", offset: -0.15), mark: mark),
),
)
plot.plot(
size: (8, 7),
x-label: $"Re"(p_0)$,
y-label: $n_"B" (p_0)$,
x-min: 0,
y-min: 0,
y-max: 5,
x-tick-step: none,
y-tick-step: none,
axis-style: "left",
{
// Plot distributions for different temperatures
for (T, color) in ((0.5, red), (1, orange), (2, blue)) {
plot.add(
style: (stroke: color + 1.5pt),
domain: (0.01, 2),
samples: 150,
x => n_B(x, T),
)
}
},
)
// Add curved arrows between intersection points
// We approximate the intersection points since CeTZ doesn't have direct intersection support
let arrow-style = (end: "stealth", stroke: 1pt, fill: black)
// First arrow (T=0.5 to T=1)
bezier(
(1.8, 1.7), // start point
(2.4, 2.4), // end point
(2, 2.3), // control point
mark: arrow-style,
name: "arrow1",
)
content("arrow1.mid", text(size: 8pt)[$2 dot T$], anchor: "south-east")
// Second arrow (T=1 to T=2)
bezier(
(2.4, 2.5), // start point
(3.5, 3.2), // end point
(2.9, 3.3), // control point
mark: arrow-style,
name: "arrow2",
)
content("arrow2.mid", text(size: 8pt)[$2 dot T$], anchor: "south-east")
})