Applying KC?DISCOVERER in the introductory chemistry laboratory

Bits and pieces, 44. KC?DISCOVERER contains a wide variety of physical and chemical properties of the elements. Keywords (Audience):. First-Year ...
0 downloads 0 Views 2MB Size
computer mrief. 115

edited by JAMES P. BIRK Arizona State Universily, Tempe. AZ 85281

Bits and Pieces, 44 Guidelines for Authors of Bits and Pieces appeared in July 1986; the number of Bits and Pieces manuscripts is expected to decrease in the future--see the July 1988 and March 1989 issues. Bits and Pieces authors who describe programs will make available listings andlor machine-readable iersions of their programs. Please read each description carefully to deter&e compatibility with your owncomputing environment before requesting materials from any of the authors. Several nroerams described in this article and marked as such are avazable from Project SERAPHIM a t $5 per 51/4-in.disk, $10 per 3lI2-in. disk; program listings and other written materials are available for $2 each; $2 domestic or $10 foreign nostaee and handling is reauired for each shinment. Make ;he& payable to ~;oject SERAPHIM. T o order, or get a Project SERAPHIM Catalogue, write to: John W. Moore, Director, Project SERAPHIM, Department of Chemistry, University of Wisconsin-Madison, 1101 University Avenue, Madison, WI 53706. (Project SERAPHIM is supported by NSF: Directorate for Science and Engineering Education.)

Dynamic Data Storage in FORTRAN Allce Chung-Phllllps Miami University Oxford, OH 45056 The purpose of this article is to promote the use of dynamic storage allocation in FORTRAN to chemistry instructors and students in the present computing environment. This programming technique (I) is not new but is worthy of reneated nublicitv because of its manv advantaees. consider a typical scientific pro$am that contains many arrays for the storage of data. Most arrays may be classified as dynamic arrays because the number of elements in the array varies from case t o case. In FORTRAN the maximum size of each array must be stated someplace in the program so that sufficient storage can be reserved for the computation. This generally presents no problem since the programmer can usually anticipate the largest case and set the sizes accordinelv. C&cumstances mav arise. however. when these "maxim;; sizes"must be altered. hi$ can be atedious task if the program was not initially designed for such changes. A useful strategy is to use variable DIMENSION statements for the dvnamic arravs in the subroutines: thesestatements will remain unchanged regardless of how the amount of data vary. In the MAIN routine the arrays are placed end to end to form a single storage block for which a fixed DIMENSION statement is issued. If the maximum size assigned to the block becomes obsolete, only one size in MAIN needs be changed. In the microcomputer environment, MAIN can be conveniently made into a separate file for compilation. When the size of the storage block is changed, only MAIN needs be re-compiled. This is a method of introducing dynamic data storage without the use of extra software. An effective way to demonstrate the algorithm is to show how a program with static data storage is converted to one 500

Journal of Chemlcal Education

with dynamic data storage. As an example, a test scoring program has been written both in the static form, TESCOR, and in its dynamic form, TESCOR-DYNAM (1, 2). The subject "test scoring" is chosen so as not to challenge the readers with the complexity of a scientific problem. The program, on the other hand, is constructed to exemplify programming techniques commonly found in more complex problems. For those interested in implementing dynamic data storaee. a learnine mide has been nrenared (2). The tutorial Gckage includes documentatio' files that 'give detailed instructions on the aleorithm. FORTRAN files for the 'l'ESCOR and TESCOR~DYNAMprograms, sample inputloutput files, and files for compilation and linking associated with this programming procedure. Acknowledgment he algorithm for dynamic data storage was initially developed by Robert W. Rosen. The author is deeply indebted to David B. Phillips for his invaluable assistance with the IBM PCIAT.

Applying KC?DISCOVERER in the Introductory Chemistry Laboratory Ronald P. Furrtenau and John R. Amend Montana State University Bozeman, MT 59717 We have been usine comouter interfacine with laboratorv experiments for the paat three years in our general chemistry laboratories ( 3 ) .Since thecomoutersarealreadv in the lahoratories, i t is easy to incorporate computer tutorials and other computer-assisted instruction to reinforce concepts being taught in both lecture and laboratory. One such computer program is KC?DISCOVERER, developed under Project SERAPHIM (4.5). KC?DISCOVERER is a particularly useful niece of software to incorporate into labs where IBM-compatible computers are available. KC?DISCOVERER contains a wide varietv of nhvsical and chemical orooerties of the elements. These properties can be displaye'd i i graphical and tabular form in wavs that are limited onlv bv the imaeination of the , beuscdin acomputstudent. ~ L u sKC?DISCOVERERE~~ er-eauio~edlaboratorv to comnare exnerimental results immediatefy with d o ~ u ~ e n t values. ed We have developed a chemical neriodicitv laboratow a t Montana State university that uses our computer lab interface system to obtain electrical conductivity data on elemental samples. This laboratory is based on alaboratory initially developed by Braydich a t the U.S. Air Force Academy (6). Students first obtain qualitative results using the lab interface system as a conductivity probe. They use the property of electrical conductivitv to eroun these elements on the periodic table. Then, s t i d e n t i colbpare their experimental results with values from KC?DISCOVERER. Since our computers are already in thelab to gather data, KC?DISCOVERER can be used immediately after the measurements

. ..

are completed. In addition, students then look at trends for different properties using KC?DISCOVERER and attempt to explain these trends using basic atomic theorv. The ma& objective of the lab is to observe periodicity in the trends of oro~ertiesof the elements. AS part of their laboratory report for the conductivity lah, students used KC?DISCOVEHER to examine four different periodic trends from a list we provided. The list included atomic radius, electronegativitv, first ionization enerev. oxidation numbers, and others. students used the GKPH, TABLE, and FIND options of the KC?DISCOVERER Drogram to look a t these-trends. In their report, students were asked to give a definition of the property they examined, give a brief description of the trend they observed, and give an explanation why the trends behave in the manner illustrated bv KC?DISCOVERER. Thev were allowed to use anv source i f information, including "KC?DISCOVERER, help them with their report. We also gave them an example of what their "trend reports" should look like. I t came as no surprise to us that explaining the whv of the trends would be the-most difficult (but most meanhgful) aspects of these reports for the students! Their explanation often required them todig into their lecture-course textbooks or some other source as a reference, thus reinforcing these lecture concepts. Because of the ease of use and variety of options in KC?DISCOVERER, many students spent extra time exploring properties and trends that wereinteresting to them. We believe that a threefold approach of (1)making measurements in the lab and observing periodicity after assembling these measurements, (2) seeing them with the graphics capability of KC?DISCOVERER, and (3) explaining the trends in a formal report is an excellent means of "packaging" the concept of periodic trends into a laboratory. Programs such as KC?DISCOVERER offer many untapped opportunities t o integrate good computer software into computer-based laboratories. ~

~

~

The equation for the hydrogen ion concentration in a mixture of monoprotic acids and bases is (7)

~

(1)

where the contribution from strong acids and bases is o = x[strong bases] - x[strong acids], Kbi is the dissociation constant of the ith weak base, Pi is the original concentration of the ith weak base, K,,, is the dissociation constant of the jth weak acid, aj is the original concentration of the jth weak acid, and K, is the dissociation constant for water. If we apply the definitions z = -In [H+],w = -In K,, bi = -In Kb,, and a, = -In K., eq 1can then be written as:

tb

The pH of Any Mixture of Monoprotic Acids and Bases D. P. Herman, K. K. Booth, 0. J. Parker, and G. L. Breneman

Eastern Washington University Cheney. WA 99004 The pH of any mixture of monoprotic weak and strong acids and bases can he calculated. A curve can also be plotted for the titration of the mixture by any monoprotic weak or strong acid or base. The required input is the stoichiometric concentrations of the acids and bases in the mixture before equilibrium, the dissociation constants for the weak acids and bases, and the volumes involved in the titration. The method applies t o a wide variety of mixtures including polyprotic materials with independent dissociation constants (not stepwise dependent) such as amino acids and polypeptides. Theory An innovative technique derived bv Rang (7) is used to solve the equations for given the v&mesand concentrations. The usual equilibrium, mass balance, and charge balance equations are rewritten in terms of hyperbolic trigonometric functions allowing a better behaved iterative solution than using the usual Newton-Raphson iteration on a polynomial in H+ concentration. For example, the program earlier described (8)for the titration of anv sinele ~olvoroticacid or base with stepwise dissociation c&&n& bGeaks down regularly if the number of equilibrium constants goes above eight. The method described here has no such limit on the number of acids and bases in the mixture.

where

and

Equation 4 is a corrected version of the one in the original reference (7). Letting X = z - w/2, eq 2 can be rearranged to give:

This equation allows an iterative solution to be obtained for X and thus [H+] using

where X,+I is the new value calculated from X,, the old or pH = 7). value. The initial value of X is zero ([Hf] = The iteration is continued until

The cut-off value of 10-6 in eq 7 is a compromise between speed of convergence and accuracy. I t results in pH values accurate to two places past the decimal point. Dlscusslon Figure 1shows an example of the program input and the titration curve of a mixture of two acids (one weak and one strong acid titrated with a strong base). The equilibrium constints can he input as K's or PK's. A strong aiid can be input a s a weak acid witha very large K (e.g., K = IW'or pK = -5) or in the separate stnmg arid category. The concentrations input are those in the fmal mixture beforeequilibri. urn has been established. The titration of a sinele u.eok acidby a weak base is another good example to runshowing that the break in DH at the end point mav not be verv sharn unless strong acids or bases are used foititrations instead df weak ones. There is no limit on the t w e of mixture beine titrated or what is used as titrant fromamong the choices 2 weak or strong acid or base, since if n acids and hases are being titratedihe pH during the titration is calculated for a mixture of n 1components with concentrations adiusted for the amount of titrant added.

+

Volume 67 Number 6 June 1990

501