Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
lectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Solid state physics
lectures
Merge requests
!12
Update figure comparing Debye and Einstein models. Added experimental data for silver.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update figure comparing Debye and Einstein models. Added experimental data for silver.
plot_Einstein_Debye
into
master
Overview
21
Commits
8
Pipelines
8
Changes
1
Merged
Joana Fraxanet Morales
requested to merge
plot_Einstein_Debye
into
master
6 years ago
Overview
21
Commits
8
Pipelines
8
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 7
d44539aa
6 years ago
version 6
254f5d15
6 years ago
version 5
35560876
6 years ago
version 4
17f6bb8c
6 years ago
version 3
334cac6d
6 years ago
version 2
ee36a97a
6 years ago
version 1
9bdc0a16
6 years ago
master (base)
and
latest version
latest version
581066f6
8 commits,
6 years ago
version 7
d44539aa
7 commits,
6 years ago
version 6
254f5d15
6 commits,
6 years ago
version 5
35560876
5 commits,
6 years ago
version 4
17f6bb8c
4 commits,
6 years ago
version 3
334cac6d
3 commits,
6 years ago
version 2
ee36a97a
2 commits,
6 years ago
version 1
9bdc0a16
1 commit,
6 years ago
1 file
+
27
−
19
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/2_debye_model.md
+
27
−
19
Options
@@ -101,34 +101,42 @@ $$
where $x=
\f
rac{
\h
bar
\o
mega}{k_{
\r
m B}T}$ and $
\T
heta_{
\r
m D}
\e
quiv
\f
rac{
\h
bar
\o
mega_{
\r
m D}}{k_{
\r
m B}}$, the _Debye temperature_.
```
python
def
integrand
(
y
):
return
y
**
4
*
np
.
exp
(
y
)
/
(
np
.
exp
(
y
)
-
1
)
**
2
pyplot
.
rcParams
[
'
axes.titlepad
'
]
=
20
T
=
np
.
array
([
1.35
,
2.
,
3.
,
4.
,
5.
,
6.
,
7.
,
8.
,
10.
,
12.
,
14.
,
16.
,
20.
,
28.56
,
36.16
,
47.09
,
55.88
,
65.19
,
74.56
,
83.91
,
103.14
,
124.2
,
144.38
,
166.78
,
190.17
,
205.3
])
c
=
np
.
array
([
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.0719648
,
0.1075288
,
0.2100368
,
0.364008
,
0.573208
,
0.866088
,
1.648496
,
4.242576
,
7.07096
,
10.8784
,
13.47248
,
15.60632
,
17.27992
,
18.6188
,
20.33424
,
21.63128
,
22.46808
,
23.05384
,
23.47224
,
23.68144
])
c
*=
3
/
24.945
#24.954 is 3Nk_B
def
c_einstein
(
T
,
T_E
=
1
):
def
c_einstein
(
T
,
T_E
):
x
=
T_E
/
T
return
3
*
x
**
2
*
np
.
exp
(
x
)
/
(
np
.
exp
(
x
)
-
1
)
**
2
def
integrand
(
y
):
return
y
**
4
*
np
.
exp
(
y
)
/
(
np
.
exp
(
y
)
-
1
)
**
2
@np.vectorize
def
c_debye
(
T
,
T_D
=
1
):
def
c_debye
(
T
,
T_D
):
x
=
T
/
T_D
return
9
*
x
**
3
*
quad
(
integrand
,
0
,
1
/
x
)[
0
]
T
=
np
.
linspace
(
0.01
,
1.5
,
500
)
fig
,
ax
=
pyplot
.
subplots
()
temp
=
np
.
linspace
(
1
,
215
,
100
)
fit
=
curve_fit
(
c_einstein
,
T
,
c
,
500
)
T_E
=
fit
[
0
][
0
]
ax
.
plot
(
T
,
c_einstein
(
T
),
label
=
"
Einstein model
"
)
ax
.
plot
(
T
,
c_debye
(
T
),
label
=
"
Debye model
"
)
ax
.
set_ylim
(
bottom
=
0
,
top
=
3.4
)
ax
.
s
et_xlabel
(
'
$T$
'
)
ax
.
set_
ylabel
(
r
'
$\omega$
'
)
ax
.
set_xticks
([
1
]
)
ax
.
set_xticklabels
([
r
'
$\Theta_D
$
'
]
)
ax
.
set_y
ticks
([
3
]
)
ax
.
set_
yticklabels
([
'
$3Nk_B$
'
]
)
ax
.
legend
(
loc
=
'
lower right
'
)
pyplot
.
hlines
([
3
],
0
,
1.5
,
linestyles
=
'
dashed
'
)
draw_classic_axes
(
ax
,
xlabeloffset
=
0.3
)
fit
=
curve_fit
(
c_debye
,
T
,
c
,
500
)
T_D
=
fit
[
0
][
0
]
fig
,
ax
=
pyplot
.
subplots
(
)
ax
.
s
catter
(
T
,
c
)
ax
.
set_
title
(
'
Heat capacity of silver compared to the Debye and Einstein models
'
)
ax
.
plot
(
temp
,
c_debye
(
temp
,
T_D
),
label
=
f
'
Debye model, $T_D=
{
T_D
:
.
5
}
K$
'
)
ax
.
plot
(
temp
,
c_einstein
(
temp
,
T_E
),
label
=
f
'
Einstein model, $T_E=
{
T_E
:
.
5
}
K
$
'
)
ax
.
set_y
lim
(
bottom
=
0
,
top
=
3
)
ax
.
set_
xlim
(
0
,
215
)
ax
.
set_xlabel
(
'
$T(K)$
'
)
ax
.
set_ylabel
(
r
'
$C/k_B$
'
)
ax
.
legend
(
loc
=
'
lower right
'
);
```
## Exercises
Loading