The use of analog computers for teaching chemistry - ACS Publications

Examines the mathematical operations of basic electrical components, the method of programming an analog computer, and using an analog computer to sol...
2 downloads 0 Views 5MB Size
Frederick D. Tabbutt Reed

College

Portland, Oregon 97202

The Use of Analog Computers for Teaching Chemistry

For many years engineers have used analog computers to solve difficult differential equations which bear a striking similarity to those of interest to the chemist. For example, when an aeronautical engineer determines the eigenvalues for wing vibration he is doing virtually the same thing that a chemist would like to do on systems which, though perhaps less practical, are nonetheless important in their own right. The experience of solving some chemical problems on a small, relatively inexpensive analog computer will convince one of two things: first, the analog computer can be of considerable use to a chemist and, second, it has tremendous potential as an aid in teaching the mathematics of physical chemistry. It is to the latter use that this paper is directed although obviously the two points are inseparable. Three aspects of analog computing will be covered. The mathematical operations of some of the basic components will be described. The method of programming an analog computer will be outlined and, finally, some demonstration problems of chemical interest will be considered in detail.

which perform these mathematical operations may be found in any of the references cited under (1). Programming the Analog Computer

Since the computer is particularly suited for the solution of differential equations the discussion of programming will be centered on this type of problem. The most commonly used method of programming is called the bootstrap method and it will be demonstrated with a particular problem. The solution of the firsborder rate eqn. (1) will be demonstrated. -dz/dl

=

kz

(1)

The highest derivative in the equation is set on one

Analog Computer

As the name implies the analog computer is composed of components which are capable of performing mathematical operations on electrical signals. To use it, the machine voltages are set by the user to represent certain physical or chemical properties. The computer then functions as an electrical analog of the particular system it has been set up to describe. The solutions to the problem are read out as voltages which are converted by the user back into the appropriate units the output was meant to represent. Five basic components are required for the problems to be described in this paper. The symbols which represent them and the functions they perform are outlined in Figure 1. Descriptions of the circuits

Figure 1.

64

/

4 coefficient mteniiometer Common components in onalog computation.

Journal of Chemicol Education

Figure 2.

Anolog program for

dx

- - = kx. dt

side of the equation by itself. Equation (1) is already in that form. It is then presumed that this derivative can be obtained somehow and it is set as an input into a series of integrators until the term on the right-hand side of (1) is obtained and the loop is then closed back to the original derivative. The program is shown in Figure 2. Starting a t a we assume we have -dx/dt. Upon passing through integrator 1 we arrive at b with an integrated and inverted signal x. Coefficient potentiometer 1 applies a multiplicative constant, k, so that a t c we have kx. Since icz = -dx/dt, the loop can be closed to a and the equation can be solved. All that remains to be done is to set the boundary conditions on the integration. This is called the initial condition (IC) and is shown in the program diagram of Figure 2 connected to the integrator. Thus, if we set potentiometer 2 to 1.000 (its maximum value) x will be set at the inverse of the reference voltage when t = 0. The initiation of the solution proceeds in the following manner. I n aRESET position all voltages are grounded except for the initial conditions which are set. Then advancing to a HOLD position the reference voltages are disconnected and the initial conditions are suitably stored. Finally, upon switching to OPERATE the solution of the differential equation commences and the

magnitude of the voltages in the circuit change in a manner exactly analagous to concentrations in a first order reaction. To determine how x varies with time one simply connects an oscilloscope or X-Y recorder to b in the circuit. The translation of machine variables to prohlem variables is quite straightforward. If the initial concentration is to he in units of moles per liter one simply determines the factor in moles liter-' volts-' which when multiplied by the machine readout in volts yields concentration. If the initial concentration of x is 1.23 X lo6 moles/liter and IC was set a t +10.00 v then the factor would be 1.23 X lo-' moles liter-' volt-', to convert the readout from b to concentration. This is superior to setting the IC to 1.23 X 10" v since the computer handles larger voltages more accurately. Since the integrator integrates on a per second time basis the input into integrator 1 is in machine units of volts sec-'. Consequently, coefficient potentiometer 1

,

Fig.. 3. Analog p g r m m generating time bare.

h

has an effective machine dimension of sec-'. Now suppose we had wanted to set k to a problem value of 1000 years-'. That would mean that if we set pntentiometer 1 to 1.00 then to convert from machine variable to problem variable we multiply by 1.00 X 10S years/sec. Or in the other words, each second of machine time corresponds to 1000 years of problem time. Whether displayed on an oscilloscope or an X-Y recorder a time base on the x axis is required. To produce a voltage which increases linearly with time one simply integrates a constant as shown in Figure 3. The setting of the coefficient potentiometer determines the rate at which the voltage increases. Thus, if 1 is set a t 0.100, then the output will increase at 1 v sec-l. Some of the appealing points of analog computers are the speed with which a plot of a function can be obtained and the ease with which the parameters can be varied and the effect on the function determined. Figure 4 is a tracing of the solutions of eqn. (1) for various settings of potentiometer 1, the rate constant. The adjustment of potentiometer 1 and subsequent recordings all required about 5 mins. About 2 mins. were required to set the program up on the computer.

Time

Figure 4.

of k.

Analog soiutionr to Rrst order rate of decay for various valves

Figure 5.

Anolog program for Michoeiis-Menton mechonirm.

This brief introduction should enable those who are unfamiliar with analog computers to understand the programs that follow in this paper. More thorough explanations of programming may be found in references (la, b, and e). Illustmtive Problems

The Michaelis-Menten enzyme reaction mechanism

can be solved using two differential equations

ddlm

=

kl [ES]

(2)

and two conservation of mass equations. [Sol = IS1 [PI [ESI (4) [Eol = 1ESl [El (5 The analog program for the Michaelis-Menten reaction is shown in Figure 5. The solution is carried out in the following manner. Integrator 2 produces [PI which by eqn. (4) is [So] - [S] - [ES]. Subtraction of [S] and [So]by summers 3 and 4 yields - [ES] and the loop for (d[P]/dt) is closed through potentiometer 6 (kz). Conservation eqn. (5) and summer 7 enable -[El to he generated which after multiplication and summation produces two rates that can loop back for (-d[S]/dt) and the solution is complete. For convenience the outputs of amplifiers 4 and 7 can be inverted so that positive concentrations will be recorded. Note that the steady-state approximation was not used. I n general whenever the number of conservation equations are equal to or greater than the number of intermediates the approximation is unnecessary. I n fact since [ES] can be read out one can determine if the steady state approximation is satisfied. The analog simulation of the Michaelis-Menten mechanism is shown in Figure 6 where the effect of changing k,, k-,, and k2 is demonstrated. Except for the beginning the rate of change of [ES] is small compared to the rates of [PI and [S]. It is apparent that the amount of enzyme hound as complex is quite sensitive to kl, Ll, and kt. Another exercise related to this is to determine the parameters necessary to exactly simulate experimental studies of these systems

+ + +

(9).

This problem can be used to point out two more Volume 44, Number 2, February 1967

/

65

a b c Figuro 6. Analog rimdotion of Michaelis-Menton mechanism. Time axis is identical for each Rgure. The [El, [ES] concentration oxis i s 2 X the [S]. [PI oris.

m k

0.200 LI 0.050 k* 1.000

b 1.000 0.050 0.200

5

1.000 0.000 1.000

(so]-

- 5 for all cases

features of analog computation. First the computer does not give the mathematical form of the equations which represent the solution to these differential equations. It simply plots out the results for the electrical analog. Secondly the computer is solving for the concentrations of S, P, ES, and E sirnullanemsly. Figure 6 was obtained with an X-Y plotter. Each species was recorded in turn by performing a run and taking the output from an appropriate amplifier. Using an oscilloscope with four inputs the concentration of all four species could be displayed simultaneously and the effect on each of changing parameters could be observed instantly. There are a variety of other kinetic problems which can be examined (3). Examples which the author has studied are:

Applications to Quantum Mechanical Problems

One of the most diicult things for a student to appreciate in quantum mechanics is the solution of the wave equation. Unless he has had a stronger than average preparation in mathematics he must accept to a considerable extent on faith that only certain eigenvalues are consistent with the equation and that wave functions other than those given to him as solutions will diverge rather sharply. The analog computer can he used t o demonstrate this quite clearly as well as other facets of the mathematics of quantum mechanics. The solution of the wave equation for two potential energy functions will be demonstrated-a parabolic well and a square well.' Hormonic Oscillofor

The general expression for the one dimensional wave equation is Since s function generator can be purchased as an accessory to the components already mentioned, virtudly any potential function could be generated. The problem described here, however, do not require this accessory.

66 / Journal o f Chemical Education

Figure 7.

Analog program for quantum harmonic orrillator.

A simplified form of this for the harmonic oscillator is

where A = 8r%W/hP and ar = 4r%vo/h.

The analog program for this is shown in Figure 7, and proceeds as follows. Starting with d2$/dxZ we integrate until $is obtained. Note that x, the problem variable, is time in the machine variable. By closing the loop through potentiometer 9 which is X we would have the wave function and energy for a free particle, were it not for the potential energy contribution which also comes into summer 10. I n fact, the wave function can be examined with and without potential energy by connecting the Y axis t o the output integrator 8 and running i t with and without the jack carrying -a2x2$/10plugged in. The production of the parabolic well may seem strange a t first, but i t represents the flexibility that one has in translating machine variables. It has already been mentioned that the machine variahle of time was to represent distance, x. As mentioned earlier, this can be generated by integrating a constant producing, at. Now if we integrate this again we will obtain at2/2 which is proportional to x2. Therefore, if we drive the z axis with the output of integrator 1, that will be our problem variable x and plug the Y axis into the output of integrator 2, half of the potential well will he plotted. I n fact, by setting a negative IC on integrator 2 the whole parabola will be generated (within the voltage limits of the computer). The author has plotted this on graph paper by hand, then after lining up the axes, plotted it with the computer. The agreement is excellent. The generated x 2 is multiplied by a2with coefficient potentiometer 7, and this function then multiplied by $. The loop including potential energy is closed by connecting this to the summer 10. For reasons which will become apparent later, x = 0 shall he chosen for an initial condition. The setting of potentiometer 9 is related t o the total energy, W, and a specific wave will be associated with it. Potentiometer 7 will be set a t 1.000 and not changed. If a comparison with a heavier oscillator (same force constant) is t o be made it will be decreased. An initial condition of +l will be arbitrarily set on $. Looking

ahead i t will be found that waves for every other eigenvalue will be missing; however, if we return and set IC = +1 for d$/dx, the gaps will be filled in. The value of IC has no effect on the eigenvalue. Note that unless an initial condition is set on an integrator it is automatically zero. Starting with X = 0 and increasing by equal increments one obtains the waves shown in Figure 8. It can be seen that as x increases the amplitude of the wave suddenly becomes very large. Note also that for some intervals the direction of the expanding amplitude changes. Presumably then an eigenvalue exists somewhere in this interval where the wave will act in a well behaved fashion and not become (infinitely) large. Figure 9 shows these eigenvalues determined more exactly.

If, as is the convention, we identify a quantum number to be the total number of nodes that the wave has and plot this as a function of the settings on potentiometer 9 which correspond to the eigenvalue, Figure 11 is obtained. It bears the relationship which one would expect for quantized harmonic oscillator even down to the zero point energy.

Figure 10.

-.

Waver for harmonic oscillator near eigenvalue, v = 7.

It can be seen that the amplitude of the wave increases as it moves from x = 0 to the classical limit. This is more noticeable for the upper states. If $ were squared (which could easily be done with another multiplier) the eff ect would be even more noticeable. Again, the time required to get the results is short. About 10 min would be needed to set up the entire program on the computer and about 5 min would be required to plot the number of curves in Figure 10. Parficle in One Dimensional Box

Figure 8. JI for harmonic oscil1.tm genaroted ot con.tont energy increments.

The similarity of this problem and the previous one is pointed out by their similar programs. The program for the square well potential is shown in Figure 12. Equation (6) is simplified to Figure 9. 11. for harmonic orcillotor in vicinity of eigenvolucs.

The detail of one of these, v = 7, shown in Figure 10 is illuminating. The potentiometer was advanced 2 divisions between the plotting of each wave. Note how the wave moves slowly until X nears the eigenvalue. I n this region the tail of the wave quickly swings to the other side and then slows down again. Dialing the exact eigenvalue turned out to be impossible. For example, the last curve to swing upward in Figure 10 had a X setting of 356 and the first one to swing down was 357. The potentiometer cannot be set reproducibly to any finer setting than that. One concludes from this, then, the 356 < X < 357. The classical limit is marked in Figures 9 and 10. It is apparent that in the vicinity of the eigenvalue the wave does not vary much within the classical limit.

Figure 1 1 .

A versus v for the harmonic orcillotor.

Volume 44, Number 2, February 1967

/

67

13. For values of potentiometer 5 greater than 1.000 no discontinuity in fi was encountered when the potential energy was applied but rather a decrease in frequency occurred. Upon reflection it became apparent that the total energy of the particle now exceeded the 10 v potential well. The fact that there was no flying to infinity of the wave indicated that it was still a free particle. Further reflection showed that the decrease in frequency was just what would he expected because the frequency of the wave is representative of kinetic energy not total energy. In the region of zero potential energy the total energy and kinetic energy are equal;

10" Figure 12.

Analog progrom for the solution of the particle in o box.

where K = h2/8&n and W is the total energy. The free particle loop through integrators 7 and 8 is unchanged. The square well was generated in the following manner. Two verticle lines were marked on the chart paper exactly 5 in. apart. This distance was to represent the half-width of the well with x = 0 a t the start and the second line the classical limit. The switch was set to OPERATE mithno input to multiplier, i.e., U(x) = 0. As the pen passed the second line a microswitch was depressed which supplied a voltage of 10 v. Conlputer sophisticates may shudder a t this method of applying a step function and understandably so. All that can be said in its defense is that the waves pro- g .3duced are remarkably reproducible. Using methods similar to those mentioned for the harmonic oscillator potentiometer 5 is varied and eigenvalues obtained. One experiences the same instability of the wave near the eigenvalue. The waves for .532 the first 5 energy levels are shown in Figure 13. If one defincs the quantum number as the total number of nodes plus one and plots the square of this as a function of potentiometer 5 readings for the .280 eigenvalues, Figure 14 is obtained. Note that since the height of the barrier is not infinite there is considerable penetration of the u-ave function beyond the classi- .I 28J cal limit. The author came upon an interesting phenomenon rather unexuectedlv when he attempted td reach .. higher energy levels than F g w e !3. Waver for the particle on a flnste box in the vicinity of the those represented in Figure .ige...~.., .

-

K'. . &

.

. . . . . . (s . 80

. . . *e. . . .

.

. 11

I nodas + t12

Figure 14.

Rervltr of particle in a tlnite box.

however, in passing over the potential barrier the kinetic energy is depleted by the height of the barrier. Therefore the frequency decreases. To verify this, three lines, each 5 inches apart, were drawn. The interval between the second and third line was the potential harrier, up to the first and beyond the third no voltage was applied to the input of U ( x ) . Potentiometer 5 was then set a t values corresponding to a little less than, equal to, and a little greater than, and much

7

'p

68

/

Journol o f Chemicol Education

I Figure 15.

I

I

Wovesfor o particle parsing over a potential barrier.

i

greater than the 10-v harrier. The results are shown in Figure 15. The wave function for values a little less than and equal to the barrier become discontinuous but relatively slowly. As one might expect, the effect on the frequency is greatest the closer the potential barrier is to the total energy. When the total energy is sufficientlyhigh the effectis barely noticeable. The Analog Computer as a Teaching Aid

The swiftness of readout would recommend the analog computer as a teaching aid in a number of ways. Two that come to mind are lecture and laboratory. A lecturer could illustrate complex mathematical solutions to problems he is covering. The author has been using an X-Y recorder which records on a 12 X 18 in. sheet of paper. This is ample size for viewing by a class as large as 100. An analog computer capable of solving these problems is quite portable and is easily wheeled around. A more exciting use would be to make it part of a laboratory experiment where students would use it. With some instruments it is possible to do this without students being required to know anything about programming. Programming an analog computer consists of making connections with patch cords between appropriate banana plug receptors which are in turn internally connected to amplifiers and potentiometers. I n some instruments these connections are made on a board (called a patch panel) which can be quickly detached. An unprogrammed or differently programmed patch panel can then be inserted in its place. This interchange requires about a minute. Since these patch panels are not very expensive one could have one panel programmed for a particular problem, labeled as such, and stored in a drawer. As a laboratory experiment, a student could then be told to determine the eigenvalues for the particle in the box. He would then put that patch panel in the computer. Attached to the panel would be an identification of which coefficient potentiometer was performing what role in the problem. Analog computers can be rugged, safe, and studentproof. The computer used by the author was completely transistorized and had been bouncing around in the back of a station wagon over a good part of the Pacific Northwest. Transistorized computers use maximum voltages of 15 v which is quite safe in case a lead is touched. Moreover, it was impossible by any combination of connections on the patch panel to damage the instrument. Computer Needs and Costs

Analog computer costs vary depending on how many amplifiers, coefficient potentiometers, and other accessories one wants. All of the problems described 'Edilor's note: See, also, CORRIN, 11.L., THIS JO~IRNAL, 43, 579 (1966).

in this paper were performed with a computer which had 14 amplifiers, 14 potentiometers, 4 integrators, and 1 multiplier. If one had anonother multiplier, another integrator, and about two more amplifiers a number of other interesting problems could be solved. Of course, if one wants to be rather sophisticated there are a number of other accessories as well. One can purchase specific function generators for X2, v%, eZ, sin x, and log x, as well as variable function generators which can be set by the user. There are also comparators which enable step functions to be generated. Readout requires either an X-Y recorder or an oscilloscope. Most computers have a quickly repeating mode of output as well as a slow readout. I n the fast mode the oscilloscope is particularly useful for quickly dialing eigenvalues. The prices are relatively low by digital computer standards. They range from $2000 to $10,000 for the order of magnitude of accessories mentioned. The computer which was used for the problems described in this paper cost $5000. It had a stated O.O1yo accuracy. The X-Y recorder cost $1800. The total cost then represents a little more than 2 months rental for an IBM 1620. The cost comparison with the 1620 is not meant to imply that digital computers are overpriced. Digital computers can perform many functions better than an analog computer. Rather, the purpose of this paper is to call attention to a relatively inexpensive device whose potential has been overlooked by many chernist~.~ Literature Cited (1) ( a ) ASHLEY,J. R., "Introduction to Analog Computation," John Wiley & Sons, Inc., New York, 1963. ( b ) JACKSON, A. S., "Analog Computation,'' MeGraw-Hill C. Book Co., Inc., New York, 1960. ( e ) JOHNSON, L., "Analog Computer Techniques," McGraw-Hill Book Co., Inc., New York, 1956. A. P., LANDEE,R. W., DAVIS,D. C., AND ALBRECHT, "Electronic Designers' Handhook," MeGraw-Hill Book Co., Inc.; New York, 1957; Section 19, 22.2 and 22.3. REILLEY, C. N., J. CEEM.EDUC.,39, A853, A933 (1962). G., "A Practical A p STRONG, J. D. AND HANNAVER, proach to Analog Compoters," Instruments & Cm~trol Swtems, 35, 60 (August 1962). "Handbook of Analog Computation," EAI, West Long Branch, N . J., 1966. "Introduction to Analog Computers" is an excellent film produced by Argonne National Laboratory and dmtributed by the AEC. It is in three 50 minute parts which deal with the components of an malolog computer, programming and some specific problems. I t has a catalog number ANL-hIP-730-25 and may be obtained on loan by writing to: Andio-Visusl Branch, Division of Publie Information, U. S. Atomio Energy Commission, Washington, D. C. 20,545. -....

(2) CHANCE, B., GREENSKIN, D . C., HIGGINS,J. .AND YANG, C. C., "The Mechanism of Enzyme Action. 11. Electrical Analog Computer Strtdies,' Arch. Bioehern. and Biophys., 37,322 (1952). (3) OSBTJRN, J. O., J. GEM. EDUC.38,492 (1961).

Volume 44, Number 2, February 1967

/

69