Apple II program for visualizing molecular vibrations

to the large majority of readers. Apple II Program for Visualizing Molecular. Vibrations. Eduardo L. Varettl. Universidad Nacional de La Plata. La Pla...
0 downloads 0 Views 2MB Size
Operation of the Program

The primary data needed by the program are the forward and reverse rate constants hi and h,, and the orders of the forward and reverse reactions, Or and 0,. The systems most directly simulated are a solubility equilihrium and the dissociation of a weak acid. In anv case the svstem mav .he .oerturhed by the removal of one bf the prod;ct species so that students can ohserve the operation of LeChatelier's Principle. Initially 128 "f" symbols are displayed on the left side of the screen representing the numher of molecules of the reactant species, e.g., molecules of a weak acid, HA. The time per unit reaction is computed independently for the forward and reverse reactions, depending on the order, rate constant, and the numher of molecules present. For the forward reaction this is called the "dissociation time" of HA; for the reverse reaction it is called the dissociation time of H 3 0 f . After an interval of one forward dissociation time a "f"symhol is erased and the svmhol proeram places in the middle of the screen a ~. representing hydronium ion and a "-"symhol representing A ion. The dissociation times are continually updated. As the forward reaction proceeds, the reverse dissociation time decreases and dissociation of the hvdronium ions beeins to occur: an; a "-". he the program adds one "+" andheletes a reverse reaction is accompanied by an audible click to call attention to the event. As the program runs, the two times approach each other's values until equilihrium is achieved. The program in no way "forces" equilibrium; it occurs because the formula for the

"+"

"+"

Figure 2. Screen display for simulation of aqueous equlllbrlum showing 106 HA molecules. 22 H+ ions, and 22 A- ions.

For the HA dissociation model, Or = 1 and 0, = 2. The reason for the pseudo first order kinetics of the forward reaction is discussed with the students. A solubility equilihrium is simulated by specifying Or to he zero and 0, to be 2. Since only a small numher of molecules is simulated, the program cannot obtain exactly the equilibrium constant expected from the ratio of rate constants. For example, let hi = 5, Of = 1,h, = 1.0, = 2 (the "weak acid" mode). Denote the numher of HA 23, givingK = 5.04. The display thus oscillates between ;Lat configuration and N,Nh = 106.22 ( K = 4.57). eivine an im.

.

a 4% error (see Fig. 2). This program was written in Assembler Language for the Datapoint 2200 minicomputer and will not he transportable to the large majority of readers.

Apple II Program for Visualizing Molecular Vibrations "concentrations" will he seen to he approximately equal to the ratio of the forward and reverse rate constants. A snecial i n ~ u t parameter causes the program to stop each time a certain amount of reaction time has passed so that the student can collect data. The reaction quotient Q can he computed from the tallies so that its variation with time mav he observed. Once each millisecond, a time variable is Lncremented for each reaction. When either reaches the appropriate value of t , the display is revised to show that a dissociation has occurred, and the dissociation times are recalculated. (Typical dissociation times are 20 ms or greater.) All of this is done in an interrupt service routine (ISR). When there is no dissociation occurring the ISR takes much less than a millisecond to perform. But the routine becomes very time consuming (possibly 100 ms) when a reaction takes place, especially the updating of the display and the numeric quantities. A skew then is introduced into the time variable because the reaction is in effect halted for many milliseconds while all this is taking place. If N is plotted against time determined by a stopwatch, the "experimental" rate constants come out too low by afactor on the order of two to 10. To combat this the program monitors the actual time during which interrupts are enabled, i.e., the actual reaction time, and halts for data collection when this quantity is equal to the stop-time parameter entered by the user. At any time the student can strike a special key which causes the program to pause and ask for the numher of moles of base to he added to the system as if he were titrating the acid. The specified numher of hydroninm ions are removed and an equal number of symhols representing HB and C+ are placed on the right-hand side of the screen. ( H B is assumed to be much weaker than HA so that there is no free B- present a t any time.) The program then resumes its ordinary operation and the equilibrium is seen to he reestablished with the position of equilihrium shifted to the right but the same value of K. This is pedagogically useful because it illustrates the situation where H+ z A-. 44

Journal of Chemical Education

Eduardo L. Varettl

Universidad Nacional de La Plata La Plata, Argentina The vibrations of simple molecules are usually represented in the literature by "sticks and halls" models with attached arrows which indicate the relative movement of each atom. Such static representation of an eminently dynamic phenomenon invites improvement for educational purposes. A microcomputer program that represents such vibrations in animated motion has been developed as an instructional aid. The animation speed of the program is naturally limited due to the inherent slowness of the BASIC lan~uaee.However. gular triatomic molecules. Besides, the frequency of vibration can he modified a t will during the demonstration using one of the microcomputer games controls, allowing a good visualization of the distorted molecule. This feature is useful when the changes of dipole moment and molecular polarizahility are discussed in relation with the infrared or Raman activity of the vibrations. We use the program during a short introductory course on vibrational spectrosco~voffered to oeoole workine in academe or industry.-of course, it could be useful in any course on general or physical chemistry. Program VIBRO was written in Applesoft BASIC for an Apple I1 Plus microcomputer. Graphics are presented in black and white in the high resolution mode making intensive use of the shape tahle utility. This feature allows one to predefine a shape that is to he sent to the screen and store it & the machine memory before running the program. VIBRO has 100 multi-statement lines, no comments, and requires about 6K of memory, whereas the shapes definition table needs 180 bytes of memory. Program and shapes definition listings and the corre-

sponding instructions are available from the author. Send three International Response Coupons to cover postage to Dr. Eduardo L. Varetti, Area de Quimica InorgBnica, Facultad de Ciencias Exactas, Universidad Nacional de La Plata, 47 esq. 115,1900 La Plata, R. Argentina.

weight, can be obtained only when the polymer, a solvent, an osmometer, and a thermostat bath have been properly assembled. If osmometry and number-average molecular weights have been covered in class, the student will he reauired to vass a preliminary auiz. If not, the instructor may

Dynamic NMR Spectra of Two-Spin Systems

material to catch up in order to treat the data; both are pedagogically useful. The program requires good safety standards to he maintained in the laboratories. For instance, if safety glasses are not "worn" in any laboratory, the student is expelled from the building which is tantamount to losing all accumulated data. The program is written in APPLE PILOT and requires an Apple language card and an Author disk to modify the program. The program can he run on any 48K Apple 11. There are approximately 600 statements occupying 170 blocks which includes PILOT system information. Total solution of the problem generally takes several hours which has prompted us to include provisions for saving the current status in a file automatically created by the student. A description and program listing and copies of floppy disks are available. Send check or money order made out to the Department of Chemistry and Chemical Engineering in care of the author a t the ahove address ($5 for a listing; $15 for a listing and copy of the disk).

Richard A. Newmark 3M Central Research Laboratory St. Paul, MN 55144 The equations of Gutowsky and Holm (7) are used to calculate dynamic NMR spectra for two uncoupled spins undergoing exchange. The populations of the two sites need not be equal. The intrinsic linewidth (linewidth in the absence of exchange) correction is included in the equations. The program will list the spectral amplitudes versus frequency or produce a high resolution plot. The program will systematically iterate over tau, the lifetime of the spins in site A, to match the observed linewidth of the snectrum a t both slow exchange rates (2 peaks present) and fast exchange rates ( 1 peak observed). The program will also systematically determine the true frequencies (frequencies in the absence of exchange) - . of the two peaks a t slow exchange rates. The free energy of activation for exchange is calculated if the temperature is eiven. This program has been used a t 3M to calculate dynamic NMR spectra for simvle organometallic systems. It should he equallyc~pplicahleto organ; or physical chemical experiments in which dynamic NMR spectra are observed and serve as an introduction to the use of NMR in the study of dynamic equilihria. For example, the student can quickly reproduce the classic example of N,N-dimethylacetamide shown in most elementary textbooks and see visually how changing the peak frequencies, site population, exchange lifetime, or spectrometer linewidth affects the dynamic NMR spectrum. The program is written for a 48K Apple I1 Plus. The coding uses 300 lines of Applesoft BASIC and could he easily rewritten for other versions of BASIC since the graphics portion is only used to plot the NMR curve in a simple loop. Listings and nrogram conies on your disk are free: conies on mv disks ; are $3.50 e a c h . ~ e n dchecks to R. A. Newmark, 3 ~ Bldg. 201-BS-05, St. Paul, MN 55144.

POLYMERLAB: A Computer-Generated Problem Fred D. Williams Michigan Technological University Houghton, MI 49931 In order to review and to anticipate lecture material in polymer science as well as to simulate a series of lahoratory experiments, we have developed an interactive program using an "adventure" format. It is intended for seniors or graduate students. The student begins with an unknown polymer and must "search" a lahoratory building to acquire the necessary equipment and supplies to conduct experiments. The challenge is to identify the polymer and as many of its physical properties as possihle. Furthermore, prior to being permitted to conduct any experiment or test the student may have to mass a ~reliminarv "auiz . on the exnerimental material. The running program gives the student enough information to determine the emnirical formula. intrinsic viscositv. .. numher and weight average molecular weights, as well as a scanning electron micrograph and infrared and nuclear magnetic resonance spectra when appropriate conditions are met. As a typical example, raw osmotic pressure data, i.e., solvent height as a function of weight percent polymer that is used to determine the material's number average molecular

Programming Utilities for the APPLE II Plus Edgar H. Nagel Valparaiso University, Valparalso, IN 46383 Two machine-language utilities have been developed for the APPLE which greatly aid the use of the computer for Computer Aided Instruction (CAI). The utilities allow users to print upperllower case with suhscriptslsuperscripts and to type expressions a t an INPUT statement. The utilities require a 48K APPLE I1 Plus with DOS 3.3. The character generator was developed hecause CAI leaves something to be desired if it is all done in upper case letters. 1Tnnnr case can be added to the APPLE either bv ~- nnd - ~ - lower ~ making hardware modifications or by using the high resolution erauhics screen. Proerams develowed usine" modified APPLES are not as transportable as ones developed using software. Therefore, the character generator that was developed does not make use of any special additions to the APPLE. The eenerator and character set simwlv . . reside ahove page . . two of t i i t 1i: