PKIND: An acid-base indicator simulation for Apple II microcomputers

deleted these lines and written an 8087/8088 As- sembly language subroutine to perform their task. As a re- sult, Version 2 of the program runs about ...
0 downloads 0 Views 2MB Size
Student acceptance and reactions toward the simulation as pre-lab or post-lab activity have been positive. In a relativelv brief time. with no waste of materials. the simulation provides insightinto the process of the labo;atory measurements. The student must discover the o ~ t i m u mconditions by trial and error; s h e sees disappointing results displayed promptly and must repeat the run after changing a variable. The experiment may be attempted with a wider choice of conditions than may be feasible in the laboratory. The earlier versions of PKIND were in BASIC and produced hard copies one graph a t a time a t line-printer terminals of minicomputer system. Written materials with references and exercises were provided; spectra could be compared by superimposing them over a light box. Upon determining that no refinement of PKIND has been made by the original authors we were encouraged to proceed in producing a version for the Apple I1 series of microcomputers. The algorithm for producing spectra is essential to PKIND. For each of two forms of an indicator a number comparable t o molar absorptivity is calculated as a function of wavelength from an equation obtained by a curve-fitting method applicable to rather broad oscillatory curves:

Figure 9. Spacefillingdiagram of cubane generated uslng MOLDOT, based on data from ref 29.

I have described in this column a program named MOLDOT, which prints space-filling perspective diagrams of molecules using a dot-matrix printer (28). The program was written chiefly in BASIC', and was inconveniently slow even in its compiled form. Of the 337 lines of BASIC code, 68 accounted for most of the time taken t o run the program. I have now deleted these lines and written an 8087/8088 Assembly language subroutine to perform their task. As a result, Version 2 of the program runs about 12 times faster than the earlier version. For example, the diagram of cubane shown in Figure 9 required 2 min and 2 s to compute, whereas using the earlier version of the program the same diagram required 23 min and 31 s. (Both times were measured with a machine running a t 4.77 MHz.) The only other change I have made is to nrovide the ontion of drawine onlv - the outer circle of dots forkach atom. * Version 2 of MOLDOT is available from Proiect SERA. PHIM. In addition to previous requirements, an 8087 coprocessor is nowneeded.

PKIND: An Acid-Base Indicator Simulation for Apple II Microcomputers Darnell Salyer Eastern Kentucky University. Richmond, KY 40475 The variation of the absorption spectra of acid-base indicators with pH continues to be the basis of a preferred method for determining their pK values (30-36). This excellent method illustrates well several theoretical principles, requires a variety of laboratory techniques and experiences, and makes possible numerous extensions. Students may be assiened a limited number of DH values for studv in a team e&, hut the experiment tends to be long and may require two ur three lab periods. As an aid to the student doinr this experiment in a n instrumental methods course we havelong used an adaptation of a computer simulation developed at the University of Bridgeport, CT (37).

' Assembly-language subroutines were used for bit manipulations, but not for arithmetic. 798

Journal of Chemical Education

The concentrations of acidic and basic forms are calculated for a specified indicator molarity and pH using its K value. The net "absorbance" for a mixture is then readily obtained and dotted vs. waveleneth. The nolvnomial coeffi" . " cients for each form of seven common indicators were determined from absorbance-waveleneth data with an nth-order regression least squares program (38).Fourth-order equations were quite satisfactory for producing normal and first derivative curves.

,

FeatUreSd the MlcrocomPuter program The smoothness of curvature of the "spectra" is mostly determined by resolution of the .?-bit Apple HIRES screen but is also related to speed of calculation and plotting. Evaluating the polynomials is slow, but stepping through the execution loop in increments of 10 nm and using predetermined waveleneth ~ o w e r swith coefficients read from data statements pro&& a given curve in about 10 to 15 s. Visual examination of a curve allows estimating absorbances up to 1.8 to within 0.02 unit and wavelengths within 2 nm. Users may also ask the computer for absorbances in the range 350700nm and are given valuesto the nearest 0.001 unit, though instructors may choose modification to the nearest 0.01 unit. The program does not simulate the operation of solution preparationhandling or the adjustments of instrument parameters. The user joins the experiment "in progress", as i t were, having reached the moment when pH buffers and indicator stock solutions are ready. The optimum conditions of concentration and pH may then be found and the tasks of data collection and calculations confronted. I t is unnecessary to make blank or base line corrections for absorbance values, and a cell thickness (optical path) value of unity may be assumed if that should be necessary in calculations. A single K is considered for each indicator. Beer's law is to be assumed throughout the program, and activity effects are not considered. If the user enters a molarity exceeding a built-in limit, a message that the "solution is opaque" will be produced. Likewise, if the entered concentration is less than 1/10 of the limit, the computer replies that absorbance approaches zero. But, spectra may still be produced with absorbances uncomfortably too large or small for good results, so user finds the real experience simulated and must search for optimum concentration. pH values less than -1 or greater than 15 will produce an out-of-range message. A graphical display of five curves at various pH's (see Fig.

marks. This program runs on a Apple 11+ or IIe with 48K memory; it employs certain features of the Applesoft Tool Kit and of Chemutil-2 SERAPHIM author's utility. PKIND is available through Project SERAPHIM.

4. 4. Levine.1. N.PhysicolChomislry, 2nd ed.; McCraw-Hill: New York, 1983;pp 226232. 5. Weast,R.C., Jr. Handbook ofPhysicsondChemirlry. 52nd ed.;ChemiealRubber Co.: Cleveland. OH. 1971. 6. Rbck, H.; schmder, W. 2.Phyaik Chrmie (Frankfurl) 1967,11,47. 7. Muthu.0.: Maher,P.J.:andSmith,B.D.J.Chrm.Eng. Dole 1980.25.166. 8. Moelwyn-Hughea,E. A. Physical Chamisfry: Pargamom: London, 1957:pp 568571. 9, Adsmson, A. W. A Tatbook of Physicol Chrmisrry, 3rd ed.: Academic: New York. 1986:pp 17-22. 10. Seeanygoodphysiealchemistrytextbookforaddifiomldiacussionoftheabovepoints. 11. Ma",M.: Meluer, J. W. J. Chem Educ. 1386,63,466. 12. Pauley, J. L.: Davis, E. H. J Chem. Edur. 1986.53.466. 13. Joehum,C.:Jochum,P.; Kovalski, B. R.Ano1. Chem. 1981,53,85. 1& Kalivas. J . H.Anal.Chom. 1986.58.989. 15. Otio, M.; Wegscheider, W. A n d Chim. Acro 1986,180,445. 16. Farranah,F.F.:Keplan,C.R.:Yu.P.Y.;Hong. J.:Gentry,J.W.Enuiron.Sei.Terhnol. 1386.19.121. 17. Stewart, G.W. lnfmducfion to Molrir Computations;Acsdemic: New Yark. 1973. 18. Nsylor. T. H.; Balntfy, J. L.;Burdick, D. S.: Cho, K. Computer Simulation Techn i q u m Wiley: New York, 1966: Chapter 4. 19. Sparrow, G. J. Chm.Educ. 1985,62,139-14L 20. Suder.R. J. Chom.Educ. I385,62,499-500. 21. Rosenb&g. R.M.;Hohba,E. V. J. ChemEduc. 1986.62.140-141. 22. Hayes. B. J. Sci. Am. 1983,249 (4). 22-36. 23. Levkov,J.S. J. Chem.Educ. 1987,64,31-33. 24. Mohrig,J.R.:Nienhul~,D.M.:Linek.C.F.:VanZoron.C.;For,B.G.;Mahaffy,P.G.J. Chrm Educ. l985.62.519-521. 25. Coe.0.R. J. Chem.Educ. 1987.64.496-497. 26. Pavia, D. L.: Lsmpman, G. M.; Krir, G. S., Jr. Infroduetian to Organic Loboratow Techniques. 2nd od.;Sauders: Philadelphia. 1982:pp 19C2W. 27. Start., R. 8087Applirotiom and Progrommingiar fha IBMPC, XT, and AT; Brsdy:

Figure 10. lsosbestic locater option of PKIND menu.

10) indicates whether the significant p H range has been bracketed. Determination of the wavelength of maximum absorbance for each indicator form is greatly aided, and isosbestic points are obvious. When multiple plots are made and curves overlap an intermittent sound (speaker click) notifies the student that plotting is occurring, though s h e may not see the current plot producing new or changing features on the monitor screen. A "beep" or bell sounds between and after plots. The zero absorbance is offset by one pixel to allow one to see acurve that lies on the axis. A sireen dump of HIRES page two can provide copies of spectra via a dot matrix print&. Auxiliary sections of PKIND available from a menu provide an overview of theoretical principles, detailed instructions, sample run, examples of calculations, and first-derivative plots. Other indicators may be added if an instructor wishes. The program should be useful in analytical or instrumental courses on undergraduate or graduate level. PKIND was programmed using Applesoft BASIC with DOS 3.3. The main file consists of 250 statements and re-

,o*s L""".

28. 29. 30. 31. 32. 33. 34 35. 36. 37.

Brumby,S. J.Chem.Educ. 1986,63,326. Fleiseher, F. B. J . Am. Chem. Sor. 1961,86,3889. Remette, R. W. J. Cham. Educ. 1963,40,252. Pesw,B. F. Boaielnnrumentol Analysis: Van Nosband: New York, 1980; Chspter 3. Willard. H.H.; Menit. L. L., Jr.: Deen, J. A ; and Settle, F. A,, Jr. Instrumantd Methods ofAnalysi8.6th ed.: Van Noatrand: New York, 1981: p 938. Sawyer, 0.T.; Heineman. W. R.: and Beebe,J. M. ChamisfryE%porim~ntsiorInatrumental ~ e f h o d swiley: ; NevYork. 1984:Chapter 6. Ewing, G. W. lnatrvm~nfolMethods of Chemical Anolyaia, 5th ed.; McCxaw-Hill: New York, 1965: Chapter 3. Day, R. A., Jr.; Uodewaod, A. L. Quontilalive Analysis, 5th ed.; Prentiee-Hall: Englealwd Cliffs, NJ, 1986: Chapter 22. Hand, C. W.; and Blewift, H. L. Acid-Base Chemistry: Msemillan: New York, 1986; Chapter 11 and Appendix V. Hefter. J.: and Zuehlke. R. W. "Comoutor Simulafion of Acid-Baae Indicator be ha^

Iterations II:Computing in the Journalof Chemical Education Iterations 11, a collection of 46 articles that appeared in the Computer Series between 1981 and 1986, has been carefully selected by the editors, Russell Batt and John W. Moore, to bring up to date the collection of computer applications that appeared in its predecessor volume Iterations. In addition to covering all aspects of instructional computing from introductory to graduate level, Iterations I1provides an annotated bibliography of all computer-related articles that have aooeared in the Journal from 1981 to 1986. 1981 oaoerback. 160 oo: .. . ~. . . . US. $15.00: foreien 516.00 post pa id^. Send preyad orders tt, Suhscripriun and Book Ordpr D e p n r r m m t , Juurnal o t Chemical E d u c n r i m . 20th and N o r t h a m p t o n Strcrti. E a i t m . PA IROI?. ~

~~

Volume 65

Number 9

September 1988

799