Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Solutions · 0. Units, crystal densities and the element table

School of Engineering, Nazarbayev University

Worked solutions to the three exercises of Lecture 0. Each solution is computed here and checked with assert statements against an exact identity or an independent calculation. The first code cell sets up the notebook and runs Demonstration 1 of the lecture without showing its output, because some of the solutions use its variables.

Exercise 1

Problem. For all 14 elements in constants.ELEMENTS_DB, compute Ω=Vcell/ncell [A˚3/atom]\Omega = V_{\mathrm{cell}} / n_{\mathrm{cell}}\ [\mathrm{\AA^3/atom}] and verify Mw/ρ=NAΩ×10−24 [cm3/mol]M_w / \rho = N_A \Omega \times 10^{-24}\ [\mathrm{cm^3/mol}] to rounding error, identifying the minimum and maximum Ω\Omega elements.


Exercise 1: Avogadro Atomic-Volume Closure Across 14 Elements
=============================================================
Cu        | Omega = 11.8094 A^3/atom | Vm =  7.1118 cm^3/mol | rel_err = 0.00e+00
Al        | Omega = 16.6014 A^3/atom | Vm =  9.9976 cm^3/mol | rel_err = 0.00e+00
Ni        | Omega = 10.9408 A^3/atom | Vm =  6.5887 cm^3/mol | rel_err = 0.00e+00
Au        | Omega = 16.9569 A^3/atom | Vm = 10.2117 cm^3/mol | rel_err = 1.74e-16
Ag        | Omega = 17.0456 A^3/atom | Vm = 10.2651 cm^3/mol | rel_err = 0.00e+00
Fe        | Omega = 11.7768 A^3/atom | Vm =  7.0921 cm^3/mol | rel_err = 1.25e-16
W         | Omega = 15.8553 A^3/atom | Vm =  9.5483 cm^3/mol | rel_err = 0.00e+00
Mo        | Omega = 15.5833 A^3/atom | Vm =  9.3845 cm^3/mol | rel_err = 0.00e+00
Cr        | Omega = 12.3211 A^3/atom | Vm =  7.4199 cm^3/mol | rel_err = 1.20e-16
Si        | Omega = 20.0228 A^3/atom | Vm = 12.0580 cm^3/mol | rel_err = 0.00e+00
Ge        | Omega = 22.6400 A^3/atom | Vm = 13.6341 cm^3/mol | rel_err = 1.30e-16
C-diamond | Omega =  5.6721 A^3/atom | Vm =  3.4158 cm^3/mol | rel_err = 0.00e+00
Ti        | Omega = 17.6659 A^3/atom | Vm = 10.6387 cm^3/mol | rel_err = 1.67e-16
Mg        | Omega = 23.2409 A^3/atom | Vm = 13.9960 cm^3/mol | rel_err = 0.00e+00

Min Omega = C-diamond (5.6721 A^3/atom), Max Omega = Mg (23.2409 A^3/atom)

Explanation. Dividing MwM_w by ρ=ncellMw/(NAVcell×10−24)\rho = n_{\mathrm{cell}} M_w / (N_A V_{\mathrm{cell}} \times 10^{-24}) cancels MwM_w identically, showing that molar volume depends strictly on per-atom geometric volume Ω=Vcell/ncell\Omega = V_{\mathrm{cell}}/n_{\mathrm{cell}}. C-diamond (5.672 A˚35.672\ \mathrm{\AA^3}) and Mg (23.241 A˚323.241\ \mathrm{\AA^3}) bound the database.


Exercise 2

Problem. Quantify on FCC Cu the exact error factors from (a) converting A˚3\mathrm{\AA^3} with 10-30 instead of 10−24 cm3/A˚310^{-24}\ \mathrm{cm^3/\AA^3} and (b) passing ncell=1n_{\mathrm{cell}} = 1 with conventional volume a3a^3, and verify ValueError guards on invalid inputs to lattices.theoretical_density_g_cm3.


Exercise 2: Diagnostic Audit of Unit-Exponent and Basis-Count Bugs
==================================================================
True Cu density           = 8.9353 g/cm^3
10^-30 unit-bug density   = 8935285.7 (off by 1,000,000x)
n_cell=1 basis-bug result = 2.2338 g/cm^3 (off by 0.25x)

Explanation. Using 10−30 m3/A˚310^{-30}\ \mathrm{m^3/\AA^3} without converting g/m3→g/cm3\mathrm{g/m^3 \to g/cm^3} inflates ρ\rho by 106×10^6\times (it actually computes g/m3\mathrm{g/m^3}), while pairing the 1-atom primitive count with the 4-atom conventional cube a3a^3 underpredicts ρCu\rho_{\mathrm{Cu}} by an exact factor of 4 (2.234 g/cm32.234\ \mathrm{g/cm^3}).


Exercise 3

Problem. Implement allotropic_density_shift(symbol, target_structure) assuming constant nearest-neighbor bond length dnnd_{\mathrm{nn}}, and verify on Fe (bcc →\to fcc) that volume contracts by 1−APFBCC/APFFCC≈8.144%1 - \mathrm{APF}_{\mathrm{BCC}}/\mathrm{APF}_{\mathrm{FCC}} \approx 8.144\%.


Exercise 3: Implement It Yourself — Allotropic BCC -> FCC Volume Contraction in Iron
====================================================================================
Predicted gamma-Fe FCC a = 3.5107 A (d_nn conserved)
alpha-Fe rho = 7.8742 g/cm^3 -> gamma-Fe rho = 8.5724 g/cm^3
Atomic volume change = -8.1441% vs exact APF ratio = -8.1441%

Summary. Repacking hard spheres of fixed atomic radius from BCC (APF=3π/8≈0.6802\mathrm{APF} = \sqrt{3}\pi/8 \approx 0.6802) into close-packed FCC (APF=2π/6≈0.7405\mathrm{APF} = \sqrt{2}\pi/6 \approx 0.7405) shrinks atomic volume by 8.14%8.14\%, the fundamental crystallographic origin of transformation strains during steel heat treatment (in real iron the measured contraction at 912 ∘C912\ ^\circ\mathrm{C} is only about 1%1\%, because the atomic diameter is not the same in the two structures).