teaching and education\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoJOURNAL OF
APPLIED
CRYSTALLOGRAPHY
ISSN: 1600-5767

Teaching diffraction using computer simulations over the Internet

CROSSMARK_Color_square_no_text.svg

aLos Alamos National Laboratory, LANSCE-12, MS H805, Los Alamos, NM 87545, USA, bInstitut für Mineralogie, Universität Würzburg, Am Hubland, D-97074 Würzburg, Germany, and cDepartment of Physics and Astronomy and Center for Fundamental Materials Research, Michigan State University, East Lansing, MI 48824-1116, USA
*Correspondence e-mail: tproffen@lanl.gov

(Received 12 June 2001; accepted 16 August 2001)

Computer simulations are a versatile tool to enhance the teaching of diffraction physics and related crystallographic topics to students of chemistry, materials science, physics and crystallography. Interactive computer simulations are presented, which have been added to a World Wide Web (WWW) based tutorial. A simple WWW interface is used to choose appropriate values for selected simulation parameters. The resulting structure and diffraction pattern are then plotted on the screen. Simulated structures range from a single atom to complex disordered or modulated structures. The simple interface requires no special computing knowledge and allows students to explore systematically the relationship between a real-space structure and the corresponding diffraction pattern. The large function set of the underlying simulation program (DISCUS) makes it easy to tailor the tutorial to a given syllabus by modifying or extending the current interactive examples.

1. Introduction

The determination of the atomic structure of crystalline materials using diffraction is a powerful and important tool in crystallography, chemistry, materials science and condensed matter physics. In addition to routine structure determination based on the analysis of Bragg scattering, it is apparent that local structural information contained in the diffuse scattering is the key to understanding properties of modern functional materials. It is obvious that a thorough understanding of diffraction and the underlying mathematical formalism is essential to any scientist involved in structural work.

Naturally, a thorough development of the formulae describing the diffraction process is an essential part of any crystallographic curriculum. However, students often face difficulties understanding the formal mathematical description of the Fourier transform and the abstract concept of reciprocal space. An effective way to increase the understanding of diffraction is the simultaneous observation of the structure in real space and the diffraction pattern in reciprocal space. One tool to achieve this is the use of optical masks (Harburn et al., 1975[Harburn, G., Taylor, C. A. & Welberry, T. R. (1975). Atlas of Optical Transforms. London: Bell and Hyman.]; Welberry, 2001[Welberry, T. R. (2001). Optical Transforms, https://rsc.anu.edu.au/~welberry/Optical_transform/.]; Glusker, 1988[Glusker, J. (1988). J. Chem. Ed. 65, 474-477.]). An alternative approach is the use of computer simulations. In a previous paper (Neder & Proffen, 1996[Neder, R. B. & Proffen, Th. (1996). J. Appl. Cryst. 29, 727-735.]), we presented an outline of how to integrate computer simulations into teaching diffraction, supplemented by an online tutorial available on the WWW. Since then many more teaching-related WWW sites have appeared (International Union of Crystallography, 2001[International Union of Crystallography (2001). Crystallographic Education Online, https://www.iucr.org/cww-top/edu.index.html.]).

Using practical exercises involving computer simulations in the classroom, we found that a significant amount of time was used to teach basic computer skills, such as editing a file, as well as allowing students to familiarize themselves with the simulation software DISCUS (Proffen & Neder, 1997[Proffen, Th. & Neder, R. B. (1997). J. Appl. Cryst. 30, 171-175.]). Since the equipment available at different universities varies greatly, we faced additional challenges to adapt the simulations to a given classroom setup. As a result, we have developed a WWW-based interface to a selection of the simulations presented in the online diffraction tutorial. The students task is simplified to the input of simulation parameters, such as the number of atoms in a row or the monoclinic β angle, into a form in their WWW browser. After hitting the `RUN' button, the simulation is carried out on the server computer and the resulting structure and diffraction pattern are displayed in the WWW browser. Obviously, virtually no computer knowledge is required to run this type of simulation. In addition, we found that students not only focused more on the science underlying the simulation, but seemed to enjoy this type of interface very much. From a technical point of view, using the Internet and running the simulation on a server allows one to utilize any computer that can run a WWW browser. The simulations are carried out using the diffuse scattering and defect structure simulation program DISCUS. This program is controlled by a Fortran-type command language, which makes the addition of customized simulations very straightforward and easy. In this paper, we present an extended version of the online tutorial, which now includes a variety of interactive simulations ranging from the scattering from a polygon of atoms to disordered structures containing chemical short-range order.

2. Scope of the tutorial

The tutorial consists of the following sections: (i) Basics covers the diffraction patterns of single and small groups of atoms; (ii) Reciprocal space introduces the concepts and geometry of reciprocal space; (iii) Convolution explains the important concept of convolution and the convolution theorem; (iv) Modification explores the difference between modifying the lattice versus modifying the structure; (v) Phase problem illustrates the phase problem by calculating phase amplitudes and phase angles for a simple group of atoms; (vi) Solving a structure guides the student through a simple structure solution and introduces Patterson and inverse Fourier calculations; (vii) Anomalous diffraction illustrates the effect of absorption on the diffracted intensities; (viii) Powder diffraction develops the basics of powder diffraction; and (ix) Diffuse scattering includes examples ranging from single defects to modulated structure and short-range order.

We have found that these online computer simulations can be adapted for a variety of audiences. Lecturers can adapt the simulations simply to create graphics of a given structure and its diffraction pattern for use in any lecture that includes an introduction to diffraction. More successful is the use of these simulations in practical exercises in a computer laboratory. Students can explore the relationship between the structure in real space and the corresponding diffraction pattern. More experienced students or researchers might use the diffraction guide for self studies. The interactive examples include a series of questions to explore and an answer section to verify the findings. In this section, we will present three examples of the interactive tutorial. In the following section, we will discuss how the simulations work in more detail and how they might be extended or changed.

2.1. Example 1: polygon of atoms

This first example is part of the section called Basics. The simulation input page is shown in Fig. 1[link]. The simulation requires only two items of input: the number of atoms that form the (regular) polygon and whether to calculate the X-ray or neutron diffraction pattern. We found it very educational to introduce the two different radiation types at this early stage. After the desired input is selected, pressing the `RUN' button will execute the simulation. The result is shown in Fig. 2[link]. All interactive simulations are accompanied by a series of questions to motivate exploration of the various parameters. In this case, one can learn about the symmetry of the polygon in relation to the symmetry of the resulting diffraction pattern.

[Figure 1]
Figure 1
Input screen for the simulation of a polygon of atoms and the corresponding neutron or X-ray diffraction pattern.
[Figure 2]
Figure 2
Simulation result for a polygon of atoms. Here the neutron diffraction pattern is shown.

2.2. Example 2: two-dimensional crystal

This example deals with the relationship between and geometry of direct and reciprocal space. It is taken from the section Reciprocal space of the online tutorial. The input screen for the simulation is shown in Fig. 3[link]. This time there are more parameters to change: the overall size of the two-dimensional crystal to be simulated and the metric of the crystal in the form of the length ratio and angle between the two crystal axes. The complete crystal can then be rotated and shifted with respect to the underlying coordinate system. Students can, for example, simulate square, rectangular and oblique structures, and observe the relation between direct- and reciprocal-lattice constants. Additionally, they can observe how rotation and translation of the complete crystal influences the diffraction pattern. The resulting graphical output is similar to that of the previous example, showing the created structure and the corresponding diffraction pattern.

[Figure 3]
Figure 3
Input screen for the simulation of a grid of atoms and the corresponding neutron or X-ray diffraction pattern.

2.3. Example 3: short-range order

The last example is part of the section Diffuse scattering and is a more complex simulation. Although diffuse scattering might currently not routinely be a part of diffraction lectures, it is apparent that the analysis of the defect structure or diffuse scattering of materials often holds the key to a structural understanding of their macroscopic properties. We feel that some coverage of diffuse scattering should be part of any crystallographic curriculum; a large section on deviations from the average structure in this tutorial reflects that view. A simple example is shown in Fig. 4[link]. The three structures shown have the same unit cell with a single atom on (0,0,0). The structures contain equal amounts of vacancies. One structure shows a random vacancy distribution, whereas the other two show chemical short-range order. However, since all contain the same concentration of vacancies, the Bragg intensities from all three structures are identical. The only difference is the diffuse scattering, also shown in Fig. 4[link]. We found that many students were surprised by the fact that routine structure analysis will not be able to distinguish the three structures shown.

[Figure 4]
Figure 4
Simulated structures with vacancy concentrations of 30% are shown on the left-hand side. From top to bottom: random distribution; positive nearest-neighbor correlation; negative nearest-neighbor correlation. The corresponding neutron diffraction patterns are shown on the right-hand side.

All simulations were created using the interactive short-range-order example. The input screen is shown in Fig. 5[link]. The chemical short-range order is created using a Monte Carlo algorithm and a feedback mechanism that allows one to create a disordered structure with given desired correlation parameters (Welberry & Butler, 1994[Welberry, T. R. & Butler, B. D. (1994). J. Appl. Cryst. 27, 205-231.]). The online simulation allows one to select the vacancy concentration and a set of desired correlations. A correlation value of zero corresponds to a random arrangement, negative correlations result in a tendency to avoid vacancy pairs, and positive correlations will create more vacancy pairs compared with the random case. As for the other examples, students can choose between X-ray and neutron scattering.

[Figure 5]
Figure 5
Input screen for the simulation of a disordered structure with chemical short-range order.

3. How does it work?

In this section, we will briefly describe how the online simulations work. The process consists of three parts: a form interface that allows the user to enter simulation parameters, a computer script that passes the information to the simulation program DISCUS, and a plotting program that creates the graphical output shown on the screen. A schematic diagram of this process is shown in Fig. 6[link].

[Figure 6]
Figure 6
Schematic illustration of the different steps to run an online DISCUS simulation.

The first part is the actual WWW page that contains the form which allows the students to enter the desired simulation parameters. The WWW page contains the name of the DISCUS script to be executed and passes this on to the Perl script. This allows us to use a single generic Perl script, discus.cgi, for all of the simulations. The WWW page also contains information about the simulation and questions that help motivate students to explore the influence of the different simulation parameters. The only requirement on the users side is a network connection to the server running the simulation and a WWW browser. Once the student clicks on the `RUN' button, the information entered in the form is sent to the WWW server and the script discus.cgi is executed. The script passes the parameters to DISCUS. After the simulation has been executed, the plotting program KUPLOT creates the graphical output. The program KUPLOT is part of the DISCUS package. Finally, the script discus.cgi creates the WWW page that displays the resulting graphics. When the simulations are used in a classroom setting with many students executing a simulation at once, computing on the server can become very slow. In order to minimize computing time, the simulation results are cached, i.e. when a second student executes a simulation with parameters previously used, the calculation is not repeated. It is also possible to run the simulations in a local environment without connection to the network. In this case, the WWW server is run locally and the WWW browser accesses the local computer (always named `localhost').

Online examples can easily be modified, extended or even new ones created. Just two steps are required. First the WWW page containing the form entries needs to be created or modified from an existing version. Several HTML editor programs are available that make this task easy even if one is not familiar with HTML. The layout of new pages can be tailored to local needs. The only requirements are that the form contains a hidden tag with the name of the simulation script and that the input fields are named P1, P2 etc. The second step is to create the simulation and plotting script. The existing examples can be used as a guide. The parameters passed by the WWW form are accessed in DISCUS by $1, $2 etc. The final graphical output must be named script_p1_p2_…gif, where script is the name of the simulation script and p1, p2, … are the simulation parameters. Depending on the complexity of the desired simulation, creating the actual DISCUS simulation will be the main part of the work.

4. Availability

The tutorial on diffraction and the online simulations are available on the WWW (Proffen & Neder, 2001[Proffen, Th. & Neder, R. B. (2001). Interactive Tutorial about Diffraction, https://www.totalscattering.org/teaching/.]). For individuals wishing to try different simulations and explore the tutorial, remote access is feasible. However, if the material is intended to be used as part of a lecture, we recommend that the tutorial is installed locally. The WWW sites mentioned above also contain a download section where the different parts of the tutorial and the programs DISCUS and KUPLOT can be obtained for local installation. In addition to the material provided, a WWW server and the scripting language Perl are required to run the online simulations. These programs are available for several platforms and can be downloaded from the Internet. Additional help with the installation, as well as with the modification or development of online simulations, is available from the authors on request.

5. Conclusion

The tutorial presented here covers a wide range of diffraction effects. In contrast to our earlier version of the tutorial, the newly added interactive simulations allow students to explore the relationship between real and reciprocal space in great detail without having to learn how to use the simulation software or how to plot the results. It is our experience that students not only respond well to these interactive examples but also seem to enjoy using them. It also solves existing problems of heterogeneous computer hardware in a computer classroom, since only a WWW browser is required in addition to one server actually running the simulations.

Acknowledgements

This work was supported in part by the National Science Foundation through grant DMR-0075149.

References

First citationGlusker, J. (1988). J. Chem. Ed. 65, 474–477.  CrossRef CAS Google Scholar
First citationHarburn, G., Taylor, C. A. & Welberry, T. R. (1975). Atlas of Optical Transforms. London: Bell and Hyman.  Google Scholar
First citationNeder, R. B. & Proffen, Th. (1996). J. Appl. Cryst. 29, 727–735.  CrossRef CAS Web of Science IUCr Journals Google Scholar
First citationInternational Union of Crystallography (2001). Crystallographic Education Online, https://www.iucr.org/cww-top/edu.index.htmlGoogle Scholar
First citationProffen, Th. & Neder, R. B. (2001). Interactive Tutorial about Diffraction, https://www.totalscattering.org/teaching/Google Scholar
First citationProffen, Th. & Neder, R. B. (1997). J. Appl. Cryst. 30, 171–175.  CrossRef CAS Web of Science IUCr Journals Google Scholar
First citationWelberry, T. R. (2001). Optical Transforms, https://rsc.anu.edu.au/~welberry/Optical_transform/Google Scholar
First citationWelberry, T. R. & Butler, B. D. (1994). J. Appl. Cryst. 27, 205–231.  CrossRef CAS Web of Science IUCr Journals Google Scholar

© International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.

Journal logoJOURNAL OF
APPLIED
CRYSTALLOGRAPHY
ISSN: 1600-5767
Follow J. Appl. Cryst.
Sign up for e-alerts
Follow J. Appl. Cryst. on Twitter
Follow us on facebook
Sign up for RSS feeds