This page contains links to some of the mathematica scripts from the open access educational article by Robert Dinnebier and Paolo Scardi: "X-ray powder diffraction in education: part I, Bragg peak profiles".
The paper contains “A collection of scholarly scripts dealing with the mathematics and physics of peak profile functions in X-ray powder diffraction has been written using the Wolfram language in Mathematica. Common distribution functions, the concept of convolution in real and Fourier space, instrumental aberrations, and microstructural effects are visualized in an interactive manner and explained in detail. This paper is the first part of a series dealing with the mathematical description of powder diffraction patterns for teaching and education purposes.”
You can download all the mathematica scripts here: