Automatic Computer Program for Reduction of Routine Emission

Automatic Computer Program for Reduction of Routine Emission Spectrographic Data. F. W. Anderson, and J. H. Moser. Anal. Chem. , 1958, 30 (5), pp 879â...
0 downloads 0 Views 415KB Size
ticular type of sample to be calculated properly. Immediately thereafter, the peakheight input cards are read. As each is read, it is niultiplied by its attenuation factor, corrected for backgrountl, ant1 storcd in tn-o appropriate locat’ions, one for calculation and t h e other for readout. Data cards may be in any order within a given saiiiplc deck. \Then the Header of the nest sample is sensed as the nest card to he read, c:tlculation of the composition of the sample begins. The calculation begins with the summing of the appropriate products of invcree clemcrits by peak heights t’o oht’ain the partial pressurc of the first c~~mpoiicnt to lie calculated, zls. If x18 is positive, all peaks are diniinished liy tht. terms x38a,.18 to yield P’%. .cli is calculntecl in the same way’ cxccpt that the P’,’s are used in place of the Pi’s and onlj- I I - 1 ternis are required. -411 pPaks are then corrected for T17 if positive. If any corrected pcak beconies negative, it is set equal to zero for further calculation. This process is caont,inucd until all the 5‘s have heen calculated. Sormalixation of the partial pressure yields mole or gas volume per cents. If w i g h t a d liquid volume per cents are required, the appropriate inolccular weight and molecular volume arc applied, follo\\-ed again by normalization. .It the same time residual peak heights are availnhlc for all peaks used in the calculation as 11-ell as for threci cherk 1)eaks. These residual peak h(,ight?,

~~

Table II. Standard Deviations of Test Analyses b y Square Inverse and b y Triangular Inverse

Component Isopentane Isobutane n-Pentane Sitrogen Butenes Pentenes Propene n-Hexane n-Butane Air Carbon monoxide Propane Ethane

Ethene Hydrogen Hesenes Met hane Carbon dioxide -1verage

Standard Ileviation Square Triangular inverse inverse 1.25 1.16 0 84 0.76 0 . 2 0 65 0 58 0 46 0 46 0.31 0.24 (1.22 0 is 0 lti 0 15 0.12 0.1“ 0.04 0.50

1.04 0 95 0.88 0.23 0.42 0 33 0 41 0 -17 0 42 0.29 0.26 0.21 0 18 0 10 0 12 0.12 0.08 0 05 0,4i

nliicli may be positive or negative, are available in determining the validity of the separate percentages and in identifying the reasons for poor analyses. The r e d u a l peak heights may he calculated and punched out by using either the square inverse or tlie triangular inver-e method. These values arc very useful in spotting erroneous aiialy.es, and often in detecting a d corrwtirig a n crroneous peak. But RS red u a l peak heights must be calculated us a n additional operation after determination of partial preisures 11 hen :I q u a r e inverse is u w l , niuch of tlie

potential speed advantage is lost. No additional time i b required to obtain residual peaks I\ hen the triangular inverse is used. At this point, all the desiicd figures being available, a data card is punched for each component. Each data card contains identification, three kinds of percrntagw, aiitl a comparison of residual peak height n ith the original peak height of the coniponciit’s principal peak. -4 totals card is punched for each saiiiple. The G50 then proceeds to the nest sample. Each sample ir calculated in the proper iiianner until the “Read-Feed” is enipty. Cntire time to calculate 21 conipoiients and three additional check peaks is 50 sccondq. ACKNOWLEDGMENT

The subbt:iiiti:il coriti ibution. iiiadc hy Grace 11. Grant and George W. C‘leary in applying this method to niabb spectrometer calculation^ are gratefully acknon ledgcd by the authors. LITERATURE CITED

(1) Dudenbostcl, B.

Jr.,

.hAL.

F.,Jr., l’riestleJ-j W., CHEJI.

1275-8

26,

(1954).

(2) McTeer, 11. I,., l l o r g a n , G . S., Jr.,

Union Carbide Chemic:& Co., unpuhlished report. ( 3 ) Satl. Bur. Standards, “Contributions to the Solution of Syytems of Linear Equations and t h e Lktermination of Eigenvalues,” .4ppl. ?\lath. Series 39, pp. 12-14.

RECEIVED for review December 14, 1957. Accepted March ti, 1958.

Automatic Computer Program for the Reduction of Routine Emission Spectrographic Data FRANK W. ANDERSON and JAMES H. MOSER Martinez Research laboratory, Shell Oil Co., Martinez, Calif. T ,o relieve the burden of manual computation, a general-purpose, medium speed, digital computer program has been prepared for the conversion of emission spectrographic film line transmittances to element concentrations. Estimates of the precision of each analysis are also computed, the kind of estimate being dependent on whether the input data are from a semiquantitative or a quantitative analytical procedure. The program also detects and signals the occurrence of certain types of errors in input and rejects such data without stopping the computer. Both speed and reliability of spectrographic calculations have been improved b y this program.

for an I B l I Type G50 computer with 2000 ten-digit words of memory is in use for conversion of emission spectrographic film line transmittances to element concentrations in samples. Such conversions have been performed previously by use of graphical methods or a “calculating board’’ (a special-purpose slide rulc). Harvey ( 1 ) has discussed thcse methods and has given instructions for the preparation of the graphs and the acales for use with the calculating board. The present digital computer program follows the principles of the mechanical method of calculation t o perform the desired data transformations. PROGRAM

PRINCIPLES OF CALCULATION

Given the “ganinia” curve of the film relating per cent transmittance of a n image to relative intensity (Figure I), the transiiiittance of the line of the element in question. T E , and that of the internal standard, TR,are converted to the relative intensities, RE and RR, respectively. The relative intensity ratio I = KE/RR

is computed. Referring to Figure 2, the relative intensity ratio is then converted to the estimated concentration of the element in the sparked sample. Finally, the average coacenVOL. 30, NO. 5,

M A Y 1958

a

879

tration is calculated from the replicate sparkings. AUTOMATIC COMPUTER PROCEDURE

Calculation of Relative Intensity Ratios. Referring to the description of required data shown in Table I, each pair of transmittances is converted to a relative intensity ratio by means of Equation 1 or Equation 2 as applicable, and then by Equation 3. 1nR = B o + BI in T for 3.0% 4 T 4 Q

+

(1)

Table 1. Input Data (On One Card) Sample number 7 digits Dilution factor 3 digits Identification Analytical method 1alphabetic character 1or 2 alphabetic Chemical symbol of element characters Line designation 1alphabetic character Transmittances (1to 6 pairs) Per cent transmittance of element line as XX.X Per cent transmittance of internal standard line as XX.X h o t background corrected)

+

In R = Do D1In T Dz(In 2‘)s for Q < T 4 80.0% (2) 1nI

=

1nRE

- hRR

(3)

where B’s and D’s are constants and Q is the point of the gamma curve defined by both Equation l and Equation 2-i.e., the intersection of the straightline and quadratic portions. These equations have been found t o fit the gamma curve of the system precisely for the segments shown. If T is greater than SO.O%, the relative intensity ratio is not computed, because the slope of the actual curve is so low in that region as to make further computations not worth while because of the experimental error. If T is less than 3.0%, the data pair is also rejected, because the line is too intense for accurate transmittance determination. If a pair of data contains a transmittance above 80 or below 3%, an error card is punched containing diagnostic information, that data pair is disregarded, and the computer goes on to the next pair. At the end of this first process, a relative intensity ratio exists in storage for each valid input transmittance pair. Calculation of Concentrations. Each relative intensity ratio is converted t o a concentration estimate C (in the sparked sample), by means of Equation 4,and the average concentration is computed.

+ A I In I + A? (In I)* +

C = exp [Ao

AS (In Zl81 (4)

I n this equation, the A’s are coefficients obtained by means of a table lookup operation using the input identification as the argument. In the table lookup operation, if the coefficients for Equation 4 corresponding exactly to the identification cannot be found, an error card is punched containing the pertinent diagnostic information and the computer goes on to the next set of data. Error Estimation. If the analytical method identification refers to a semiquantitative procedure, the estimated standard deviation of the concentration is computed. 880

ANALYTICAL CHEMISTRY

In

Figure 2.

C-

Calibration curve

If a quantitative method is indicated, an error estimate is computed in the following manner: The mean concentration, C, is substituted in Equation 5. I’

=

exp [Go

+ G, In + G2(In Ga (In

where I’ = 7

I

c)2

+ (5)

+ ts

= mean relative intensity ra-

tio observed (during calibration) for a known element concentration t = Student’s t a t P significance level s = standard deviation of I’s for calibration data a t a given concentration G’s = constants derived by the method of least squares during the calibration process, and are stored in tables as are the A’s of Equation 4 The value

ings, is calculated. I” is then substituted in Equation 4, which results in C’. Thus, C’ is an estimate of the upper terminus of a P confidence interval. The error estimate actually punched is E = C’

The final step of the process is to multiply C and E by the dilution factor to obtain the results in terms of the original sample. The output results are presented in Table 11. PREPARATION

OF CALIBRATION PARAMETERS

The coefficients, A’s, of Equation 4 are derived from calibration data by a special computer program employing the technique of multiple regression. Although it would have been more correct statistically to make the relative intensity ratio the dependent variable in Equation 4, this would have necessitated programming the solution of cubic equations, which involves programming the selection of the correct root. As storage space in the computer was a t a premium, because of the desirability of making the procedure a one-pass operation, concentration was made the dependent variable for curve fitting. This method resulted in satisfactoryfitting of the calibration data. The same program is used for the fitting of Equation 5. The output from this program is then used as input to a table setup program, whose output can be used directly with the main analytical program. Thus, additions and corrections to the tables of coefficients of the main program are easily made. At present, 108 sets of coefficients for Equations 4 and 5 are being used, and there is room for 12 more in the computer memory. If more than 120 sets are acquired, the coefficients need only be separated into groups of 120 and followed by the corresponding input data similarly sorted for the reading operations. No changes need be made in the main program. DISCUSSION

Both the speed and reliability of spectrographic calculations have been improved by this computer application. Personnel previously assigned to manual conversion of such data by means of

Table II. Output Results (On One Card) Sample number Dilution factor same as input Identification Concentrationof element Experimental error estimate Kumber of valid replicates

/

where N = number of replicate spark-

-?

calculating boards are now available for other work. Manual conversion required approximately one man-month for 1200 element analyses in triplicate. This did not include estimating the error for each analysis, although the computer program nom provides this information. Knowledge of the error facilitates control of analytical procedures and provides a basis for estimating the validity of conclusions based on spectrographic results. The major benefit, however, is the ease with which the program accepts changes in calibration

data. Changes in the film gamma curve are made by insertion of five new parameters in the program. This eliminates the need of preparing a new relative intensity scale for the calculating board for each change in the gamma curve. In the same fashion calibration for a new element no longer requires the preparation of a scale for each line; instead, the coefficients of Equation 4 for the line in question are obtained from the calibration data by a separate, least squares curve fitting program and are stored on a

single punched card. Because of the manner in which the program operates, the number of calibration curves which can be used is unlimited. A detailed description of the program and a program deck are available from the authors on request. LITERATURE CITED

(1) Harvey, C. E., “Spectrochemical Procedures,” pp. 71-81, 238-54, Applied Research Laboratories, Glendale, Calif., 1950. RECEIVED for review December 14, 1957. Accepted March 14, 1958.

Semiautomatic Assembly of Mass Spectrometry Matrices D.

R. McADAMS

Esso Research laboratories, Esso Standard Oil Co., Baton Rouge, l a . ,Mass spectrometer calibration data as obtained from the instrument are adjusted b y means of a medium-sized digital computer. After manipulation for removal of impurity components and for instrument sensitivity changes, the data are assembled into a direct matrix in a form suitable for mathematical inversion. Manual effort is minimized while versatility is maintained in the computer program.

A

digitizing systems for mass spectrometry have come into wide use in the past few years. The use of digital computers for calculating analytical data from the results of the mass spectrometers has grown steadily. To date, honever, most procedures for working up calibration information from a mass spectrometer to the point where analytical data can be calculated have been done tediously by hand. By connecting the output of a mass spectral digitizer to a card punch, the mass spectrometer calibration data can be prepared directly in punched card form. The cards are produced in groups-one group for each calibration compound. The individual cards in a group are identified by some numerical code arrangement with one mass spectral peak height per card. The final desired form for this calibration information is that of the matrix, with the data stored in the computer in a suitable location for subsequent mathematical inversion of the matrix. In this, it is desirable that the order of the matrix shall be unrestricted up to a maximum of 27. The particular inversion program employed in the case under consideration was that obtained from IBM for use in the IBM 650, and inUTOMATIC

~ o l v e dthe use of floating decimal arithmetic. Therefore, conversion from the fixed point arithmetic to the floating decimal arithmetic was incorporated in the computer program. To minimize human effort in the preparation of mass spectrometer calibration data for use in digital computers, a program has been prepared for a medium-sized digital computer which possesses certain features of versatility and ease of operation. This program consists of three principal parts: (1) modification of the calibration data obtained in punched card form from a spectral digitizer; (2) data assembly in the form of a direct matrix; and (3) a variety of other procedures arranged so that the direct matrix can be used in the preparation of the desired inverse matrix. In the modification of the calibration data, the following features are considered : instrument sensitivity changes, size of sample, background spectra, impurities of calibrants, and averaging of spectra. These modifications can be provided in the computer program in a fairly simple fashion, inasmuch as they are expressible in mathematical form. Instrument sensitivity changes require multiplication by only one or several mathematical factors to correct for sensitivity shifts. The size of sample can be considered by inclusion of an additional factor. Instrument background involves only subtraction from the calibrant spectrum. Impurities of calibrants may be corrected by subtraction of a suitable portion of one column matrix from another. Spectra are very easily averaged. These mathematical operations are unchanged from one problem to another.

The arrangement of the data in the form of a direct matrix, however, involves several other features which are not expressible in mathematical form. The data identification may have no mathematical significance. The data may be coded by mass number or some other independent system. Then, too, extraneous data may exist as a result of the calibration procedure. Elimination of these extraneous data and rearrangement of the data manually so that the matrix assembly is possible would require an exceedingly large effort. A suitable computer program should therefore include some simple means for expressing the rules for the matrix assembly. A variety of other procedures are incorporated in the program. To permit additional changes to be made t o the direct matrix after the initial preparation, these operations include punching the direct matrix into cards with one matrix term per card, conversion to floating decimal notation, reducing the size of the matrix, transferring data from matrix area to a working area for further computations, and other similar steps. These involve fairly simple machine operations. Construction of a problem by a person unfamiliar with the operation of the digital computer was provided by features in the program itself. One feature in an IBM 650 computer which assists in problem construction is that of “load cards.” The appearance of a card punched in the proper fashionthat is, a load card-permits the construction of branches in the program. If this branch in the program is directed to a program word just entered in the same load card, an extremely large number of program branches is possible. VOL. 30, NO. 5, MAY 1958

881