equilihrium. There is a prohlem with this approach in that there are two solutions to the eauation. One will be correct and the other nonsense. By triai and error i t was found in this case that usina the neaative sign in the quadratic formula gives the correct result using this equifihrium constant and a variety of starting concentrations. This may not hold under all cases (for example, if K were less than bne) so on the grid are shown the a, b, and c values and the two possible solutions. By changing one location i t is possible to use the other solution. This is easy to do with VisiCalc. K is calculated from the resulting equilibrium concentrations to check that the solution is correct. In this case Kp = KC SO the starting and equilihrium amounts can he interpreted as either concentrations or partial pressures. What ahout the reaction for the production of ammonia and others that do not lead to a quadratic equation? This looked like a real challenge for VisiCalc since there is no explicit formula for rootsof fourth degree polynomials. A common approach to this type of problem is an iterative procedure such as the ~ e w t o n - ~ a p b s omethod. n The approach is based on the derivative of the function anduses the eauation X h e w ) = X(old) - flf' where X(old) is an initial guess or the last value of the'rbot, X(new) is the new improved value, f and P are the values of the nolvnomial and its derivative respecti;ely using X(old). ~nfdrtukatelyVisiCalc has no branching command to stop the iteration at a certain predetermined accuracy. In addition there is the always present problem of determining a first guess. Figure 4 shows the approach that was used. First a relatively large fixed number of iterations was used to ensure convergence. A starting value was chosen for X (amount of Nz reacting) that was reasonable assuming only reactants were nresent initiallv. The intermediate results of 19 iterationskere displayedand then the final X was used to calculate the final equilhrium concentrations. As a check, K was recalculated from these to compare with the original value. The old X, an intermediate value of the polynomial (the formula was too long to fit in one grid location), the polynomial value, its derivative, and the new X were displaved for ,each step. In this example convergence was compl&eh four steps. This was typical when other starting concentrations and K's were used. The time for the calculation to be done after a change in data was about 6 s on an Atari computer. Typically an Apple I1 or IBM PC will he significantly faster. A horizontal window can be set by VisiCalc so that the details of the iteration can he covered un and the startine and final concentrations can he together. The example uses a value of Kc so the concentrations should be interpreted as molarity. If the related Kp is used then the starting and final values are partial pressures. If the calculation is done for different total pressures (start with higher partial pressures for higher total pressure) the effect of the total pressure on the percent ammonia a t equilihrium can he determined. Change K to show the effect of different temperatures. The ahove results could be obtained with pencil, paper, and log tables, with a slide rule, with a calculator, or with a computer using a variety of languages. Does VisiCalc offer any advantages over these other methods? The time involved eliminates all these possibilities except for a computer using some high-level language. I have been programming in a variety of languages on many different computers for over 20 years and my conclusion, after a little experience with VisiCalc, is that for the types of uses described ahove VisiCalc is definitely much better. For example the time to work out the polynomial for the NH3equilihrium is the same no matter how the calculations are done. The comparison ends there. The ability to replicate formulas allows pages of results to flow across the screen using VisiCalc before you could finish typing in a BASIC program let alone debug it. Students have trouble seeing trends by just looking a t equations. The tables of results made possihle by VisiCalc
-
322
Journal of Chemical Education
Reaction: H2 + I2
K
=
atarc
--,2HI
50.5
at 448"
HI 2
12 1
HI 1
...........................X=+SQRT ....... .. X=-SORT a, b, c
46.5
-155.5
100 2.475250 ,8688057
X
,8688857
at e q u i l . 1.131194
,1311943 2.737611
--..-------.....---......----.....--
-
Figure 3. Equilibrium calcdation solving a quadratic equation far the reaction H,
+ I,
2HI.
Reaction:
+ N2 - - >
3HZ
K =
function a,b,c.d.e 1st d e r i " a.b.c,d
,105
2NB3
at 4 7 2 C
( x = N2 reacting)
2.835
-11.34
13.01
-11.34
11.34
-34.02
26.02
-11.34
2.835
Old r .I
.3007358 ,3510374 .3527188
,3527203 .3527203 .3527203 .3527203 .3527203 .3527203 ,3527203 ,3527203 ,3527203 ,3527203 ,3527203 ,3527203 ,3527203 .3527203 .3527203 -3527203
-...-----.....----.....-----..-.---at e q u i l . 1.911839 ,6472797 ,7054406
K =
.la50000
-
Figure 4. Equilibrium calcuktion solving a fwrlhdegee equatii fw reaction 3H2+ N* 2NH3.
the
make these trends much more obvious and in the long run will help students learn to see trends from the equations. The more actual results they see the quicker they will make that transition. Using VisiCalc to prepare visual aids and copies to he handed out to students should be extremely useful. Live demonstrations in class with enough monitors for all to see the results could be especially useful since then i t will he possible to answer the students' own "What if?" questions immediately after they ask them. If the program and your grid setup can he made available to the students they can experiment on their own.
VisiCalcTMin the General Chemistry Laboratory' Sam1 I. lbrahlm Evergreen Valley College San Jose. CA 95135 A useful appliration hat illustrates the power and rapahilityol'the electronic worksheet isdescril~edbelow. It usesa special VisiCalc file known as the Data Interchange Format
'
Presented at the 30th Northern CaliforniaComputer Conswtiwn Conference,Evergreen Valley College, San Jose, CA, April 1984.
Table 1. Instructor's Formatted Worksheet
-
(A)
(C)
(8)
Name Sample X DATA: Trial 1 Length of acid column in buret, mm Val of hydrogen. ml Temp of bath, C V. press of water Bar pressure, Torr CALCULATIONS Temp of bath. K 273.00 0.00 Acid column press 000 Press of dry H Tor VOI of dry H. ml 0.00 Wt of Mg in grams 0 Average w i of Mg Accepted Result Percent error
Table 2.
-
(A)
Name DATA:
(0)
(E)
Trial 2
Trial 1
273.00 000
0.00 0.00 0
Trlal 2
100
95
25.2 26.5 26.7
27.2 26.5 26.7
755
756
299.50 7.35 720.95
299.50 6.99 722.31
21.79 0.02364
0.02556
0
0.0251 100.00
23.56 0.0246 0.0251 1.99
Student's Data
(B)
(C)
Jackson
Sample # Trial 1
Lenglh of acld column In buret, mm Vol of hydrogen, ml Temp of bath, C V. press of water Bar pressure, Torr
(F)
-
(D) 36 Trial 2
84
80
41.2
45.4
25
24
23.8
22.4
759
759
Table 3. Computer-Generated Report
-
(A)
Name
(0)
(C)
(0)
Jackson
sample # Trial 1
Trial 2
DATA:
Length of acid column in buret, mm Val of hydrogen, ml Temp of bath, C V. press of water Bar pressure. Torr CALCULATIONS Temp of bath. K Acid column press Press of dry H Tor Vol of dry H. ml Wt of Mg in grams Average w i of Mg Accepted Result Percent error
84 41.2 25 23.8
36
Event-Drlven Data Acquisition: Using ADALAB with an Acculab Infrared Spectrometer
80
George C. Lisensky and Bryan A. Mehlhaff Beloit College Beloit. WI 5351 1
45.4 24
22.4
758
759
298
297 5.88
6.18
columns were calculated using VisiCalc functions and commands. The Droeram was then instructed to redicate the computationbo;tion of the lower part of columns E and F into the adiacent hlank ~ositionsof columns C and D. The zeros that appear in this part of the table result from the absence of figures in the data portion of columns C and D. This formatted sheet is for the "se of the instructor only and students are not allowed access to it. Table 2 is simply the datasection of Table 1. It is stored on a separate computer disk and is made available to students with blanks in columns C and D. Each student enters and saves his or her own data on this disk; sample data are shown on Table 3. Table 2 is stored in the Data Interchange Format (DIF). Table 3 is generated by instructing the program to transfer the student's data block onto the instructor's formatted worksheet (Table 1).Finally, the computer is instructed to print out the contents of Table 3. The advantages of the ahove program are manyfold. I t permits the thorough evaluation of alarge number of lahoratory reports within a short period of time. The program also enables both the teacher and the student to discover whether the source of error is due to poor data or due to computation errors. Our chemistry instructors have also found the program most helpful for assigning consistent grades. Our chemistry students were enthusiastic about using the comvuter. Our general chemistry students are, nt the present time, able to store a total of eight - addirional sets 01' data. They include percentage of copper in an ore, molecular weight of a volatile liquid, percentage of potassium chlorate in a mixture, molecular weight by the freezing-point depression, percentage of water in a hydrate, molar volume of a gas, normalitvof acid unknowns bv titration and redox determination of oxalic acid. For details concernine the formattine nrocedure and all of the VisiCalc commandsused, please &te to the above address.
729
730.7
36.2 ,03928
40.12 ,04353 ,0414 ,03859
-7.3
(DIF), which permits the user to transfer a full block of data from one file to another. The formulated worksheet permits the chemistry students to store experimental data and then enables the laboratory instructor to obtain a computer print out which contains the student's stored data as well as all calculated results and percent error. T o illustrate the use of DIF, I have chosen a simple general chemistry experiment: the indirect determination of magnesium. The unknown is first dissolved in dilute hydrochloric acid. The liberated hydrogen gas is collected, corrected to STP and then the weight of magnesium is calculated (3). Table 1 shows a formatted worksheet that is six columns wide. The last two columns, E and F, contain some typical laboratory data. The results in the lower section of these two
Interfacing mirroamputprs to srientifir instrumentation has berome relativrly straightfurward. For example, the rommonl\, used ADAIAB u~terface' for Aovle ~" .. wmvuters allows replacement of any chart recorder by the computer simply by connecting the appropriate voltage output from the instrument to the interface analog input pins. The independent variable is usually assumed to vary linearly with time and must then he calibrated using the known time required for an instrument scan. By contrast with such an approach we report here an example of data acquisition using event-driven timing. Many newer instruments have various digital signals available. For example, Figure 5 shows the external pin counections availahle on a Beckman Acculab 8 Infrared S ~ e c trometer (models 7-10 are similar). Connecting the appronriate Dins to the dieital innut and o u t. ~ unins .t of the ADA~ . A Rbkwd is not diyfintlt i n d allows for synshrunizution of the instrument .wan and data acuuisition. 1 I I h t a anluisition can be made to wait for theinstrument scan to Btart, eliminating the need to Dress a kev on the computer and the scan button on the spechometer it the same time. 2) Instrument scan can he continually monitored, causing data acqui~~
~~
ADALAB board from lnteractlve Mrcroware. Box 139. Slate College. PA 16804. ADALAB anoOUICKilOaretraoemarksof Interactive Microware.
Volume 63 Number 4
A~ril1986
323