A simple three-dimensional perspective plotting program

The execution of this program on an IBM 370-165 computer required 54 Kilobytes of core and 5 sec of CPU time. The second example demonstratesthe ...
8 downloads 0 Views 581KB Size
A Simple Three-Dimensional Perspective Plotting Program Very many relationships and laws in chemistry are described by equations with two independent variables. I t is often difficult t o visualize the effect of changes in one variable, unless the other variahle is held constant. To circumvent this nroblem.~textbooks often make use.of several two-dimensional plots of Y(u,x) versus X, each with a different, hut ~~~~r ~ ~ fixed, value of u. In connection with'iome other research, we have written a program that creates a perspective plot of F(u,x) versus u and x. The FORTRAN IV program comprises 48 instructions, and makes use of the following IBM plotting subroutines: SCALE, AXIS, SYMBOL, NUMBER, LINE, and PLOT. The values of F ( u , x ) versus I a t constant u are generated by a subroutine, and the resulting line is plotted by the main program. u is then ineremented and the process repeated. The resultant plot gives the illusion of the surface described by the function. Each line may comprise up to 1000 points, and 36 lines are drawn. The plot size is 17" X 22", hut these dimensions can easily be halved for plotting on conventional paper. Two example plots are shown helow. The first describes the speed distribution of argon atoms as a function of absolute temperature. An 1Binstruction subroutine generates the data to be plotted from the Maxwell-Boltzmann distribution'

-

The of nrnernm on.en IBM 370-165cornouter reauired 54 Kilobvtes of core and 5 sec of CPU time . erematinn .... . this . ~ ~ "~ ~ The second examp.c drmonstmtes the continuous varlatim of an A H i; AB nmr spectrum as n function of the lifetime for exchange. The nmr spwtrnl rubmutinr conqiqts c l f SR instrurtions, and e m handle any tw,, spin t u o spin c x chnnge pnwezs. The spectral program required 5hK atld 39 CPL' sec. T h e plutting program can also I,+ 11srd ~ i t more h ~

~~~~

~~

~

-

soph&i&ted nmr programs such as LAOCOON 1112and DNMRR."

The plotting program has great verratility and can be used in a variety of situations where i t is desirable t o visualize the surface described by s function of two independent variables. Listings of both programs will be gladly sent upon request.

Roger S. Maeomber

University of Cincinnati Cincinnati, Ohio 45221

'

Eeeers. Jr.. D. F.. Greeoni. - - N. W.. Halsey, Jr., G. D., and Rahinoviteh, R. S., "Physical Chemistry", John Wiley and ~ o n s , k e wYork, 1964. 2 Cnatellnno. S.. and Bothner-Bv., A. A,.. Quantum Chemistrv. Proersm -~~ . - Exchanee. Deoartment of Chemistry, Indiana University, Bloomington, Indiana, 47401,Program No. 111. 3 Binseh, G., and Kleier, D. A., QCPE, Program No. 165. ~

~

~. .

.

Volume 53,Number 5. May 1976 / 279