Content area

Abstract

Now that most colleges and universities have extensive computer systems, more students are able to use computers as teaching tools. Kaess et al discuss the use of Visual Basic and Microsoft Excel programs for teaching chemical modeling.

Full text

Turn on search term navigation
 
Headnote

Michael Kaess, Jesse Easter, and Kim Cohn'

Department of Chemistry, California State University, Bakersfield, Bakersfield, CA 93311

Before 1970 most undergraduates had little or no experience with computers. Although almost every college and university in the United States had computers, they were usually in separate buildings where some of the undergraduate students might run programs they created in a computer class. The introduction of microminiaturized logic circuits in the early 1970s made it possible to build inexpensive computer systems, which were quickly integrated into research and teaching situations. In 1985, the first series of articles appeared in this Journal discussing the application of spreadsheets to problems in chemistry (1). Today, many students come to chemistry classes with some background in the use of some programs, usually word processing packages. Recent articles (2) have suggested that it is more important for students to make use of commercial software packages than to require students to prepare and implement programs themselves.

Rationale

Because our school accepts students directly from high school as well as many transfer students from two-year colleges, some students in upper-division courses have never used a computer while others have built, modified, or programmed computers. Consequently, one of the problems faculty at our school face is getting students who have had limited or no experience with computers to use computers as a tool in chemistry classes in the same way they use calculators. In addition, the faculty need to help students who have had extensive computer experience to integrate and reinforce their skills. To help both of these groups, we used experienced students as student programmers. They prepared computer modules that made use of a microcomputer to introduce computational chemistry, molecular mechanics, and modeling. The modules were used by students who had little or no computer background. They helped these students grasp topics and incorporate computer use in classroom assignments.

Because many of our students do not go on to graduate school, the modules were prepared with programs that would be useful in other personal, academic, or professional situations. The faculty settled on Microsoft Excel as the program of choice for the preparation of the modules. It is an excellent general-purpose problem-solving medium for building models, entering new data, and transforming data into charts to help analyze the model. In addition, the release of Excel 5.0 includes Visual Basic for Applications, which allows the studentprogrammer who builds the model to create custom commands, menus, dialog boxes, buttons, custom online help, and limited database connectivity through Microsoft Query. However, with the Applications Edition, Visual Basic 3.0 events such as Focus, Keydown, and Mousedown are not available. In addition, the Applications Edition uses Microsoft Excel to prepare grids and charts. This offers certain advantages over Visual Basic.

View Image - Figure 1.

Figure 1.

Because the student programmers use Visual Basic, they utilize the skills they learned in their programming course. The students who simply use the modules are presented with a simple interface to enter their data and examine results.

The first series of modules deal with quantum chemistry Students generally find quantum chemistry to be highly mathematical, quite difficult, and very abstract. They are right on all counts. However the subject is also extremely important today, even at the undergraduate level. There is, therefore, a need for relatively simple computer exercises that bridge the gap between the formalism of quantum theory and its various computational methods. The Excel modules prepared by student programmers attempted to do this in one way or another.

Results

View Image - Figure 2.

Figure 2.

View Image - Figure 3.

Figure 3.

As an example of the use of Excel modules, at our school, students examine the spectra of HCl and DCI (3). Many of these students have difficulty understanding the relationship between the theoretical concepts and the observed shape and position of the spectrum. To make the connection more concrete, a module was written to use Excel to generate a fundamental absorption band for a gas sample of a heteronuclear diatomic molecule (4). An example of a real-life molecule would be HCl or HBr. The spectrum the student generates is for a diatomic molecule, HX, where the student chooses the mass of X. The student enters values for the radius, the force constant, and the temperature. The input is shown in Figure 1.

After the values are put into the correct boxes, the module generates a spectrum comparable to the one shown in Figure 2.

Next the students qualitatively examine the effect of changing the inputs on the spectra. For example, they can double the mass of X and examine the effect. In a similar manner, they can examine the effect of changing the radius, the force constant, or the temperature. Finally, they answer a series of qualitative and quantitative questions about the spectrum they have obtained. An example of a qualitative question is, "How do the computer-generated spectra change when you change the force constant?" A quantitative question asks the student to compare the value for the wavelength of an experimentally obtained spectral band to the theoretical value generated by the computer.

Programming Excel with Visual Basic is relatively simple even for someone with limited programming experience. The starting point for the program is the input screen, shown in Figure 1. The input screen is laid out with controls, text boxes, and labels using simple drag-and-drop procedures. The code to be performed by the program is then associated with the input screen. The programmer can put in error routines along with the program to make the program more user friendly. Figure 3 is an example of the code.

Similar modules have been prepared for visualizing the Boltzmann distribution, preparing X-ray diffraction patterns of cubic crystals (5), calculating titration curves for polyfunctional acids (6), and illustrating the pressure-volume relationships for Van der Waals gases (7).

The student who produces the module and the student who uses the module both benefit from the experience. Student programmers benefit because they have to apply chemical principles and programming skills to produce the module. Students who only use the module benefit because they can model chemical behavior quickly and easily.

References

Literature Cited

References

1. Sparrow, G. J. Chem. Educ. 1985, 62, 139. Rosenberg, R. M.; Hobbs, E. Vj Chem. Educ. 1985, 62,140. Vong, R J.; Charlson, R.J.jI Chem. Educ. 1985, 62, 141.

2. Bowater, I. C.; McWilliam, I. G.; Wong, M.G. J. Chem. Educ. 1995, 72, 31.

3. Shoemaker, D. P.; Garland, C. W; Nibler, J. W. Experiments in

Physical Chemistry; McGraw-Hill: New York,1996; pp 397-404. 4. The approach to the calculations is outlined in Larrabee, C. E.; Sprague, E. D. J. Chem. Educ. 1988, 65, A204. 5. Rosenthal, J. J Chem. Educ. 1991, 68, A285. 6. Breneman, G. L.; Parker, O. J. J. Chem. Educ. 1992, 69, 46. 7. McNaught, I. J. J. Chem. Educ. 1993, 70, 232.

AuthorAffiliation

edited by

Steven D. Gammon Universily of Idaho Moscow, ID 83844

AuthorAffiliation

*Corresponding author. The first and second authors are under graduate students.

Copyright American Chemical Society May 1998