Quantum chemistry has many concepts that are either abstract or counterintuitive, giving students difficulties in understanding them. Fortunately, the advancement of web technologies provides us with hordes of powerful tools to produce rich multimedia web applications that supplement traditional classroom teaching. In this paper we present an approach to address this issue that combines interactive simulations and visualization on the web browser using Shockwave technology. With several examples, we show how to take advantage of the features of the Shockwave technology in developing web-based course material with ease.
The progress of web technologies opened up new horizons for education. The education scene is no longer in the confines of textbooks and classrooms, and much educational material has been developed and delivered over the web. Using the web has a distinct advantage over classroomonly instruction: the instructor can program or write scripts to make the web page dynamically respond to student inputs such as key strokes and mouse clicks. Especially, interactive data visualization and simulation of natural phenomena can be utilized for the utmost benefit to students of science.
Creating interactive, multimedia courseware involves assembling text, graphics, audio, video and animation, and programming or scripting. Traditionally, Java has been the premier language for such supplementary online courseware production.
Typical scenario of Java-based course material may be depicted as shown in
(a). The course material may consist of either a long single web page that can be scrolled or a set of web pages hyperlinked together. In this scenario the bulk of text explanations is in HTML format and interactive simulations are executed using one or more Java applets.
However, having multiple applets can make the web page load slowly, and navigating away from a web page and opening a new one that has applets also takes time. Consequently, it is often desirable to have a single web page and achieve what can be done with multiple applets and multiple pages. That can be done with some e-learning tools such as Flash, which is equipped with a built-in Timeline that allows the use of multiple pages-- "frames" in Flash parlance (
(b)). In addition, creating or controlling objects on the screen can be done visually, and more advanced controls can be done with Action Script, the Flash scripting language. Thus, Flash is a very powerful rapid application development (RAD) environment for courseware creation. With the missing of timeline in the integrated development environments (IDEs) coupled with limited visual programming, Java may not be the most efficient RAD environment for course ware creation.
Schematic diagrams of a course material with (a) Java applets embedded in web pages and (b) a Flash or Shockwave page with multiple frames.
Another authoring tool, relatively lesser-known but more capable than Flash, is Director Shockwave Studio (hereafter called Director for short).
Although Director started out as a tool mostly for creating multimedia pieces and games, nowadays a growing number of web sites for science education use it as a course ware development environment.
The Director IDE also features a timeline along with a multitude of intuitive drawing tools and a huge Library of widgets and pre-built codes for visual authoring, as shown in
The visual development environment is quite powerful, so a completely new user to the tool can produce a high-impact educational material in a matter of hours without writing a single line of code.
For more versatility one can use the built-in scripting language, Lingo script,
which is a fully object-oriented language with not so a steep learning curve. Often scientific simulations require fast rendering of the results in real time. Director has a high-performance sprite rendering engine for both 2D and 3D graphics, as compared to Flash.
For 3D graphics Director can utilize either OpenGL or DirectX hardware-accelerated rendering. Flash (even the current CS4 version) lacks a true 3D engine. Another good thing about Director is that, while viewing a frame, other frames can be loaded in advance with commands such as preLoad and preloadNetThing, minimizing loading time. For these and other reasons, we have used Director as the main development tool for creating interactive simulations for educational purposes.
Parts of Director's built-in graphic user interface (GUI). (a) Tools palette. (b) Library windows showing Flash Components and codes. (c) Timeline (Score). The numbers 1,2,3,… in (c) denote layers that objects on the screen (stage) occupy.
A work authored with Director is subsequently published for the web in a format called Shockwave. A Shockwave "movie" can be played with the Shockwave player-a web browser Plug-in similar to the Flash player. Currently, nearly 60% of web browsers have the Shockwave player installed, so the Shockwave format already has a large user base. If a browser does not have the player, it can be downloaded and installed readily.
We report in this paper how we use Director and Shockwave to do interactive simulations and visualization for teaching chemistry. Previous works have been reported elsewhere.
Examples are chosen from topics in physical chemistry, especially on atomic and molecular structures but they can easily be extended to other subject areas. These topics are based on quantum theory, which is fraught with abstract concepts that are far removed from everyday experiences, causing students to be susceptible to many misconceptions.
In addition, quantum chemistry involves equations and mathematical expressions that are beyond the ordinary mathematical skills of many chemistry students. These factors contribute the students' loss of motivation to study quantum chemistry. McKagan et al. argue that visualization, interactivity, context, and effective use of computations are particularly effective for helping students understand the abstract and counterintuitive concepts of quantum mechanics.
There are several other reports about the effectiveness of the use of interactive visualization and simulations for teaching quantum mechanics.
As mentioned above, the Shockwave technology is an efficient RAD tool for creating interactive visualization and simulations. Thus, we believe that a report on such an implementation with Shockwave to ease student difficulties with quantum chemistry would be a valuable contribution to the literature.
In the next section, two-dimensional simulations and graphing with Lingo are discussed. Director comes with two approaches to drawing--the Imaging Lingo and the Vector Shape Lingo. The Imaging Lingo consists of commands and functions to manipulate each pixel of a bitmap. The Vector Shape Lingo commands manipulate vector shape objects with mathematical operations, so the results are resolution-independent as in Flash graphics. Either approach has its own strengths, and we will consider both of them. Then we discuss interactive three-dimensional simulations and visualization. Here, three examples are discussed: new surface plot technique for visualizing atomic orbitals, space quantization of angular momentum, and creation of a 3D viewer of molecules with external PDB (Protein Data Bank) files pulled from the web.
TWO-DIMENSIONAL GRAPHING WITH LINGO
- Hydrogen radial functions
As an example of graphing with Vector Shape Lingo, we consider the case of hydrogen wave functions. Here we are interested in plotting the radial part of the wave function,
) and the corresponding radial distribution function,
we show the Shockwave implementation in action. The radial parts of the wave functions are expressed in terms of associated Laguerre polynomials. They are analytically evaluated using Lingo, and then plotted as the user changes the values of the quantum numbers
and hits the "Plot Curves" button. In the figure, the curves, axes, and legends are drawn with Lingo. The code snippet attached to the "Plot Curves" button for generating a curve is something like the one shown below:
v = new(#vectorShape)
v.vlist = [ ]
repeat with x = 1 to 100
y = (any valid math expressions)
x = x + 1
add vlist, [#vertex point(x,y)]
Dynamic curve plotting with Lingo. The curves are generated by entering the values n = 2 and ℓ = 0 in the text fields and pressing the "Plot Curves" button. If the screen is cluttered with many curves, one can press the "Clear Curves" button to clear the curves.
In the above code, plotting of a vector shape object v is done simply by assigning vertex points defined by an appropriate math expression to the object's vertex list property. The text fields and buttons in the gray user interface area of
are created simply by dragging and dropping them from Tools palette shown in
(a), saving a lot of coding time.
Students can keep adding curves by changing
values and pressing "Plot Curves" button again. If wrong values are entered, an alert window pops up, warning the user to enter correct values. Generally, this type of dynamic plotting as parameters change enables students to explore firsthand the properties of functions, and hence underlying scientific principles, which is often hard to achieve with static graphics.
- Tomographic atomic density plot
For visualizing atomic orbitals many textbooks use isodensity surfaces,
which may mislead some students to think that atom has a welldefined shape and electrons are confined and uniformly distributed inside the surface.
Alternatively, electron densities are shown to emphasize the probabilistic nature of the atomic world.
However, usually the students are not informed that the densities shown are those on a plane that passes through the nucleus, which may instill in students that atom has a fixed density distribution. These problems can be alleviated with tomographic density plots. Again, we take up the visualization of the hydrogenic orbitals to demonstrate our approach.
Density plot of atomic orbitals. User selects an orbital by clicking on the orbital name on the left pane, and the selected orbital is highlighted with a purple color (Here 3dx2-y2 is selected). Orbital density is dynamically updated on the top right screen, as the user drags the slice planes at the bottom right screen along either x, y, or z directions.
shows a screen shot of dynamical graphing of the electron probability density for the 3
orbital. Here, the
slice plane given at the bottom right screen is dragged along the z axis, and the density displayed on the top right screen is dynamically updated depending on the position of the slice plane. One can also click either the x or the y axis, and the corresponding slice plane appears at the mouse position and it can be dragged along that axis.
We generated the density plot with following code snippet:
In the above, (the stage).image. set Pixel(x,y, color reference) is an Imaging Lingo command to set the color of the pixel of the image object on the drawing area (the stage) at the point (x,y) with the color reference. The color reference is computed by assigning the density
) = |3
, multiplied by 255, to RGB color values. The highest value of the function is normalized to 1, and it is multiplied by 255 so that it may have the brightest color. In the above example, we adjusted the color red only, but it is possible to change both green and blue colors as well, giving diverse coloring schemes.
The setPixel() command is intended for a very high-resolution density plot, since it manipulates each single pixel. If speed is more of an issue than the resolution, one may use another Imaging Lingo command (the stage).image.fill(rect, col), instead. The parameter rect denotes the bounding rectangle whose top left corner is the point (x,y) and bottom right corner is the point (x+dx, y+dy), where dx and dy are offset values in pixels. Since the fill command does not manipulate pixel by pixel, the required number of operations and hence the processing time can be reduced by a factor of dx
colorScheme = rgb(func(x,y,z)*255,0,0)
- Simulation of Young's double-slit experiment
Director is a multimedia authoring program, and hence it shines when creating animations. In this subsection we discuss interactive animated simulation with Director. Many simulations in the literature are of Monte Carlo type, so we do the same here. The example we chose is a simulation of the Young's double-slit experiment that directly demonstrates the wave nature of matter.
When incoming electrons pass through a pair of slits and fall upon a fluorescent film, light bursts from the film exhibit an interference pattern. The interference pattern is given by
is the wave number and
is the slit separation, and
is the distance between the slits and the detector screen.
shows the simulation in action. The "control panel'' in the figure shows various GUI controls, which again have been dragged from the Tools palette of Director and dropped onto the stage. Users can adjust the wave number, the slit separation, and the screen distance by clicking on the NumericSteppers (the controls with up and down arrows), and start, stop, and reset the simulation with the corresponding buttons. A text box is provided to show the number of electrons fired.
Simulation of Young's double-slit experiment.
The electron dots are generated by drawing small yellow circles with the following Imaging Lingo commands:
In the above, point1 and point2 are positions of the top left and the bottom right corners of the bounding rectangle of the circle. The setPixel command could have been used in this case as well. However, then the dots generated would be too small to see. We avoid this by setting the size of the bounding rectangle to 2×2 pixels.
We wanted to give students the illusion of gradual build up of the interference pattern. So, we used the frame action command _movie.go(the frame) that makes the playhead loop on a frame, and adjusted the frame rate to 30 and drew one dot per frame. Consequently, by this scheme students see an animation of 30 electrons per second being fired and landing on the film. The rejection method
is used to generate random deviates having the distribution function |
given by Eq. (1) for the position of the dots. This type of simulation technique may find applications in teaching a wide spectrum of scientific subjects that involve the kinetics or dynamics of many particles.
options=[#shapeType:#oval, #color: rgb(255,255,0)]
APPLICATIONS OF 3D LINGO
Another powerful feature of Director is its genuine 3D graphics capabilities. Three-dimensional scenes can be rendered using Software mode, OpenGL, or DirectX. The last two rendering methods take advantage of the power of 3D hardware graphics accelerator of the user's computer. Director has an extensive API for 3D Lingo scripting, and we will discuss some applications of 3D Lingo in this section.
- Surface plot generation
One of the most popular 3D plot types is surface plot. The usual method for generating a surface plot consists of defining a data structure containing all the 3D points in the world coordinates, transforming these points to screen coordinates with transformation matrices, giving appropriate perspective, and drawing lines connecting the points. One also has to worry about the hidden line problem.
We take a quite different approach, taking advantage of 3D Lingo, and it cuts coding time significantly along the way. This technique is akin to terrain generation from height maps and basically involves two steps: (1) Generate a basic plane primitive with
, Left). (2) Deform the plane mesh with data stored in the array vertexList (
, Right) with the commands below.
shows the 3D surface plot of 3
atomic orbital, generated with this method and wireframe rendered. If one wants to avoid the hidden line problem, the surface can easily be textured anyway one wishes. Furthermore, many operations to manipulate 3D models are available in the Code Library of Director. In order to view the model from different angles we dragged a "Rotate Camera Action" from the library and dropped it onto the model to rotate it while the left mouse button is pressed.
Surface plot generation by mesh deformation. Left: Plane primitive. The plane corresponds to a data array initialized to zero. Right: Mesh deformation by a non-zero data point.
3D surface plot of 3dz2 orbital generated with the mesh deformation technique. The rotation of the model is achieved by dragging a code from the Code Library and dropping it onto the model.
- Classical and quantum angular momentum
A rotating or spinning object has angular momentum associated with the motion. In
, the object is represented by the black-and-white ball and the angular momentum vector by the arrow. The blue sphere is the surface on which the tip of the angular momentum vector moves. Classically, if the axis of the spinning object has a constant inclination to the z-axis, the angular momentum vector will precess about the z-axis. In the previous frame of the simulation (not shown in
) the user can drag the vector to change the inclination arbitrarily between 0 and 180 degrees, and see the animation of the precessional motion. However, quantized angular momentum cannot have arbitrary directions.
shows that for the case of angular momentum
= 2, the projection of the vector along the z-axis can have only certain discrete values:
= –2, –1, 0, + 1, + 2). In this screen shot, the angular momentum vector jumped to an orientation corresponding to the button labeled as "
= –1". But the orientation in the xy-plane is completely unspecified due to the Uncertainty Principle. We designed the simulation to teach these facts. Thus, whenever the user clicks a button, the x and the y components of the vector are randomly oriented in the xy-plane, while the z component has a definite value. By playing with this simulation, students can learn the concept of Space Quantization of angular momentum.
Simulation to teach Space Quantization of angular momentum. If the user clicks on a button, the vector jumps to a position with a definite z value but random x and y values.
- PDB file viewer
The Protein Data Bank (PDB) is a repository and a file format of experimentally determined 3D structural data of molecules. A PDB file contains atomic coordinates, bibliographic citations, primary and secondary structure information, and may include other informations. In this section we discuss how we built a 3D viewer for molecules, whose structural data is given in the PDB format.
The PDB viewer uses some Net Lingo commands to download PDB files from the web. A part of the PDB file for the C540 Fullerene molecule, which consists of 540 carbon atoms, is shown below :
Interactive rendering of a Fullerene C540 molecule (top) and a Benzene molecule (bottom). Carbon and hydrogen atoms are represented by green and red balls, respectively. Users can rotate the models and zoom in and out on the screen.
In this version of the PDB viewer not all informations in the file are needed. The informations used are the types of the atoms (whether they are carbons or hydrogens, etc.), the positions of the atoms in 3D space, and connections among the atoms.
The atoms are represented with colored balls and there is an option whether to view the bonds between the atoms or not. In
we show a C540 Fullerene molecule on the left and a Benzene molecule on the right, with bond viewing turned off. Users can drag the model to rotate it and zoom in and out to explore the structure at will. These creation of these controls are again facilitated with the Code Library.
The incorporation of interactivity is known to enhance the learning process.
We believe that teaching science concepts, which is often abstract, would benefit even more from interactive simulations and visualization. However, the production of such interactive courseware should not tax busy science educators. It is desirable either to use a library of routines for such purposes or to use a RAD tool such as Director we used to produce the simulations reported here. We managed to build the most complex simulation in less than 100 lines of Lingo code, which is quite compact as compared to other development tools.
Showing the results of the simulations graphically
in real time
as they proceed is a powerful technique for enhancing students' intuitive understanding of science concepts and processes occurring in nature. The examples in this paper are largely selected to show atomic and molecular structures that may be used in physical chemistry courses. However, the simulation and visualization techniques can be applied to teaching concepts and chemical processes in other chemistry disciplines (and, for that matter, other sciences) that students may find difficult to understand and visualize in mind.
Over the years we found that some students have low self-motivation to study, and even the interactive simulations and visualization were not so effective for such students. This situation let us to create game-like virtual environments, using Director as the main development tool along with several other complementary softwares, and embed physical chemistry course materials in them.
The end-of-semester evaluation for the course was very encouraging, and we are working on creating more engaging educational materials. Incidentally, there appeared an article on creating educational games with VPhython scripting language for use in physics courses.
Such an approach will undoubtedly enhance physics education substantially. Director comes with a physics engine (Havok in the previous versions of Director and Ageia PhysX in the current version), so similar or more elaborate physics-based virtual worlds can be created rather easily with Director and Lingo as well.
Physlets: Teaching Physics with Interactive Curricular Material
U. S. A.
Lee C. J.
19th International Conference on Chemical Education
Sookmyung Women's University, Seoul, Korea
Lee C. J.
In Handbook & Abstracts
The 10th Asia Pacific Physics Conference
Postech, Pohang, Korea
AIP Conf. Proc.
AIP Conf. Proc.
Boo H. K.
Journal of Research on Science Teaching
McKagan S. B.
Perkins K. K.
Wieman C. E.
Am. J. Phys.
DOI : 10.1119/1.2885199
Keller C. J.
Finkelstein N. D.
Perkins K. K.
Pollock S. J.
PERC Proceedings 2006
Melville, New York, U. S. A.
Goldberg D. E.
Fundamentals of Chemistry
New York, U. S. A.
McQuarrie D. A.
University Science Books
Sausalito, U. S. A.
American Journal of Physics
DOI : 10.1119/1.16104
Press W. H.
Flannery B. P.
Teukolsky. S. A.
Vetterling. W. T.
Numerical Recipes in C: The Art of Scientific Computing
Cambridge University Press
Cambridge, U. K.
Woo K. H.
Journal of the Korean Chemical Society
Computer Graphics for Java Programmers
Chichester, U. K.
Lee C. J.
19th International Conference on Chemical Education
Sookmyung Women's University, Korea
Lee J. W.
Physics & High Technology