Computer animation: On-line dynamic display in real time

The state of thc art of computer calcula- tion and display hardware and software development, has reached a &her significant, advanced point. I t is n...
1 downloads 8 Views 5MB Size
J. Scott WaltonL

Computer Animation

and William M. Risen, Jr.= Brown University Providence, Rhode Island 02912

O n - l i n e dynamic display in real time

T h e state of thc art of computer calculation and display hardware and software development, has reached a &her significant, advanced point. I t is now possible t o perform complex calculations very fast and to visually display the resulk essentially instantaneously. This immediately suggests the possibility of performing and displaying the results of sequential calculations in such a way as to move visually through the results stepwise. It further suggests that if the results can be displayed as figures representing physical reality, and that if this can be done such that the time between calculation sequential displays (the interaction time time display time) is short relative to our frame of time reference, then we can cxpect to be able to make these displayed figures move in precisely calculable fashion. Demonstration that this is possible, by describing our efforts in this area, reveals what we believe to be a new computer education interface of very exciting educational potential. Consider the pheuomena of interest to chemists, and taught to students, in which therc is physical motion. Time dependent chemical phenomena which are the subjects of undergraduate chemical instruction include two important ones in which atoms move; molecular vibrations and reaction dynamics. These are also two subjects on which lecturers often find that they have covered chalkboards with drawings of several time sepavated states, or find themselves waving hands full of models. They attempt to explain dynamic phenomena to students who have not yet developed the abilit,y to visualize these phenomena. Frequently accompanying this handwaving is a desire that an animated film of the nth normal vibration of molecule A or the sequences of species extant in some organic reaction scheme has been made. Indeed such films have been made for HCl and CHP vibrations, and for Ha X2 reactions; and such films have been effective, though expensive, visual aids on an elementary level. It would be of substantial value for any professor t o have such an effective display of the nth mode of molecules A, B, and C this year, and of XeF4, RCH3, RCOOH, ArOR, ClsSiCo(CO)4, or Cr021p2next year. I n reaction dynamics applications, especially in the form of discussions of sequential steps in mechanisms, it would prove useful for a professor to be able simply to specify the steps of a given reaction, say a substitution rcaction passing through a polymolecular activated complcx, and to have atomic and molecular pictorial rcprcscrrtationx he moved through the specified mechanism. This would hc just as useful for his new " pet" rcaction next ycar as for this year's gem! In ordcr to dcmonstratc the feasibilit,~of having a

+

+

+

334

/

lournol o f Chemiml Educotion

computer inst.mct a rapid display unit to "step" through a number of time separated representations in rapid succession, we have programmed an IBR'I 36050 with an IBM 2250 C R T Scope to achieve this computer on-line display capability. This capability is the ability of a large computer to instruct an on-line scope to display figures of arbitrary configuration on a screen, to compute new positions for all or parts of the figure(s), and to display them in place of the original display a t such a rate that the figure does, indeed, appear to move. Clearly any sequence of motions of atoms may be specified to occur as a two-dimensional true perspective view of the three-dimensional events as one normally "visualizes" them. We have programmed our system to display any molecule (up to 40 atoms) on the scope and to then, upon command, make the atoms move through any specified, but arbitrary mode of vibration. Cuts from a movie taken of this dynamic display are shown in Figure 1. We have chosen normal modes of molecular vibration t o demonstrate the use of dynamical computationdisplay systems for several reasons. The comparison between chalkboard figures of molecules accompanied by superposed arrows roughly indicating the eigenvector form on the one hand, and accurately plotted molecules which are vibrating with their displacements in accurate proportional relation to the complete eigenvector, on the other hand, shows both dynamic versus static and accurate versus rough representations. As is often true, there is also a pragmatic reason for our choice. The display discussed has proved to be a rather useful tool in the course of our research in the molecular spectroscopy of a variety of interesting systems. Pseudo eigenvectors, in the form simply of symmetry coordinate generated displacement vectors, provide for a display which is quite helpful a t the intuitive stage of force field definition when the number and importance of non-zero off-diagonal elements is being considered. T o the value of dynamic display as a vivid transmitter of concepts, one must add that accuracy of reproduction of a model is an important educational advantage. The impact of this advantage is a rather subtle quantity to gauge, but it is obvious that it is important. When a student sees a molecular model in which all bond lengths are defined in arbitrary "Tinkertoy" units he immediately, and properly, eliminates the possibility of drawing detailed quantitative conclusions from it. Instead he concentrates on the concept, the general

' Brawn University Undergradnate Research Student, 1968, praent address: S.U.N.Y. (Stony Brook), New York. Author to whom correspondence should be addressed.

arrangement of atoms. Similarily when detailed scale models are available, a new dimension of credence is possible on the student's part since accurate computer calculated representations are more convincing than artists' drawings. This result is just what lecturers and authors strive to evoke by descriptions accompanied by time-separated drawings. The time of separation is simply shortened, and the number of time-separated representations increasedl Dynamic Display of Molecular Vibrations

I n order to achieve the facility to display accurate representations of molecules and to cause them to vibrate according to a specified eigenvector it was, of course, necessary to program the computer and scope to utilize a certain necessary set of input data. The program3 can be logically broken down into four basic sections (see Fig. 2); data handling, display calculations, interaction and redisplay, and plotting. INITIALIZE VARIABLES SET OPTIONS

READ DATA ON MOLECULE AND VIBRATION

I'

I I

f

CALCULATE POSITIONS AND DISPLAY

PLOT WITH SCALING AND CURRENT OPTIONS

DATA SET

Figure 2. Logical Row diagram of the program for dynamic display of moieculor vibrotionr.

Data handling involves the initial reading of the data describing the geometry of the molecule and manipulation of t,hem into a form suitable for display. To describe a molecule and one of its vibrations completely the information required is the position of each atom, the eigenvector components for that atom (in the same coordinate system or one related by a known coordinate tra~isformation) and some information solely for display purposes, such as which atoms are bound to which other atoms. Limits of the display and other parameters are then calculated by the computer. It is not necessary to specify true eigenvectors. Displacement Persons desiring the softwear described in this paper can obtain it by sending a spool containing at least 25 ft of magnetic tape, including its detailed recording specificrttions, to the correspondent author. This program requires an operating system 360 with 2250-Model 1 C.R.T., with absolute vector and character generator features, buffer, and program function and alphs, meric keyboards.

Volume 46, Number 6, June 1969

/

335

vectors from symmetry coordinates, generated in the standard fashion, are useful starting points and result in a display of the mode described by that symmetry COordinate; so a usefully instructive display can result without prior normal coordinate analysis. Using the reduced data, an initial display is calculated. To reduce the three-dimensional molecule to a two-dimensional representation, the following transformation, based on two previously chosen virtual eyepoints, is used t

=P'

xi

=

z,

+1

Yi

=

Y,

1

Z,

-

+

ZO

(2,

- z,)

(YO -

up)

where (x,, y,, 2,) is. the viewing point, (xo, yo, zo) the point to be transformed and (st, y,) the two dimensional result. This is based on the algorithmbf C. PI. S t r a u ~ s . ~ With a complete display before the user, the computer has been programmed to wait for new instructions. These instructions may request vihration, rotation, change in the format of the display, plotting on paper, or new data. If rotation is requested matrix multiplication is used to rotate the three-dimensional vectors, representing positions and displacements, by some small, optionally variable, amount. The molecule is then redisplayed and the entire process repeated until stop rotation is requested. In the case of vihration, each vector, representing an atomic displacement, is multiplied by the sine of a phase factor. To dynamically display vibrations this phase factor is incremented, new calculations are done, the molecule is redisplayed, and the process is repeated until stop vibration is requested. Many other options are available. Some of these are requested by pushing one of several programmed function keys, where each key has been given a specific meaning by the program. Rotation and vibration are started and stopped in this manner. Also with these keys, the format can he changed. Bond lines can he displayed or eliminated, as can displacement vectors. The programmed function keys control whether or not the display is to be a stereo pair. If it is, two side-byside views are presented, each from a slightly different viewing point. For a nonstereo view, the view of the molecule occupies the full screen. Other data may be entered through the typewriter keyboard mounted on the scope. By pointing to the appropriate words (displayed on the screen) with a light-sensitive pen, the user indicates to the computer the desired action. This may he a change in the molecule size, or in the scale of the displacement vectors, the choice of a new viewing angle, or a change in the increments for rotation or vibration. The program responds by requesting the new value, the user types in it, signals completion, and the program continues after taking the necessary action. Finally, options which cause transfer to different logical divisions of the program are also specified by programmed function keys. If a new set of data is desired the program repeats the first two sections, reading the next sequential set of data. Plotting also may be requested. I n that case, the fourth logical division is entered. Since nearly all 336

/

necessary information has already been calculated, only the scale need be changed. Parameters are therefore multiplied by the appropriate scale factor to fit the paper size and then passed to CALCOMP subroutines. At this point the program will either return to the original display or read a new set of data, depending on the original request. A CALCOMP display of the C3. molecule ClaSiCo(CO)n,viewed from a position selected by viewing the display on the scope, is shown in Figure 3. The position of viewing in this case is not

Journal o f Chemiccd Education

F y e 3. Representotion of o CALCOMP plot of on AX vibrational e~genvectorrupsrpared on o representation of the molecule ClaSiCoICOlc

simply related to the molecular symmetry elements, but was chosen to assure that all atoms ate visible. I t is evident from a comparison of this display with the eigenvector for the niode and with displays from other viewpoints that a single static display can be a deceptive teaching technique. The photograph of Figure 1 was made by selecting frames from about 6 sec of 8mm film, of one-half period of a vihration of an AIBI(T~)molecule photographed from the scope, as the negative for enlarged prints. By this technique, we have a faithful but photographically negative represeutation of the scope, which displays light images on a dark hackground. To follow the film through this portion of the vibration read the film from the upper left corner of Figure 1 to the bottom of that column. Since the film was shot wit,h a Bolex Zoom Reflex P2 camera a t 24 frames/sec, a new image was calculated and displayed every 0.11 sec on the average. The frames of greatest contrast are new displays, and were used in Figure 1; these were separated in the film by fainter frames which were residual photographable displays, due to the slow ( t l l 2 0.03 see) decay time of the scope phosphors, which are detected on our ASA 400 Perntz film. It is clear that wheu production of films is the only objective, as it may be in some cases, real time computation (as fast as 9 images/sec) is not as important as synchronization of display and camera, so that in those cases slower systems with CRT output can be used. Of course, for real time viewing and closed circuit TV utilization the ability to display motion which is dynamic in real time is necessary. S~n.nuss,C. M., "Computer Spatial ilrawing and Display of Wireframe Objects," Division of Applied Mathematics, Brown University.

One very instructive point to he made from this particular molecule AdBa is one of considerable spectroscopic importance; namely, A-A body diagonals of the pseudo cube may be significantly distended without descrihing this diagonal as a valence internal coordinate. This means, quite simply that the mode shown, chosen for the clarity of display of a complex vibration, does not require A-A body diagonal bonds for its calculation. As a consequence, a spectroscopic treatment which finds it convenient to include such a bond does not provide evidence for the existence of the bond. This is a point which has eluded even recent workers in the field and which should he understood by all who use or evaluate such spectroscopic arguments. It is to he noted that the ability to rotate a molecule and to alter viewpoints will prove useful in instruction in the identification of symmetry elements in the application of point group theory. One cautionary note is also in order here. The atomic displacement magnitudes were chosen for display purposes, both in Figure 1 and 3, and are too large relative to the equilibrium bond distances. There seems to he no way to avoid this and still effectively display the eigenvector form. However, alteration of this distortion to the true relative magnitudes will give a convincing argument for the use of small displacement harmonic potential functions. Other Potential Applications

I n principle any dynamic event which is discussed in chemistry courses and to which we can assign a classical physical model should be a candidate for treatment by the method discussed here. Clearly, however, some such phenomena and events are more likely candidates than others. As can be seen from our approach to the molecular vibration problem, likely candidates for treatment are processes for which the events can he envisioned as a "choreography" of atomic and molecular representation steps. A reaction mechanism is such an event. We may conceive of a molecular representation at position A in the scope field, vibrating in some relevant mode. Then, the second reacting molecule, represented at position B and vibrating, is translated toward molecule A in a nonfavorahle attitude. After several nonreactive collisions accompanied by angular rearrangements, a reactive collision occurs. This collisiou is represented by a bond-making process, formation and subsequent vibration of the activated complex. This step is followed by bond breaking processes and disengagement of the products. If properly programmed, the input data required need only include initial geometry of the reactants, form of the vibrational modes, directions and magnitudes of translations and rotations, information about which bonds are to be made and broken, and the number and form of activated complex vibrations. A second candidate is suggested by the recent article5 in Tms JOURNAL by Professor E. F. Greene of this Department and Professor A. Kuppermann of the California Institute of Technology concerning chemical reaction cross sections for reactive and nonreactive collisions. The cover of the issue containing that article in fact shows several time separated representations of the dynamical event-the collision. I n this case, trajec-

tories of atoms and molecules can he specified and the impact point and instantaneous center of mass and post collision trajectories can he computed and displayed as the atoms move. I n addition to simply displaying the successful event, it would he conceptually simple to have the computer decide, on the basis of trajectory and potential function data whether the reaction proceeds or not and to have a specified interaction potential determine, in the event of nonreactive but inelastic collision, the post collision trajectories. During the preparation of this manuscript we have become aware of the computer dynamic graphic work of Professor 11.IZarplus and his students at Haward.= Their research use of display of atomic and molecular collision clearly shows the feasibility of the latter of our proposed "other potential applications." A very recent report' of the elegant calculations and display of HCI reaction, various mechanistic stages in the NH, by Enrico Clementi a t I.B.M. is encouraging evidence of the eventual feasihility of the first of our "other possible applications." In addition, it should he mentioned that work involving computer-generated films is being carried out under the Teaching Aids Committee of the Advisory Council of College Chemistry, and also at the Educational Research Center a t M.I.T.

+

Logistics and Practical Problems

We do not expect that all (or even very many) schools will be in a position to perform the type of calculation and display described here. The hardware and installation dependent software demands are too great for that. Our particular interest in reporting and descrihing these efforts has been to demonstrate the feasihility and discuss the potential of applying fast computationdisplay techniques as a powerful, flexible tool for accurate, credible presentation of dynamic systems in chemistry. The example we have chosen is, we believe, useful but may not he the most important of the various possible ones. We are hopeful that this demonstration of feasihility will stimulate commercial organizations with the facility to capitalize on the potential of this type of approach to do so. I n this regard, we suggest that suppliers of computer hardware and software might well explore the possibility of offering schools the appropriate packages to allow that school's computer system's users to specify molecules and reactions of their own choosing. One would hope, in fact, that in time this sort of facility is part of the normal capability supplied to major university computer systems. We further suggest that, upon development of such systems, a number of chemically interesting reaction mechanisms, molecular vibrations, etc., he performed, photographed, and distributed through appropriate channels as movies to be used where the necessary computer center is not available. If this is done, we would hope that among the first mechanisms to he treated would he the challenging electrocyclic mechanisms governed by the Woodward-Hoffmann rules, which were GREEN,E. F., AND KUPPERMANN, A., J. CHEM.EDUC., 45, 361 (1968). We thank Professor Greene of this Department for describing this interesting work by Professor Karplos and his students. ' Chem. and Eng. News, p. 16, October 21, 1968. Volume 46, Number 6, June

1969

/

337

suggcst,ed t,o us by Professor L. B. Clapp of this Department as particularly suitable. Since the viewing positiou of t,he observer call be moved through 360' in a planc normal to any arbitrary direct,ion defined by t,he molecule, these are vcry good candidates. I t is further suggested that the type of work described here is highly appropriate for and suited to the regioud remote tie-in arrangements which many smaller colleges and universities have with major computer installations. Thus, it is easy to envision a professor a t such a college preparing, according to some simple format, the iuput data required for a react,ion mechanism (or molecular vibration) and transmitting it from his termirral to the ceutral facility. The facility, having these dat,a (and notificatiou as to which program should be called from the library), would simply perform the computatiou and photograph the display in accordauce with prior agreement to do so for those colleges in their consortium. The movies thus obtained would be mailed to the iuitiating college from the commercial

film developing house. This entire process could easily take place in roughly one week. One filial note is in order. We have performed our demonstration of feasibility of IBM equipment as mentioned above. However, since a number of companies compete vigorously to claim that their capabilities represent the "state of the art" we hope that this test, which requires veal time speed of both calculation and interaction, and which places stringent demands on hardware and software of several types, will serve as a challenge t o all manufacture~qto serve the chemical education community in demonstrating their capabilities. Acknowledgment

We are pleased to acknowledge the contribution of computer time made to this work through A'SF Facilities Grant GP-4825 to the Brown University Computer Center, and the cooperatiou of Professor Andreis VanDam of the Computer Center and the Division of Applied R'Iathematics, Brown University.