Question: Python Question Q5. (Looping) Powder x-ray diffraction is a technique used to characterize the structure of crystals. The idea is illustrated in the figure below.
Python Question

Q5. (Looping) Powder x-ray diffraction is a technique used to characterize the structure of crystals. The idea is illustrated in the figure below. The crystalline grains in the powder have all possible orientations. For the incident beam of a particular direction, diffraction can occur only for a discrete set of angles 20. So, in the plot of the intensity vs. 20 (see the figure), we see a set of peaks corresponding to the 20 values where diffraction occurs. For simple cubic crystals, the angle 20 for which diffraction occurs should satisfy the following condition: sin = Vh + k + 12. 2a where 1 is the wavelength of the x-ray, a is the lattice parameter, and h, k and I are integers representing the crystallographic indices. The wavelength of x-ray typically used in experiments is 1.54 angstrom. Assume that the lattice parameter is a 4.0 angstrom. Write a python code to calculate the 20 values corresponding to the first 10 peaks in the plot of intensity vs. 20. (You can check your answer with the experimental measurement for BaTiO3). 22 / Diffracted beam Incident beam 128. 120, O [2672012 Intensity 2e Hint: You may loop the values of h, k amd / from - N to N. calculate 20 according to the formula, and store the 20 values to a list. Since some (h, k, 1) values result in the same value of 20, we need to delete the repeated items in the list. A possible way to delete the repeated items in a list is converting the list to set (recall that no repeated item is allowed in a set) and then converting the set back to list. Finally, sort the list and print out the first 10 items of the list. (30 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
