um IVERSI ITY LIBRARIES ““5555 \55\\5\m\5\\\\\ 55538“. 555.1 5575 \I .. h ; LIBRARY Michigan State g University This is to certify that the dissertation entitled IMPROVEMENTS TO RESOLVING POWER IN TIME-OF-FLIGHT MASS SPECTROMETRY presented by George Edward Yefchak has been accepted towards fulfillment of the requirements for Ph. D. degreein Chemistry W/? 4 Major professor Date 3/& 7/]?0 MSU i: an Affirmative Action/Equal Opportunity Institution 012771 07 m"; f; a» ‘2 5’ PLACE IN RETURN BOX to remove this checkout from your record. TO AVOID FINES return on or before date due. H onggum DATE DUE DATE DUE air—l _JL__JL_‘J MSU Is An Affirmative Action/Equal Opportunity Institution cmmwd IMPROVEMENTS TO RESOLVING POWER IN TIME-OF-FLIGHT MASS SPECTROMETRY By George Edward Yefchak A DISSERTATION Submitted to Michigan State University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY Department of Chemistry 1990 ABSTRACT IMPROVEMENTS TO RESOLVING POWER IN TIME-OF-FLIGHT MASS SPECTROMETRY BY George Edward Yefchak As the separation efficiency available. from modern gas chromatog- raphy (GC) continues to improve, the increasingly short elution time observed for each mixture component presents a difficulty for mass spec— trometric detection and analysis of these components. Time-of-flight mass spectrometry (TOFMS) offers the potential for hundreds of spectra to be acquired per second, hence TOFMS has been identified as the mass spec- trometric technique of choice for high-speed GC. In order to accomplish high-resolution capillary column GC-TOFMS, researchers at Michigan State University have developed data acquisition equipment capable of obtaining and recording spectra at a rate of 100 Hz or more. In addition to this detection equipment, improvements to the mass resolving power achievable with time-of-flight mass analysis are required in order for GO- TOFMS to become a viable technique. Methods by which such improve- ments can be made are examined in this dissertation. The causes for the poor resolving power generally obtained in conventional TOFMS arise from the distributions of initial velocities and positions that ions have at the time of formation. They are carefully exam- ined, and conclusions drawn from this analysis are used to develop and evaluate new TOFMS techniques. One new technique, dynamic-field focusing (DFF), relies on a time-varying electric field to preferentially accelerate trailing ions within each isomass packet so that nearly simul- taneous arrival of all isomass ions is obtained.1 This technique is presented and analyzed in detail; the study shows that although DFF can provide better mass resolving power than the previously-developed techniques which used time-invariant fields, DFF is not the panacea sought. Two superior techniques for improving the resolving power in TOFMS are then presented and discussed. In the first of these, a continuous beam of ions is modulated by means of a deflection field in order to form ion packets for time-of-flight mass analysis.2 In the second, a novel pulsed electron- impact ion source having ion storage capabilities is used in combination with a grid-free ion mirror.3 These two techniques are examined, and both are found to provide mass resolving power adequate for GC-TOFMS. Finally, the relative merits of the two techniques, including sensitivity and detection limit considerations, are discussed. 1 G. E. Yefchak, C. G. Enke, and J. F. Holland, Int. J. Mass Spectrom. Ion Processes, 1989, 87, 313. 2 T. K. Fowler and W. M. Good, Nucl. Instrum. Math. 1980, 7, 245. 3 R. Grix, R. Kutscher, G. Li, U. Grfiner, and H. Wollnik, Rapid Commun. Mass Spectrom, 1988, 2, 83. Copyright © by GEORGE EDWARD YEFCHAK 1990 ACKNOWLEDGEMENTS I am grateful for the help provided to me by a large number of people. In particular, I would like to thank my advisers Dr. Christie G. Enke and Dr. Jack Throck Watson, as well as Dr. John F. Holland, who helped to guide me throughout my years in the graduate program. Kevin Hart and Chris Evans provided lots of assistance and lots of friendship. Eric Erickson and Brian Eckenrode, two past participants in the time-of-flight project, provided much assistance as well. Thanks go also to Dr. John Allison and the present members of the time-of-flight team, namely Gary Schultz, Ron Lopshire, Mary Puzycki, Dr. Ron Tecklenburg, and Dr. Damaschin Ioanoviciu. Dr. Stan Crouch and Dr. Adrian Wade provided many helpful discussions, and the computers were kept running with much assistance from Dr. Tom Atkinson, Mel Micke, and Mike Davenport. Helpful programming advice was provided by Drake Diedrich; Drake also provided some graphics routines for the beam deflection project. Kevin McNitt programmed and maintained the vast integrating transient recorder software system. I would like to thank Professor Hermann Wollnik and his coworkers at Universitat Giessen for all their help in our collaborative project. Special thanks go to Dr. Raimund Grix who came to MSU from Giessen. I am also grateful for all the assistance provided by past Enke-group members Norm Penix and Mark Victor, as well Bruce N ewcome, who made time-array detection a reality. And I would like to express my appreciation to the entire Enke and Watson groups, past and present. Keith Caserta deserves special recognition for advising me to enter the graduate chemistry program at Michigan State University. finally, I am most appreciative of tIie guidance, support, and [ave of my wonderful wife and fiest friend, Wendy fileen Teifl'er, to wfiom tliis dissertation is Jedicaterfi TABLE OF CONTENTS List of Tables ...................................................................................... ix List of Figures ..................................................................................... x Chapter 1: Introduction ................................................................. 1 1.1. The Problem ........................................................................... 1 1.2. A Solution—The Michigan State University Plan ................ 7 1.2.1. Time-Array Detection ........................................................ 8 1.2.2. Improved Mass Resolving Power ......................................... 9 Chapter 2: Mass Resolving Power in 'l‘ime-of-Flight Mass Spectrometry .......................................................................... 11 2.1. Introduction to Time-of-Flight Mass Spectrometry ............. 11 2.1.1. Principle of Mass Analysis ................................................ 12 2.1.2. Definition of Resolving Power ............................................. 13 2.2. Ion Behavior Patterns Which Degrade Resolving Power ...14 2.3. Previous Approaches to Improving Resolving Power ......... 16 2.3.1. Wiley-McLaren Developments ............................................ 18 2.3.2. Early Techniques for Space and/or Energy Focusing ....... . ..... 19 2.3.2.1. Change of initial ion behavior ................................. 19 2.3.2.2. Change of ion behavior after extraction .................... 22 2.3.3. The Reflectron .................................................................. 24 2.4. Requirement of Non-Static Fields for Complete Focusing . .27 2.5. Methods Which Incorporate Dynamic Fields ...................... m 2.6. Summary ............................................................................... a) Chapter 3: Dynamic-Field Focusing ............................................ 34 3.1. Models for Space and Energy Focusing ............................... 34 3.1.1. Four Post-Source Focusing Models ..................................... 35 3.1.2. Velocity Adjustment: Best Suited to Dynamic Fields ............ :£ 3.2. Investigation of Post-Source Velocity Adjustment ........... :D 3.2.1. Study of Muga’s Work ....................................................... {D 3.2.1.1 Theory of Velocity Compaction ................................ 40 3.2.1.2 Digital Simulation of Velocity Compaction ............... 42 3.2.2 Empirical Studies of Dynamic Acceleration ......................... 46 3.2.2.1 Cases VC, A, and B ............................................... 47 3.2.2.2 Cases S and E ....................................................... 52 3.2.3. The Infinitely-Thin DFF Region ......................................... 57 3.2.4. The DFF Equations ........................................................... 59 3.2.5. Selection of Instrument Parameters for DFF-TOFMS .......... 65 3.2.6. Simulated DFF-TOFMS Performance ................................. Q 3.2.7. The DFF Animation Program ............................................ 74 3.2.8. Predicted Metastable Ion Behavior ...................................... 77 3.2.9. Practical Considerations ................................................... 82 Chapter4: BeamDeflection .......................................................... as 4.1. Background ........................................................................... 87 4.2. Theory .................................................................................... 89 4.2.1. Models for Beam Modulation Techniques ............................ $ 4.2.2. Ion Packet Quality ............................................................ 93 4.3. Simulations ........................................................................... w 4.4. Experimental Results ......................................................... 102 4.5. Practical Considerations .................................................... 103 4.5.1 Mass Resolving Power .................................................... 103 4.5.2 Signal-to-Noise Considerations ........................................ 104 4.6. Conclusions ......................................................................... 105 Chapter5: CombinationdPuldelectronImpactSource with Ian Mirror ................................................................... 107 5.1. Background ......................................................................... 108 5.2. Preliminary Studies of Ion Behavior in the Wollnik Source .................................................................... 112 5.3. A Model for Ion Behavior in the Wollnik Source ............... 114 5.3.1. The Revised Model Simulation ......................................... 114 5.3.2. The Hypothesis ............................................................... 119 5.3.3. Experimental Studies in Giessen ...................................... 122 5.4. Studies Performed with the MSU M-TOF .......................... 127 Chapter 6: Collaborations ........................................................... 136 6.1. Studies on the Mass-Dependence of Time-Lag Focusing. 136 6.2. Studies of Two-Stage Homogeneous-Field Ion Mirrors 140 6.2.1 Background Information .................................................. 140 6.2.2 Ion Mirror Transfer Matrix .............................................. 143 6.2.3 Digital Simulation ........................................................... 144 6.2.4 A Convenient Simulation Method ...................................... 147 Chapter 7: Conclusions ............................................................... 152 Appendix: Program Listings ...................................................... 156 viii 3- 1. 3-2. 3-3. 3-4. 3-5. 4-1. 4-2. 4-3. 5-1. LIST OF TABLES Values used by program VCTOF ................................................. 46 Effect of voltage rise on final velocities .......................................... 49 Effect of voltage rise on arrival times ............................................ 50 Final expressions for k ............................................................... 64 Values used by program SIMTOF. .............................................. 71 Specific k values for 1000 u ions (V0 = 614.6 V). .............................. 73 Parameters used for simulated beam deflection peak shape. ........ 100 Comparison of peak variances obtained from calculation using Eqs. 1-3 and from digital peak shape simulation ......................... 101 Comparison of measured and simulated peak widths .................. 163 M-TOF source voltages used to obtain data in Figure 5-8 ............... 1:!) ix LIST OF FIGURES Two problems in GC-MS caused by slow spectral generation rates. ........................................................................................ 6 Overall mass analysis process in time-of-flight mass spectrometry ............................................................................. 12 Two methods of quantitating mass resolving power. The quantity reported as “% Valley” (Percent Valley) is the height of the overlap formed between two equally intense peaks, expressed as a percentage of the peak height. The FWHM (Full Width at Half Maximum) value is the width of the peak at its half-intensity height, expressed in mass units .......................... 14 Flight time variations in TOFMS. Lengths of the arrows indicate relative velocities of isomass ions extracted with energy U, from a single-field source. Relative positions and velocities are shown at three different times: ion formation (to), arrival at the space focus plane (t1), and later in the field-free region “2). ................................................................................ 17 Three representations of resolving power are plotted against mass: a: two methods of Sanzone, “R- 1” and “Unit Resolu- tion” b: the percent valley method ................................................ Z) One-stage ion mirror. Motion of two isomass ions having different initial kinetic energies is illustrated with relative positions and velocities at four different times ............................... 5 Two-stage ion mirror (“reflectron”). Motion of two isomass ions having different initial kinetic energies is illustrated with relative positions and velocities at six difi‘erent times. .................... 3 a: Ions starting at rest from difi‘erent positions within the source (case S) behave identically to case E+ ions starting from the space-focus plane. b: Similar behavior occurs for ions having some initial kinetic energy, but the location of the space-focus plane is shifted ......................................................... 23 3-2. 3—4. 3-5. 3-6. Illustration of ion motion in a conventional TOFMS instru— ment. Two case E+ ions for each of two masses m1 and m2 are illustrated. Ions begin at the origin (time and distance both zero) in the source. They are accelerated out of the source and move with constant velocity through a field-free region. The shaded lines represent motion of ions with non-zero initial energies; these ions achieve higher final velocities and thus reach the detector before the reference ions (represented by solid lines). Motion stops after ions traverse a certain path length and strike the detector ...................................................... 35 Four models for focusing by post-source modification of ion behavior. For each case, motion of two case E+ ions for each of two masses m1 and m2 is illustrated as in Figure 3-1 ..................... 37 Schematic diagram and voltage profile for the velocity com- paction TOFMS instrument (diagram adapted from ref. 4). Ions are created in the source, accelerated by a small electric field into the first field-free region (FF1), experience post- source acceleration in the dynamic field region, and finally travel through a second field-free region (FF2) to the detector .......... 40 Selection of values corresponding to a distribution function p[x]. The curve represents a cumulative distribution function P[x]=l:.p[xldx. Equally spaced values of P[x] (i.e., a uniform distribution) correspond to a ptxl distribution of x .......................... 44 Simulated peaks for m/z 600 and 601 from a conventional linear TOFMS instrument (a) and from the velocity compaction instrument (b). In each case, 0., corresponds to 500 K and 0’. = 0.01 cm. .............................................................................. 47 Models of ion behavior used for initial studies. In case VC, two isomass ions enter the dynamic field region simultaneously with different velocities but leave with equal velocities. In case A, the ions enter the region as in case VC, but the initially slower ion is accelerated to a higher velocity so that it catchs up to the other ion at the detector. In case B, two ions enter the dynamic field region separated in time but with equal velocities; as in case A, the trailing ion is accelerated and it catches up to the leading ion at the detector. ................................. 48 Relation of k (dV/dt) values to initial voltage for cases VC, A, and B. Parameters other than V,- are those in Table 3-1 .................. 51 Two new models of ion behavior used for empirical studies. In case S, two ions begin at rest from different positions within the source. They travel through FF1 (which may extend xi beyond the space-focus plane, as pictured here) and enter the DFF region at different times and with different velocities. They are accelerated in this region and travel with new velocities through FF2, finally arriving simultaneously at the detector. Case E is similar except that the ions start from the same position but with positive and negative initial velocities .......... 52 3-9. Relation of k values to initial voltage for cases S and E. For the data labled “S (short)” and “S Gong)”, d = 0.02 m and 0.04 m, respectively. Identical points were obtained with both values of d for case E. Parameters other than V,- and d are those in Table 3-1. .................................................................................. 54 3-10. Dependence of It on FF1 length, d, for cases S and E and with V; = 100 V and 221 V. Values for case S approach infinity at d = 0.02 m, the location of the space-focus plane. Values for case S and case E appear to converge at d = 0.16 m ......................... 55 3-11. The two ions in case E have the same kinetic energy so the plot of energy vs separation distance is a horizontal line. In case S, the two ions have different energies, thus the plot is slanted. As the ions move further along the flight path, however, their separation increases. This reduces the slope making it more . similar to that for case E ............................................................. 56 3-12. Peak shape sketches for m = 600 u based on data from the sim- ulation program. Peaks in the first row were generated using only an initial energy distribution (i.e., a planar source); those in the second row arise from an initial spatial distribution. Peaks simulated for a real gaseous source are shown in the third row. Peaks were generated using 12 values for both case E and case S and also using the mean of these two. Velocity compaction results (from VCTOF) are shown in the first column for comparison. ............................................................. 57 313. Model for dynamic-field focusing within an isomass group. a: Illustration of ion behavior. b: Relationships between ion velocity and ion position at regions of the flight path. c: Voltage profile throughout the flight path ..................................... 6) 3-14. Two arbitary isomass ions used in deriving the general focus- ing equation. a: time of entry into FF2, b: time of arrival at detector. ........................... _ ........................................................ 61 3-15. The DFF voltage function ............................................................ Q 316. Simulated DFF-TOFMS peaks for ions of mass 1000 and 1001 u for parameters shown in Table 3-5 ......................................... . ...... 71 xii 3-17. 3-18. 3-19. 4-2. 4—3. 5-2. 5-3. Simulated % Valley resolving power of DFF- TOFMS as a function of mass ........................................................................ 72 Deconvoluted DFF-TOFMS peaks at masses 1000 and 1001 u. .......... 73 Eight snapshots of the DFF Animation program (parts c-h continue through next three pages). ....................................... 78—81 Ideal ion behavior in beam modulation; the process essentially yields a slice from the continuous beam. Arrow lengths indicate relative ion velocities; only isomass ions are considered in this illustration. .................................................... $ Three models for beam modulation techniques. Isomass ions are shown to pass through a pair of deflection plates and move toward an aperture. Relative duration and polarity of the deflection voltage pulse is indicated for each case. The darker shading indicates ions which will pass through the aperture and form the ion packet. a: Gate model; b: Impulse Sweep model; c: Differential Impulse Sweep model. ............................... 92 Two ions entering the deflection plate region with different trajectory angles. Field reversal occurs when the lower ion is at point a and the upper ion is at point b. ...................................... % Illustration of ion behavior modeled by the simulation program (see text). .................................................................................. 99 Simulated peak shape for m/z 1000. — Bakker effect only,m Bakker effect with energy dispersion, --- Bakker effect with angular dispersion, --— — all efi'ects combined ..................... 101 a: Schematic diagram of the Wollnik-type instruments showing ion source, mirror, detector, and nominal ion path. b: three-dimensional view of the ion source showing circular filament and “electron pusher” electrodes. c: Block diagram of the M-TOF. ............................................................................. 109 Applied potential profile within the Wollnik ion source. a: storage mode, b: extraction mode .......................................... 110 Simulated peak shapes for m/z 866 from various initial kinetic energy distributions (temperatures) calculated for parameters matching the 4 m Wollnik instrument in Giessen. The peak corresponding to 50 K is most similar to the experimentally obtained peak. ......................................................................... 111 Geometry (above) and potential profile (below) of the Wollnik source. In the illustration of potential between G4 and G2, the xiii shaded lines represent the storage condition; black lines represent the potential during extraction. .................................. 112 5-5. Plot of ion packet width (analogous to peak base width) as a function of the electric field strength between grids G2 and G3 using a temperature of 500 K. The abscissa, “Voltage Factor”, is the quantity f defined in the text. For f values above 1.06, A widths at source exit; 0 widths at space-focus plane (see text). ...................................................................................... 116 5-6. Plot of peak width at half-height as a function of initial ion temperature calculated for parameters matching the 4 m Wollnik instrument in Giessen with a two-stage acceleration field. The horizontal line indicates the experimentally- measured peak width ............................................................... 118 5-7. Plot of peak width (FWHM) and intensity for m/z 18 as a function of extraction pulse frequency ........................................ 1% 5-8. Two segments from the mass spectrum of tris(heptafluoro- propyl)-S-triazine obtained from the M-TOF using time-array detection. a. m/z 28—32 region (residual air ions), showing resolution of 920 (FWHM = 12 ns); b. m/z 466—467 region, showing resolution of 1500 (FWHM = 30 ns). ............................... 12; 5-9. Reconstructed total-ion chromatogram; the nine peaks are: 1. cyclohexanol, 2. bromohexane, 3. 2-cyclohexene-1-one, 4. methoxy-ethyl ether, 5. 1,3-dichlorobenzene, 6. benzyl chloride, 7. 1,2-dichlorobenzene, 8. acetophenone, 9. benzyl bromide. Column: DB-5, 5 m x 100 um. Temperature program: 50°C-150°C, 20°C/min. Sample size: 1 ng of each component injected on column .................................................. 132 5-10. Mass spectrum of 2—cyclohexene-1-one obtained with the M- TOF (top); reference spectrum (bottom). ..................................... 133 5-11. Mass spectrum of 1-bromohexane obtained with the M-TOF (top); reference spectrum (bottom). ............................................ 134 6-1. Illustration of the CVC 2000 mass spectrometer showing nomenclature for parameters used in the modeling program by Erickson. Voltages are represented by the V terms and geometry by the as terms. The distance from an ion’s initial position to the first grid is 31, and the rise time of the voltage pulses applied to the first and second grids is t, ........................... 134 62. Resolution and intensity boundaries shown on lag time-m/z space. The shaded area represents the locus of points at which 6-3. adequate (see text) peak shapes are obtained. The shaded curve shows the optimum-focus lag time (proportional to \fnT). ..... 135 Simulated peak shapes for m/z 1000 and 1001 from planar and gas-phase (electron impact) ion sources. The widths at half- height are 2.7 and 72 ns, respectively. ........................................ 142 Chapter 1 Introduction “We live in the age of the sorcerer’s apprentice, in that we create data faster than we can sweep it away.” Raymund E. Dessy 1.1 The Problem Chemical analyses generally involve several steps, including sampling, separation, measurement, and data processing. The separation step is often critical, since many measurement techniques respond in some way to many species present rather than only to the species of interest. In a conductometric analysis, for example, all ionic species present in the sample contribute to the total measured current; it is the responsibility of the analyst to make certain that only charge carried by this species is significant. One separation method of great importance in many chemical analyses is gas chromatography (GC). In this technique, sample materials are vaporized and carried through a column by the flow of a carrier gas. During this motion, referred to as elation, chemically distinct species in the sample are separated due to differences in their partitioning between the 2 mobile phase (the gas) and the stationary phase (the column wall or packing material). Afier components of a mixture have been separated by GC, some measurement step is generally taken in which the quantity and perhaps identity of each species that elutes from the column is determined. Mass spectrometry (MS) is one measurement tool that can provide both qualitative and quantitative information about the chromatographically separated sample components. In an MS technique, the sample molecules are ionized by one of several methods, of which the most common is bombardment with fairly high-energy electrons. After ionization, some of the molecular ions fragment into smaller ions and neutral species; then the abundances and mass-to-charge (m/z) ratios of all these ions are determined. The 5_ resulting fragmentation pattern, represented as a histogram of ion abundance vs. mass-to-charge ratio (termed a mass spectrum), often serves as a “fingerprint” for identification of the original compound. In addition, the overall quantity of ions detected may be used to find the abundance of this species. The combination of GC with MS (GC-MS) was described recently in the following manner. Among the various possible combinations of chromatog- raphy with different analytical techniques, that of gas chromatography with mass spectrometry has been the most successful, useful, and routinely applicable. The reasons for this are not hard to see. Both techniques use very small quantities (ng or pg range) of the sample, both require the sample to be volatile, and the mass spectrometer can respond asfastastheGCcanelute.1 Indeed, GC-MS is a widely-used analytical methodology. Its applications span virtually the entire range of chemical analyses, from study of drug metabolism2 and quantitative metabolic profiling3 to trace analyses of dioxins in the environment.4 A problem with the combination of G0 with MS has arisen, however, since the continuing improvements in GC separation efficiency have not been accompanied by an increase in the spectral generation rates of MS instrumentation. In particular, the statement that “the mass spectrometer can respond as fast as the GC can elute” quoted above is no longer always true, especially if a mass spectrum is desired for each eluant. Individual species can often elute from very high-resolution GC columns, called capillary columns because of their small diameter, in times on the order of one second. (This refers to the span of time over which the species actually exits the column, rather than the total elution time between injection of the sample onto the column and the elution of a species ofi‘ of it.) It is thus necessary to be able to acquire a mass spectrum in about one second. 5Moreover, since the exact elution times of all species present are not known in advance, spectra must be acquired at rates substantially higher than 1 Hz in order to assure that at least one complete spectrum is obtained from each of the eluting species. As will be shown below, even this rate may not be adequate to provide true mass spectra or to sufficiently determine retention time. If a device which continuously records the quantity of analyte eluting from the column is used for detection, a plot of analyte signal intensity vs. time may be obtained. Each species present is then represented by a peak in this plot, which is called a chromatogram. Much interest in the field of 4 chromatography is placed on the shapes of these peaks. This can be complicated somewhat when discrete measurements are used to represent peak shapes, as is the case when total ion abundances from successive mass spectra are used to reconstruct a chromatogram. It has been shown that at least 40 points must be obtained across the elution profile in order to adequately represent the true peak shape.5 A convenient rule-of-thumb is that 10 points per standard deviation are needed, assuming the peak shape approximates a normal distribution. As a result of this, it is desirable to achieve mass spectral generation rates on the order of 50 Hz for GC-MS with currently-available capillary columns. As GC technology continues to improve, the data-generation rates required from MS will become even more stringent. The ever-increasing incompatibility between GC and MS time scales was fully recognized in the literature with the article “Mass Spectrometry on the Chromatographic Time Scale: Realistic Expectations” which appeared in 1983.6 In this work, carried out by several researchers at Michigan State University (MSU), two difficulties associated with an inadequate mass spectral generation rate were described. The first of these problems, illustrated in Figure 1-1a, is the inability to fully represent a chromatographic separation performed by the GC. An idealized “true” chromatogram representing a plot of concentration vs time is shown on the left, together with the times at which mass spectral acquisitions have been made. The reconstructed chromatogram, formed simply by connecting the discretely measured points, is shown on the right. Since the data generation rate in this example is too low, the adjacent peaks from separafid species have been misrepresented as a single peak. 5 The second problem, illustrated in Figure 1-1b, is caused not directly by the low spectral generation rate, but by the accompanying slow speed at which each individual spectrum is acquired. Most mass spectrometers operate in a scanning mode. That is, a signal is obtained from ions of one m/z ratio at a time; this m/z value is incremented, or scanned, in order to obtain a complete spectrum. If the scan rate is slow compared to the elution of the peak, the intensity measurements for individual m/z values can be skewed relative to those from an ideal spectrum taken very rapidly. This results from the fact that the partial pressure of the analyte molecules (essentially the analyte concentration) within the ion source changes during the scan. Many mass spectrometers can be operated in a selected-ion monitoring (SIM) mode in addition to the normal scanning mode. In SIM, only the abundance of a single, selected m/z (or perhaps a few m/z values) is monitored. Since no scanning is required to monitor ions of only one m/z, the abundance can be recorded continuously; thus SIM can be used obtain true chromatographic profiles. Moreover, the continuous nature of these measurements leads to a much higher signal-to-noise (S/N) ratio in SIM than in the scanning mode of data collection. The ideal MS detector for G0 would be able to achieve the high S/N ratios and hence low detectabilities found with SIM as well as the complete spectral acquisition provided by scanning. True . Chromatogram Reconstructed Chromatogram l | l l K Spectral (a) Acquisitions Chromatographic Peak acquisition time Mass SpeCtru-m H for ideal scan Ideallllll \ u -|. o (b) for one real scan Figure 1-1. Two problems in GC-MS caused by slow spectral generation rates. 1.2 A Solution—The Michigan State University Plan After describing the problems of chromatographic detection by MS in the 1983 publication, the MSU workers went on to examine the various mass spectrometer technologies and discuss the relative merits of each of these toward achieving the goal of a 100 Hz spectral generation rate covering the range of m/z 50—500. Time-of-flight mass spectrometry (TOFMS) was selected over magnetic sector, quadrupole, and Fourier transform techniques. It is interesting to note that in the 1950s, the earliest achievement of GC-MS also made use of a time-of-flight mass spectrometer;7 TOFMS was chosen because of its relatively high spectral generation rates at that time as well. As a result of this analysis, researchers at MSU developed a two-part plan to accomplish high- resolution capillary column GC-MS using TOFMS. This plan addresses three major goals: (1) the need for data acquisition equipment capable of obtaining and recording spectra at the desired spectral. generation rate of 100 Hz, (2) the need to collect all the information made potentially available from the sample molecules by the time-of-flight mass spectrometer so that sufficient sensitivity and detectability are achieved, and finally (3) the need to improve the quality (i.e., mass resolving power, discussed below) of time- of-flight mass “spectra. As described below, the first two of these goals have been achieved with the development of time-array detection. The third goal, improved mass resolving power in TOFMS, is the subject of this dissertation. 1.2.1 Time-Array Detection At first, a time-of-flight spectrum exists in the form of a transient electronic signal generated by ions striking a detector. (As described in Chapter 2, mass analysis in TOFMS is accomplished by measuring the arrival times of ions after their “flight” through the instrument; these measurements take the form of a brief signal from the detector.) The duration of this signal, called a transient, can be as short as 100 us. Furthermore, the signal portion representing a single m/z value might be as short as 10 ns. Mass spectra of this type can be displayed fairly easily on an oscilloscope screen—this, in fact, was the data acquisition mode used in the first GC-MS applications—but the digitization and storage of all the data required to represent 500 m/z values at spectral generation rate of 100 Hz requires novel instrumentation. Since the detection of complete transients is essentially the acquisition of an entire array of time-encoded data, the term time-array detection (TAD) is used for this detection scheme. The first phase of the MSU plan was the design and building of new data acquisition equipment for TAD. Work on this project has resulted in the design and construction of an integrating transient recorder (ITR) which can acquire 10,000 transients each second.8 Several consecutive transients are added together (hence “integrated”) to yield a scan file analogous to a conventional mass spectrum. This integration serves both to reduce the spectral generation rate from 10 kHz to a more manageable level and to improve the signal-to-noise ratio of the acquired data. For example, if each 1000 successive transients are summed, scan files are produced at a rate of 100 Hz; this meets the desired mass spectral generation rate for GC-MS. 9 Furthermore, each of these scan files will have a S/N ratio improved by a factor of \l 1000 over that of each individual transient signal. 1.2.2 Improved Mass Resolving Power The need for improved TOFMS spectral quality is addressed in the second phase of the MSU plan. As described in Chapter 2, time-of-flight spectra generated from gaseous samples typically suffer from poor mass resolving power relative to other MS techniques. Mass resolving power, which is essentially the capacity to differentiate ions of one m/z value from those of another, tends to become more and more important at higher m/z values and thus often limits the effective mass range of a spectrometer. When TOFMS was first developed, a mass range of a few hundred daltons could be achieved; this was fairly acceptable in comparison to other MS technologies at that time. Later, however, achievable mass ranges increased dramatically for magnetic sector, quadrupole, and Fourier transform instruments, etc., while the mass range of TOFMS continued to be limited by its low mass resolving power. The reasons for the poor resolving power in TOFMS are examined carefully in Chapter 2, and a large variety of methods which have been used to improve resolving power are described as well. Unfortunately, these conventional techniques are not compatible with the analysis of gaseous samples, such as those provided by GC, or are unsuitable in some other way for TAD. This dissertation continues from Chapter 3, then, to describe novel improvements to resolving power in TOFMS for use with GC-MS. REFERENCES B. Ravindranath, Principles and Practice of Chromatography, Ellis Horwood Limited: Chichester, 1989, 175. W. A. Garland and M. P. Barbalas, in Mass Spectrometry in Biomedical Research, Ed. S. J. Gaskell, Wiley: Chichester, 1986, 379—403. J. F. Holland, J. L. Leary, and C. C. Sweeley, J. Chmmatogr., 1988, 397, 3. L. M. Smith, D. L. Stalling, and J. L. Johnson, Anal. Chem., 1984, 56, 1830. S. N. Chesler and S. P. Cram, Anal. Chem., 1971, 43, 1922. J. F. Holland, C. G. Enke, J. Allison, J. T. Stults, J. D. Pinkston, B. Newcome, and J. T. Watson, Anal. Chem., 1983, 55, 997A. R. S. Gohlke, Anal. Chem., 1959, 31, 535. R. Tecklenburg, B. Newcome, M. Davenport, C. G. Enke, and J. F. Holland, in preparation for submission to Rev. Sci. Instrum. Chapter 2 Mass Resolving Power in Time-of-Flight Mass Spectrometry “Time wasted is existence; used is life.” Edward Young 2.1 Introduction to Time-of-Flight Mass Spectrometry Time-of-flight mass spectrometry (TOFMS) was conceived by Cameron and Eggers1 in 1948 and developed into a practical technique by Wiley and McLaren2 in 1955. The technique evolved only gradually for many years after that time, but it remained in use due to its simplicity and relatively low cost. Eventually, time-of-flight mass spectrometers fell out of favor as other types of instruments capable of much higher resolving power were developed. Prior to the development of TAD, the method by which computerized data acquisition was performed led to poor sensitivity; this also contributed to the decline of TOFMS. More recently, however, the advent of naturally pulsed ion sources (e.g., radioactive decay) which are well suited to the Weof-flight mass spectrometer, as well as the potential for TOFMS instruments to provide spectra over a large mass range at 12 acquisition rates far higher than other mass spectrometers, led to a renewed interest in time-of-flight mass spectrometry. 2.1.1 Principle of Mass Analysis Ions which have been accelerated to equal energies move with velocities related to their mass-to-charge ratios; these characteristic velocities are used for mass analysis in TOFMS. Ions simultaneously accelerated out of an ion source separate into groups according to their Acceleration Grids :5 Ion Source Flight Tube I Detector \ 52> ® 0 O . l . h Spectrum Figure 2-1. Overall mass analysis process in time-of-flight mass spectrometry. velocities as they travel through an evacuated, field-free tube, as shown in Figure 2-1. The time elapsed between the extraction of an ion from the source and its detection at the end of the tube is measured and used to calculate mass. (Strictly, this calculation yields the mass-to-charge ratio, m/z.) In a typical commercial TOFMS instrument,3 the energy applied for extraction is sufficient to cause ions up to about m/z 1000 to arrive at the 13 detector within 100 us of the extraction pulse. The instrument is therefore capable of producing a signal representing 104 complete mass spectra each second. With high-speed data acquisition devices such as the ITR, these spectra can now be recorded with no loss of information. Unfortunately, the spectra produced by time-of-flight instruments have until recently suffered from poor mass resolving power. 2L2 Definitionof‘fleeolvingPower” The degree to which ions with different m/z values may be difi’erentiated by a mass spectrometer is referred to as the mass resolving power, or resolution. Several methods of quantifying resolving power are commonly used;4 the choice of method is often based on personal preference or local custom. In this work, resolving power will generally be reported in one of the two ways illustrated in Figure 2-2. The percent valley definition is most useful for describing digitally simulated peaks, since it relies on the “valley” formed between two peaks of adjacent integral m/z values and equal intensity.5 The full width at half maximum definition (FWHM) is useful for experimentally obtained peaks, and this is the quantity most often given in the literature. In addition, the term unit mass resolution will be used. This refers to any resolving power suficient to permit difi‘erentiation between two peaks of adjacent integral m/z values. It is a less quantitative term unless some additional information is given, such as “unit mass resolution with <10% valley”. Regardless of the quantity used to represent resolving power, the ability to distinguish adjacent masses always decreases with increasing mass; this results in an upper mass limit for 14 which useful mass resolution can be attained with any particular instrument. 4—D—> For m2— m1 = 1, C ¢ %Valley = 100 B/A FWHM = mD/C \B T <—:>—> m m 1 2 Figure 2-2. Two methods of quantitating mass resolving power. The quantity reported as “% Valley” (Percent Valley) is the height of the overlap formed between two equally intense peaks, expressed as a percentage of the peak height. The FWHM (Full Width at Half Maximum) value is the . width of the peak at its half-intensity height, expressed in mass units. 2.2 Ion Behavior Patterns Which Degrade Resolving Power Ideally, all ions in each isomass group should arrive simultaneously at the detector. Such coincidence for the detection of isomass ions can be achieved if all ions start from the same point, have no initial motion, and are accelerated to the same final energy. Any deviations from these conditions cause perturbations in the flight times which, unless compensated for, degrade the capacity to resolve adjacent masses. For ions created from gaseous samples, the distribution of initial positions in the ionization region and the distribution of initial kinetic energies due to thermal motion give rise to a distribution of arrival times within each isomass group. The processes by which these perturbations occur, described in detail below, are often referred to as the space and energy effects, respectively. In addition, the half of the ions having some 15 component of thermal motion directed away from the detector must turn around under the influence of the extraction field before moving out of the source. This delay, referred to as the turn-around time, results in a further spread of arrival times. Models of the three patterns of ion behavior which lead to decreased resolving power are illustrated in Figure 2-3. (Presentation of ion behavior in this manner was inspired by a similar figure of Poschenriederfi) One of these patterns, case S, is caused by the distribution of initial positions (the “space effect”). The other two, cases E4» and E-, result from the initial kinetic energy distribution (the “energy effects”). All ions shown in Figure 2-3 have the same mass. In each case, a reference ion, located initially at position so with no kinetic energy, leaves the source with kinetic energy U, after extraction. Ions which start either at other positions, so + 63, or with initial energies, 6U, are described by the perturbation parameters a and 5 defined by a = (so + GEO/so (2-1) and p= w/ o, (2-2) In case 8, ions which start at some nonideal position aso are considered. An ion starting farther from the detector than so (a > 1) experiences a larger potential drop, and thus receives a higher final kinetic energy, than the reference ion. It catches up to the reference ion at the spacefocus plane and eventually reaches the detector first. The ions of case E-i- have some initial motion directed toward the detector. Such an ion having initial kinetic energy 5U. leaves the source with a final energy (1 + fl)U., so it 16 arrives at the detector before the reference ion. In case E-, the initial motion is directed away from the detector. The extraction field decelerates the ion as it travels farther back into the source so that the ion stops, turns around, and eventually returns to its initial position. At that time, it has regained its initial velocity but is then moving toward the detector. From there on, it behaves identically to the case E+ ion, except that the total flight time has been increased by the turn-around time. 2.3 Previous Approaches to Improving Resolving Power In 1955, Wiley and McLaren reported the first and, until the past several years, most important improvements to TOFMS resolving power. They developed two techniques which, when combined, raised the upper limit for unit mass resolution to several hundred daltons. Source Field-Free Region F—W A \ U U C1139- o o—'> (>4) Ideal U. U, 0 O——> H Space-Focus aU Plane \ ' .—aU—'> 280 Us Us H {xx} (1 + [3X], (1 + EU, U. U. O——> O-—> .......................... ,q. =4... .4 -... (1 4» EU, (1 4» EU, U. U. O—-> O—> \_7_J \_T__J 1 2 Figure 2-3. Flight time variations in TOFMS. Lengths of the arrows indicate relative velocities of isomass ions extracted with energy U. from a single-field source. Relative positions and velocities are shown at three different times: ion formation (to), arrival at the space focus plane (t1). and later in the field-free region (t2). 18 2.3.1 Wiley-McLaren Developments2 In this early work, equations were given for exact flight times in the source as well as in the flight tube, and the mathematical basis for existence of a space-focus effect, shown above in Figure 2-3, was explained. Ions starting at various positions throughout the ionization region “catch up” to each other at locations which fall on a plane termed the space-focus plane; in the simple one-field source illustrated here, this action occurs at a distance 280 past the source exit. One of the Wiley-McLaren developments was a two-field ion source which caused the space-focus effect to occur at the detector surface rather than at the original location. In this arrangement, the second acceleration reduces the relative difference in velocity between ions formed at different locations; the faster, trailing ions therefore catch up to the leading ones at the end of the flight path (the detector surface) rather than at the original space-focus location. Unfortunately, the location of the space-focus plane is perturbed by initial kinetic energies. The second development, time-lag focusing, concerns the initial energy distribution. In this technique, an adjustable delay is introduced between the time of ion formation and the extraction of ions from the source. During this delay period, thermal motion carries the ions to new positions within the source in such a way that resolving power is increased for a small, selectable range of masses. (The fact that this focusing is mass-dependent results in a need for superior mass-independent focusing techniques such as those described in this dissertation. A study on the size 19 of mass windows which do receive adequate focusing by time lag is reported in Chapter 6.) 2.3.2 EarhTechniquestorSpaceand/orEnergyFocusing After Wiley and McLaren’s work, a variety of other approaches were taken toward decreasing the spread of isomass ion arrival times and thus increasing the resolving power in TOFMS. These methods, as well as those of Wiley and McLaren, fall into two distinct categories. Some techniques are based on altering the initial spatial and/or energy distributions of ions in the source prior to their extraction into the flight tube. Other methods are based on compensating for the deleterious effects of the spatial or energy distributions after the ions have left the extraction region. 2.3.2.1 Changeofinitialion behavior Those techniques in which the ion behavior is altered prior to extraction include Wiley and McLaren time-lag focusing, the impulse-field focusing technique, and ionization methods in which ions are formed in essentially coplanar positions, such as from solid samples or in molecular beams. Time-lag focusing is considered here because the positions of the ions change during the lag time between their formation and their extraction. Marable and Sanzone developed the technique of impulse-field focusing (IFF) in which an electric field pulse of high amplitude and short duration is used to alter the initial kinetic energy distribution of ions in the source.7 This short pulse is followed by a longer extraction pulse; ions ideally remain in the source for the duration of the first pulse and leave 2) only under the influence of the longer extraction pulse. The first pulse serves to bring all the sample ions to essentially the same kinetic energy, relative to their thermal energies. In addition, this pulse causes all the ions to have velocity components in the direction of the flight path. Thus the loss of resolving power due to the case E-l- effect is reduced, and the turn- around problem is eliminated. The remaining problem (Case S) is compensated for by Wiley-McLaren space focusing. Implementation of [FF has been impeded by the inability to produce pulses of sufficiently large amplitude and short duration.8 Fi-1 ca 300 s~ . UR I 5- L . .700 6_ 4- ,_ . r600 52‘ l 3- r =4- ‘1 ‘ +500: g 2- , °\o a 2. 1'1 '400 1 . (3)0 'l'l—fl'l' 300 “90- ,',Tr' 0100200300400500 0100200300400500 Mass (u)' Mass (U) Figure 24. Three representations of resolving power are plotted against mass: a: two methods of Sanzone, “R — 1” and “Unit Resolution” b: the percent valley method. The methods by which Marable and Sanzone presented resolving power data were found to be somewhat confusing by this author. This led, in part, to the development of the “percent valley” expression of resolving power described above. (Sanzone’s term impulse-field focusing and its acronym IFF served, however, as inspiration for the name of the dynamic- field focusing (DFF) technique described in Chap. 3.) Comparison of these various presentations, using the data of Sanzone and coworkers,9 is shown 21 in Figure 2-4. A common use for plots such as these is to identify the highest mass value which may be distinguished according to some predetermined degree of resolution. The “R — 1 method of Sanzone (Figure 2-4a) is not well suited to this application since the ordinate asymptotically approaches zero for the masses of interest. The “Unit Resolution” method is better, but the ordinate value corresponding to the minimum acceptable resolving power is not readily determinable. The percent valley method (Figure 2-4b) directly provides the maximum mass resolvable to any particular degree of overlap—for example, masses up to 450 u can be resolved with a less than a 5% valley between adjacent peaks of equal intensity. Liquid and solid ionization techniques such as 2“Cf-plasma desorption,10 secondary ion mass spectrometry (SIMS),11 and laser microprobe mass analysis (LAMMA)12 essentially produce ions from a plane. Resolving power is therefore increased because the initial spatial distribution of ions in the source is eliminated. The turn-around effect is also eliminated because initial motion in the wrong direction is prevented by the liquid or solid phase. Placement of these techniques in this category occurs because the ionization region has been changed fi'om that of the gas- phase situation to this new, planar, configuration. Impressive resolving powers have been reported, but these are due to the use of energy focusing devices such as the reflectron (described below) in addition to the planar ionization region. For example, Standing13 reported that resolving power of 3200 for a linear (i.e. , without mirror) instrument incorporating SIMS increased to about 10,000 with the addition of a single-stage mirror. 22 Another technique in which the overall ion state is radically changed from that in the gas-phase situation involves the use of molecular beams. In such a beam, molecules travel with a limited span of trajectories. The distribution of velocity components perpendicular to the beam axis is therefore much narrower than the Maxwell-Boltzman distribution of velocities present in a gas at thermal equilibrium. If ions are formed in a molecular beam by laser ionization and then extracted along a flight path perpendicular to the beam axis, high resolving powers are obtained. For example, Reilly and coworkers reported a resolving power of 4650 for CoHo+ (m/z 78).14 In this work, the authors present a detailed theoretical model of TOFMS peak shapes based on probability theory both for conventional electron impact ionization and molecular beam/laser ionization; experimentally obtained peaks were found to be in excellent agreement with the theoretical predictions. 2.3.2.2 Changeofionbehaviorafla‘ech‘action A second classification covers those methods which are based on alteration of ion behavior after ions have left the extraction region. These include filtering methods, in which ions having significant deviations from the desired energies are removed, and focusing methods, in which some correction in the velocity or flight path of each ion is made to promote simultaneous arrival of all isomass ions. Focusing techniques which compensate for either the initial spatial or initial energy distribution are said to be space focusing or energy focusing techniques, respectively. Energy focusing techniques generally do not compensate for the turn- around problem. 23 Energy filtering has been reported with the use of an electric sector. 15 A continuous ion source (i.e., one that is not pulsed) originally part of a magnetic mass spectrometer was used to form an ion beam and direct it into the electric sector. The energy-filtered beam emerging from the electric sector was “chopped” into ion packets by a beam modulation technique. (This technique alone can be used as a way to obtain improved resolving power over conventional TOFMS; in this capacity, however, it does not fit easily into either of the two categories considered here. Beam modulation is the subject of Chapter 4 below.) These ion packets were mass-analyzed by time of flight; resolving powers as high as 900 were reported. Electric sectors also have been used to accomplish energy focusing. Several instrument designs have been proposed to provide energy focusing with the use of magnetic sectors16 and electric sectors.17"19 Benninghoven has implemented one of these, incorporating a toroidal electric sector and two field-free regions, for SIMS applications.20 Matsuda has developed a more complex design which incorporates four tandem electric sectors.21 Implementation of this design has yielded a resolving power of 730 for Xe ions (m/z 32) from an electron impact ionization source with an ion transmission of about 90%.22 Either energy focusing or space focusing (but not both simultaneously) can be achieved by another arrangement of electric fields termed a reflectron or ion mirror, treated below. 2.3.3TheReflectron A simplified illustration of reflectron energy focusing is shown in Figure 2-5. (Reflectron space focusing will be discussed in Section 2.4.) The device is simply a region having a retarding electric field of sufficient potential to reflect the ions. Ions starting from the same plane with difi‘erent initial kinetic energies travel to different depths within the mirror before turning around. When they exit the mirror, their velocities are the same as the initial velocities upon entering the mirror. The longer paths taken within the mirror by ions having larger initial energies compensate for their shorter flight times in the field-free region. If the mirror field is correctly adjusted, both the faster and slower ions arrive simultaneously at the detector. This figure illustrates a “one-stage homogeneous field” ion mirror—the simplest possible design. As the description indicates, only one electric field stage is used (in addition, of course, to the field-free region outside the mirror), and this field is homogeneous. Such a system can accomplish only first-order focusing. The term first order refers to a mathematical description of the focusing ability. Expressions for flight time, which are functions of initial kinetic energy, mass, acceleration potential, etc., can often be written as series expansions; a system accomplishing nth-order focusing will focus ions for which all n + 1 and higher order terms are insignificant. Second order focusing can be achieved with a two-stage mirror. Whatever distribution of ion positions and velocities (in the direction of the ion path) exists at the source is essentially reproduced by the mirror at the detector . (When discussing ion mirrors, it is often convenient to % refer to the first focal plane as the source and the second as the detector, even though these objects may not actually exist precisely at these locations.) This explains why the tum-around effect is not eliminated by mirrors; ions traveling at identical velocities but separated in time are affected identically by the mirror, so they arrive at the detector with the same separation they had at the source. Figure 2-5. One-stage ion mirror. Motion of two isomass ions having different initial kinetic energies is illustrated with relative positions and velocities at four different times. Mamyrin and coworkers pioneered the use of ion mirrors in TOFMS in the early 1970s.23:24 These first experiments used electron impact ionization and a two-stage mirror design similar to that shown in Figure 2- 6. This instrument achieved a resolving power of 2800 for 199Hg12712+ (m/z 453) and resolving powers greater than 3000 for ReBra clusters having m/z 1266—1290. Mamyrin later built a linear mirror instrument in which ions were deflected 180° by the mirror and thus returned essentially anti- parallel and colinear to their initial trajectory.25 The ions were collected by an annular detector which surrounded the ion source. This instrument achieved a resolving power of 1200 for 199Hg127I” (m/z 326) with a smaller % flight path length. In 1983, Wollnik and coworkers reported a mirror instrument similar in design to the first Mamyrin instrument.26 Resolving power of 2000 was reported from this instrument for N2"' (m/z 28). Figure 2-8. Two-stage ion mirror (“reflectron”). Motion of two isomass ions having different initial kinetic energies is illustrated with relative positions and velocities at six different times. In 1982, Schlag and coworkers reported the first use of ion mirror TOFMS with multiphoton ionization (MIPI).27 Benzene was introduced into the instrument in an effusive molecular beam, ionized by MP1, and mass analyzed by a two-stage ion mirror. Resolving power of 3900 was achieved for CoHo+ (m/z 78). Two years later, Della Negra and LeBeyec first used an ion mirror with 2520f ionization TOFMS, or plasma desorption mass spectrometry (PDMS).28 Resolving power of about 2500 was achieved for various molecules including nigericin (m/z 724). Two years after that, Schlag and coworkers increased the MPI-TOFMS resolving power to 10,000 in a collaboration with Bruker-Franzen Analytik.29 Yang and Reilly have reported mass resolving power of 11,000 for aniline (m/z 93) with a novel instrument which incorporates laser-induced desorption ionization by prism internal reflection.30 In this technique, a sample is placed on a 27 transparent medium and illuminated “from behind” by the laser pulse. Probably the highest resolving power yet achieved with TOFMS was reported recently by Bergman and coworkers.31 Cesium ions (m/z 134) formed by pulsed laser ionization were focused by a pair of quadrupoles and mass analyzed using a two-stage ion mirror with a mass resolving power of 35,000. In almost all implementations except the original Mamyrin designs, mirrors have been used with ionization methods which produce ions in a tiny, well-defined region of space. The laser ionization methods form ions only in the region where the beam is most focused; in PDMS ions are formed essentially on the surface of the sample foil. With these modes of ionization, space focusing is essentially unnecessary. There is a substantial distribution of kinetic energies, of course, but these are adequately compensated for by the mirror. Gas-phase ionization, such as electron impact ionization in particular, requires both space and energy focusing because ions are formed throughout a distribution of locations as well as with a distribution of kinetic energies. The reflectron alone cannot accomplish this complete focusing—in fact, no technique described above is capable of complete focusing—for reasons described in the following section. 2.4 Requirement of Non-Static Fields for Complete Focusing In Figures 2-5 and 2-6, the starting positions of the ions in the mirror instruments are coplanar, and this plane (indicated by the dashed line) is perpendicular to the flight path. This situation is identical to case E 4- described above. Figure 2-7a illustrates the transformation of case S into % case E-I- at the space-focus plane. Because of this transformation, an ion mirror can accomplish space focusing, rather than energy focusing, for ions which start from various initial positions; in such a case, one can think of the space-focus plane as a “virtual source” for the mirror. As illustrated by Figure 2-7b, ions having a given initial kinetic energy also come into spatial focus at a space-focus plane, but the location of this plane differs from that for ions of different energy. Any real distribution of initial energies would result in a distribution of space-focus planes; since the mirror simply reproduces its source (or virtual source) image, a distribution of arrival times corresponding to this distribution of planes would be obtained. This leads to the unfortunate conclusion that an ion mirror can accomplish either space or energy focusing, but not both concurrently. (Perhaps a compromise between the two, however, can be achieved.) 0 H (a) . II . I Ob EM 0» :M (b) 0» EH Figure 2-7. a: lens starting at rest from different positions within the source (case 8) behave identically to case E-i- ions starting from the space- focus plane. 1): Similar behavior occurs for ions having some initial kinetic energy, but the location of the space-focus plane is shifted. This conclusion is a specific case of a more general result developed by Stein.32 This work showed that achievement of simultaneous space and energy focusing is impossible through the use of static (time-invariant) 29 fields. This applies to any conservative force field, including electric and magnetic fields. The time-lag technique does result in some degree of both space and energy focusing, but only over a limited mass range for each value of the lag time. (Moreover, the delayed application of the extraction voltage probably prohibits consideration of time-lag as a static-field technique.) Certainly concurrent space and energy focusing cannot be achieved in a mass-independent manner by the use of static fields. For many applications which incorporate planar sources, Stein’s conclusion is not a serious problem because space-focusing is not needed. For gas-phase ionization methods, however, it implies the need to explore the possibility that dynamic (time-variant) fields could provide simultaneous space and energy focusing. ‘ 2.5 Methods Which Incorporate Dynamic Fields Exploration into the use of dynamic fields has so far resulted in techniques which incorporate time-variant acceleration either in the source or in a region past the source. Within-source dynamic acceleration has been pursued through the IFF technique described above. Post-source acceleration has been implemented in several ways—the velocity compaction technique of Muga, the post-source pulse focusing method of Kinsel and Johnston, and the dynamic-field focusing technique described in this dissertation. In velocity compaction, a dynamic acceleration field is used to equalize ion velocities within each isomass packet (hence “compaction” of the velocity distribution) in order to reduce the spread of arrival times.33 Velocity compaction was carefully studied prior to development of the so dynamic-field focusing technique, and a detailed description of it appears in the next chapter. Kinsel and Johnston have recently reported a new technique termed post-source pulse focusing in which a large section of the flight tube is held field-free, while a large range of isomass packets travel into it, followed by application of an accelerating electric field throughout this same region.34 2.6 Summary This Chapter describes techniques for improvement of mass resolving power in TOFMS which have been used since its inception in 1948 until mid-1989. Though not exhaustive, this review does include all the major approaches that have been taken throughout this period. Despite these considerable efforts by many investigators, the resolving power of TOFMS has not yet reached the levels more easily attained by several other types of mass spectrometers—Fourier transform and sector instruments in particular—except under special circumstances such as those of laser ionization. The research goal for this dissertation has not been to elevate TOFMS to the level of these “high resolution” instruments but rather, as described in Chapter 1, to achieve a level of resolving power adequate for GC-MS. 14 REFERENCES A. E. Cameron and D. F. Eggers, Jr., Rev. Sci. Instrum., 1948, 19, 605. W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum., 1955,26, 1150. CVC 2000, CVC Product Inc., Rochester, New York. S. T. Mullen and A. G. Marshall, Anal. Chim. Acta., 1985, 178, 17. This method for quantification of resolving power was developed by Wendy Peiffer (the author’s wife). W. P. Poschenrieder, Int. J. Mass Spectrom. Ion Phys, 1972, 9, 357, Fig. 1. N. L. Marable and G. Sanzone, Int. J. Mass Spectrom. Ion Phys, 1974, 13, 185. J. A. Browder, R. L. Miller, W. A. Thomas, and G. Sanzone, Int. J. Mass Spectrom. Ion Phys, 1981, 37, 99. J. A. Browder, R. L. Miller, W. A. Thomas, and G. Sanzone, Int. J. Mass Spectrom. Ion Phys, 1981, 37, 99, from Figs. 6 and 7. R. D. Macfarlane and D. F. Torgerson, Int. J. Mass Spectrom. Ion Phys, 1976, 21, 81. B. T. Chait and K. G. Standing, Int. J. Mass Spectrom. Ion Phys, 1981, 40, 185. J. Rosmarinowski, M. Karas, and F. Hillenkamp, Int. J. Mass Spectrom. Ion Processes, 1985, 67, 109. X. Tang, R. Beavis, W. Ens, F. Lafortune, B. Schueler, and K. G. Standing, Int. J. Mass Spectrom. Ion Processes, 1988, 85, 43. R. B. Opsal, K. G. Owens, and J. P. Reilly, Anal. Chem., 1985, 57, 1884. J. D. Pinkston, M. Rabb, J. T. Watson, and J. Allison, Rev. Sci. Instrum., 1986, 57, 583. 16 17 18 19 Z) 32 W. P. Poschenrieder, Int. J. Mass Spectrom. Ion Phys, 1971, 6, 413. J. M. B. Bakker, Int. J. Mass Spectrom. Ion Phys, 1971, 6, 291. W. P. Poschenrieder, Int. J. Mass Spectrom. Ion Phys, 1972, 9, 357. L. R. Kilius, E. L. Hallin, K. H. Chang, and A. E. Litherland, Nucl. Instrum., Meth., 1981, 191, 27. P. Steffens, E. Niehuis, T. Friese, D. Greifendorf, and A. Benninghoven, J. Vac. Sci. Technol. A, 1985, 3, 1322. T. Sakurai, T. Matsuo, and H. Matsuda, Int. J. Mass Spectrom. Ion Processes, 1985, 63, 273. T Sakurai, Y. Fujita, T. Matsuo, and H. Matsuda, Int. J. Mass Spectrom. Ion Processes, 1985, 66, 283. V. I. Karataev, B. A. Mamyrin, and D. V. Shmikk, Sov. Phys. Tech. Phys, 1972, 16, 1177. B. A. Mamyrin, V. I. Karataev, D. V. Shmikk, and V. A. Zagulin, Sov. Phys. JETP, 1973, 37, 45. B. A. Mamyrin and D. V. Shmikk, Sov. Phys. JETP, 1979, 49, 762. W. Gohl, R. Kutscher, H. J. Laue, and H. Wollnik, Int. J. Mass Spectrom. Ion Phys, 1983, 48, 411. U. Boesl, H. J. Neusser, R. Weinkauf, and E. W. Schlag, J. Phys. Chem., 1982, 86, 4857. S. Della N egra and Y. LeBeyec, Int. J. Mass Spectrom. Ion Processes, 1984, 61, 21. K. Walter, U. Boesl, and E. W. Schlag, Int. J. Mass Spectrom. Ion Processes, 1986, 71, 309. M. Yang and J. P. Reilly, Int. J. Mass Spectrom. Ion Processes, 1987, 75, 209. T. Bergmann, T. P. Martin, and H. Schaber, Rev. Sci. Instrum.,1989, 60, 792. R. Stein, Int. J. Mass Spectrom. Ion Phys, 1974, 14, 205. M. L. Muga, Anal. Instrum., 1987 , 16, 31. 33 34 G. R. Kinsel and M. V. Johnston, Int. J. Mass Spectrom. Ion Processes, 1989, 91, 157. Chapter 3 Dynamic-Field Focusing “T he algorithms are only human.” John F. Holland 3.1 Models for Space and Energy Focusing In the broadest sense, there are at least four approaches to the post- source modification of ion behavior for improvement of resolving power in TOFMS. Each of these involves a change in some aspect of distance, time, velocity, or acceleration. (For simplicity, higher derivatives have not been considered.) For example, an ion having excess kinetic energy may be allowed to travel over a longer distance or for a longer time, etc., in order for it and its reference ion to arrive at the detector simultaneously. Each of the techniques categorized in Chapter 2 as a “change of ion behavior after extraction” may be described by one or more of these models. 35 3.1.1 Four Post-Source Focusing Models Ion behavior in a TOFMS instrument employing no focusing elements and a single-field source is illustrated in Figure 3-1. Two case E+ ions are considered here, but this type of presentation is applicable to case 5’ ii § Field- Region Path Length 3 t t m m 1 2 . Time Figure 3-1. Illustration of ion motion in a conventional TOFMS instrument. Two case E+ ions for each of two masses m1 and m2 are illustrated. Ions begin at the origin (time and distance both zero) in the source. They are accelerated out of the source and move with constant velocity through a field-free region. The shaded lines represent motion of ions with non-zero initial energies; these ions achieve higher final velocities and thus reach the detector before the reference ions (represented by solid lines). Motion stops after ions traverse a certain path length and strike the detector. 121- and S ions as well. Progress along the flight path (Simply a straight line in this case) is plotted against time. The two ions become more and more separated in space as time increases; they finally strike the detector— reaching the same coordinate along the flight path—at different times. At any point along the graph, the slope of the path length vs time curve repre- $ sents the instantaneous velocity of the ion. For example, the ion motion is represented by straight lines past the source; velocity remains constant in this region. Conceptual models of the four approaches to post-source ion behavior modification are illustrated in Figure 3-2. The path length adjustment model (Figure 3-2a) provides a shorter path length for slower moving ions, and vice versa, within each isomass group. Focusing with electric fields falls in this category. (Electric sector focusing also involves preferential acceleration and deceleration or slower and faster moving ions, respec- tively, in addition to path-length adjustment.1) In the remaining three models, all ions travel through the same distance. The time-delay adjustment model (Figure 3-2b) involves the temporary removal of ions from the flight path, followed by their reinsertion at the appropriate times. The ion mirror can be described in terms of this model if the time spent within the mirror is considered to be the delay time; faster ions are delayed by the mirror longer than slower ions within each isomass group. In the velocity adjustment model (Figure 3-2c), a time-dependent acceleration field increases the velocity of each ion. Within each isomass group, trailing ions receive slightly more acceleration than leading ions, so these trailing ions catch up to the leading ones as they reach the detector surface. Velocity compaction is closely related to this model. Focusing could also be achieved by deceleration; trailing ions would receive a smaller decrease in velocity than leading ions. The fourth model, acceleration adjustment (Figure 3-2d), would be similar to velocity adjustment except 37 that the ions would experience non-zero acceleration at all times. The magnitude of this acceleration would decrease (or increase) during the flight to focus the ions. Path Length "'2 (d) t": 5.2 1 Time Time Figure 3-2. Four models for focusing by post-source modification of ion behavior. For each case, motion of two case E+ ions for each of two masses m1 and m2 is illustrated as in Figure 3-1. 38 3.1.2 VelocityAdiusiment: BestSuiwdtoDynamicFields The key to achievement of concurrent space and energy focusing in a mass-independent manner, rather than just for a small range of masses, is the use of non-static fields. In addition, the ability to effect some degree of mass separation prior to any compensation for nonideal ion behavior would permit the appropriate degree of compensation to be applied specifically to ions of each mass. Path length adjustment with electric sectors requires a constant electric field, so mass-independent space and energy focusing cannot be achieved using this approach. Time delay adjustment using an ion mirror seems to be incompatible with the use of non-static fields, since ions having a wide range of masses could reside inside the mirror at any given time. Dynamic fields appear to be inapplicable to acceleration adjustment as well, again because the dynamic acceleration could affect a large mass range. In addition, this method would require complicated instrumentation. The velocity adjustment method is compatible, however, both with the use of non-static fields and with mass separation prior to ion behavior modification. In an instrument incorporating post-source velocity adjustment, isomass groups would be separated in a field-free region prior to post- source acceleration. They would then pass through a short acceleration region and continue into a second field-free region. A time-dependent acceleration function would be designed to bring about focusing for ions of each mass individually, since only a small range of masses would reside in the acceleration region simultaneously. This method of ion behavior modi- fication was chosen for detailed study, and a model for dynamic post-source $ acceleration has been developed. Mathematical analysis and computer simulations based on equations from this model indicate that the method can provide substantial mass-independent focusing for space, energy, and turn-around effects. A complete description of the study is presented below. 3.2 Investigation of Post-Source Velocity Adjustment This investigation of post-source velocity adjustment began with a detailed study of Muga’s velocity compaction technique.2 The goal, at first, was to thoroughly understand the technique in order to improve upon it, or at least be able to implement it at MSU. In addition to the mathematical analysis of velocity compaction, a computer simulation was developed which verified the velocity compaction effect. A superior approach to post- source velocity adjustment was discovered and pursued, however; mathe- matical analysis and computer simulations then led to development of a new technique termed dynamic-field focusing (DFF).3 3.2.1 Study of Muga’s work The essential components of the velocity compaction time-of-flight mass spectrometer are shown in Figure 3-3. Ions are created by electron impact in the source and are drawn into the first field-free region by a single extraction field. The ions begin to separate into isomass groups as they pass through this region, just as in conventional TOFMS. Ions within each isomass group enter the dynamic field region at a distribution of times and with a distribution of velocities due to the case S, E+, and E- effects. The monotonically increasing acceleration field serves to equalize the ion 4D velocities by preferentially accelerating slower ions within each isomass group. Source FF1 Dynamic Field FF2 Detector / ,_/1 r“ .I\. Figure 3-8. Schematic diagram and voltage profile for the velocity com- paction TOFMS instrument (diagram adapted from ref. 4). lens are created in the source, accelerated by a small electric field into the first field-free region (FF1), experience post-source acceleration in the dynamic field region, and finally travel through a second field-free region (FF2) to the detector. 3.2.1.1 Theory of Velocity Compaction Consider an isomass ion packet traveling through the first field-free region, FF1. The packet begins to separate from other isomass packets just as in conventional TOFMS. The packet begins to spread out in space and time since the ions within it have a distribution of velocities. Muga derived an expression to show that the distribution of ion velocities could be reduced if the ions experience a particular time-dependent force in the dynamic field region given by a voltage (applied between FF1 and FF2) having the rate of change 41 fl = 2mvl 0" m2 where m and v are the mass and mean velocity, respectively, of ions in the (3-1) isomass packet, and r is the flight time through the dynamic field region having length I. This rate-of-change dV/dt is designed to have the following efi‘ect: two ions which enter the dynamic field region simultaneously but with different velocities will be accelerated to identical velocities as they leave. Their exit from the dynamic field region, however, will take place at different times despite their simultaneous entrance into the region. For ions extracted from a single-field ion source, Eq. 3-1 becomes 8V 9% = {,- x/ 3"" (3-2) where V, is the extraction voltage. The variable 1' was eliminated by an unpublished approximation to yield g—=i-K 2er dt 1 m (3-3) For ions starting at a distance so from the source em’t and for an FF1 region of length d, the mean arrival time of the isomass packet is given by t = (280+d) 72an (34) Thus mass may be eliminated from Eq. 3-3 to yield the final differential equation d V I V _ This equation describes a family of voltage functions which could bring about velocity compaction. Using the boundary condition that V(t) = Vo at 42 the time ions of mass 1 u enter the dynamic field region, Eq. 3-5 is integrated to yield the velocity compaction voltage function V 0 tr V(t) = 7(— t (3'6) r where K = [(230 +d)/\/2er/ 1 am] , r = [(230 + d) / l], and 1 man is the value of the atomic mass unit, 11. Although V(t) is not linear, it is assumed that during the short time any particular isomass packet spends within the dynamic field region, V(t) may be approximated with a linear function having the slope given in Eq. 3-1. The complete derivation of Eq. 3-6 from first principles, which is rather long, remains the property of M. L. Muga. 3.2.1.2 Digital Simulation of Velocity Compaction Little experimental data had been presented to demonstrate velocity compaction at the time this study began, so a digital simulation was developed to verify Muga’s results, most of which were simulated as well. A complete listing of the program, which was written in PDP-ll FORTRAN-7 7 , appears on pages VC 1—VC 13 of the appendix. The heart of the program is the function FTIME(M, Q, s, U, DIRECT), described below, which returns the flight time through the instrument for an ion of mass m, charge q, initial position 8, and initial kinetic energy U. The argument DIRECT is set to +1 or -1 to indicate initial motion toward or away from the detector, respectively. The user specifies means and standard deviations for the initial spatial and velocity distributions, which are assumed to be normal (Gaussian), as well as the ion mass and limits for the time axis of the output peak shape. The assumption of a normal velocity distribution is acceptable if the ionization process does not greatly disturb 43 the Maxwell-Boltzmann distribution of velocities which, in the case of motion in one dimension only, is a normal distribution having a mean of zero and a standard deviation 0,, of /kBT/m . The choice of a normal spatial distribution has less fundamental support, but it seems reasonable as well as convenient. The program constructs cumulative distribution functions (CDF’s) for these normal distributions and stores them in two arrays. Various initial positions and velocities are then chosen by iteration along the ordinate of these CDF’s followed by calculation of the corresponding spatial or velocity values, as shown in Figure 3-4. This has the effect of selecting initial conditions which follow the desired distributions; e.g., more values are chosen near the mean than far from it. Each chosen velocity is used to generate an initial energy as well as to select a value for DIRECT. Flight times corresponding to (position, velocity) pairs are calcu- lated and tabulated in an array to form a histogram representing the peak shape. If desired, standard deviations of zero may be specified for either the energy or space distribution. This would permit the study of efl‘ects due to either the spatial or energy distribution alone, respectively. For example, using a standard deviation 0. = 0 for the spatial distribution causes the program to simulate a planar source. The function FTIME () calculates flight time through the instrument as the sum of flight times in the source, the two field-free regions, and the dynamic field region. Flight time in the source is t _ s(2m)1l2 ‘ ' [ 1’2 (3-7) 8 ‘8‘;er + Ui] i ((4)112 pm 222225252? Figure 8-4. Selection of values corresponding to a distribution function plx]. The curve represents a cumulative distribution function PIX] = Dam. Equally spaced values of PM (i.e., a uniform distribution) correspond to a p[x] distribution of x. and that in FF1 is t _ d(m)1/2 d ' 1/2 {3% er. + U2] (3.8) After calculating t. and t4 from Eqs. 3-7 and 3-8, the function FTIME () calls a subroutine LTIME () which calculates t1 and the final velocity Of. These are returned to FTIME () which calculates tf as f/vf and returns the total flight time tm = t. + ta + t: + tftO the calling program. The function LT IME () could calculate flight time through the dynamic field region in two ways. Runge-Kutta integration could be used to simulate ion motion through many consecutive steps of duration At. This method was used at first. A faster (though still iterative) method was later derived as follows; The dynamic voltage V(t) is proportional to t", or 1‘10 when r = 1/2, as is usually the case. Letting 1' represent the time the ion has traveled within the dynamic field region and letting t“; = t. 4» t4, so that t = 1' + tug, we have 2 1/2 Sit—g = d“. tad) (3'9) where x is coordinate representing distance into the dynamic field region eV 0 . . and c = m l K' Integrating Eq. 3-9 yields d_x (310) -k 3’2 (fi-3(T+t‘d) +1: 3/2 To evaluate x, 1is set to zero yielding K = v0 - %td , where 00 is the velocity into the dynamic field region. Integrating Eq. 3-10 yields -22 5’2 341 x-15(1'+t.d) +rt+11 ( ) 5/2 Again setting 1'to zero reveals thatl=-£1§-t.d. completely through the dynamic field region (:1 = l), 1' represents the total When the ion has passed flight time tz. Thus t1 may be found by setting an in Eq. 3-11 to l and solving for 1'. Then the final velocity,vf, is calculated from Eq. 3-10 as [%J 1’- it Several variables in the program are set to the values given in Table 3-1, and values for dynamic voltage function are calculated from Eq. 3-6. Upon completion, the program outputs the histogram to an ASCII file as a listing of (time, intensity) pairs which may be plotted to yield the peak shape. 46 TI‘lalle 3-1. Values used by program VC‘IfiF. so Center of ionization 0.01 m d FF1 length 0.02 m l Dynamic-field length 0.08 m f FF2 length 1.30 m V; Extraction voltage 10.0 V V0 Reference voltage 70.0 V Sample output from program VCTOF is shown in Figure 3-5. Here peaks simulated for m/z 600 and 601 from the velocity compaction instru- ment are compared to simulated peaks for a conventional Wiley-McLaren instrument without time lag focusing. These peak shapes were generated by a program similar to VCTOF. Comparable results were obtained for other masses. This demonstrated that velocity compaction should, indeed, significantly improve resolving power over a large mass range. 3.2.2 Empirical Studies of Dynamic Acceleration Encouraged by the validation of the velocity compaction effect, a series of empirical studies on ion behavior with dynamic acceleration was begun. In each of these, various “cases” of ion behavior were studied. As will be described below, these classifications eventually led to the model cases S, 13+, and E-. 47 2 , J. . ' I 71.07 71.17 71.27 147.6 147.7 147.8 147.9 (a) Flight'l‘ime (#860) (b) Flight'rime (usec) Figure 3-5. Simulated peaks for m/z 600 and 601 from a conventional linear TOFMS instrument (a) and from the velocity compaction instru- ment (b). In each case, 0., corresponds to 500 K and a. = 0.01 cm. . 3.2.2.1 Cases VC, A, and B The first of these studies examined the three cases illustrated in Figure 3-6. Case VC represents the velocity compaction efi'ect. Cases A and B represent other effects which seemed to be superior since, in each of these, the ions under consideration reach the detector simultaneously. Programs were written, based on the function FTIME, which would report final velocities, positions, etc, for ions entering the dynamic field region at specified times with specified velocities. With these programs, empirical searches were carried out to find voltage functions which would cause any of the case VC, A, or B efi‘ects to occur. Only linear voltage functions were considered, since as above it was assumed that the isomass packets would pass through the dynamic field region rapidly compared to any nonlinear- ity in the rate of voltage change. These studies therefore required only the 48 search for appropriate values of V; and k to yield a voltage function V(t) = V,- + kt ‘which would bring about the desired efi'ect. Dynamic-Field Region ”-1 .——> v1 0 t f v0 = v1 VC ”3 .—-D a? f f Detector 01 v1 A 0 i H f 0,- r—bv; 0 vi v1 B ' ’ of H”! Figure 8-6. Models of ion behavior used for initial studies. In case VC, two isomass ions enter the dynamic field region simultaneously with different velocities but leave with equal velocities. In case A, the ions enter the region as in case VC, but the initially slower ion is accelerated to a higher velocity so that it catchs up to the other ion at the detector. In case B, two ions enter the dynamic field region separated in time but with equal velocities; as in case A, the trailing ion is accelerated and it catches up to the leading ion at the detector. The velocity into the dynamic field region for an ion of m/z 100 and a value for V, of 10 V is 4393 m/s. The instantaneous value of the velocity compaction voltage when the ion enters this region (using the same parameters as in Table 3-1) is 221 V, and dV/dt at this time is, from Eq. 3-5, 12.1 V/us. The first test in this study was to obtain this dV/dt, now repre- sented as k, empirically. Dynamic voltage functions V(t) = V.- + kt with V.- = 221 V and various values of I: were used to calculate final velocities v: 49 and v; for two ions entering the region with kinetic energies of 10.0 and 10.1 eV, respectively. The relative difference in final velocities was calcu- lated for each 11; results are shown in Table 3-2. Table 3-2. Efiei ct of voltage rise on final velocities. Case VC v1 — v° _L_£ v° k f 0. Was 219.x10-6 10. 82. 20. —6. 30. -51. 40. -102. 50. —133. The relative velocity difi'erence passes from positive to negative between I: = 10 and k = 20 V/us, indicating that a value of zero (corresponding to the desired 11) should occur in this range. More detailed study identified the desired It to be 19.9 :I: 0.1 Was. The large difference between this empiri- cally obtained k and the value obtained from Eq. 3-5 (12.1 V/us) was eventu- ally found to be due to the approximation for 1' made in the derivation of Eq. 3-5. (This part of Muga’s derivation is not in the public domain.) The program used to study case VC was modified slightly to report arrival times at a specified point along the flight path (representing the detector location). Again using parameters from Table 3-1 (including, in particular, V,- = 221 V and f = 1.3 m), the following relative arrival time difi‘erences were obtained. 50 iT‘ahle 8-3 Efie' ct ofE voltage rise on arrival times. Case A t1 ' to k to 0. V/us -293.x10-6 10. -168. 20. —86. 30. —41. 40. 7. 50. 36. These data indicate that the case A effect (which results in a relative arrival time difference of zero) can be made to occur, but at a higher voltage sweep rate (30—40 V/us) than needed for case VC. Further study identified It for this case to be 40.3 i 0.3 Was. The study was repeated using a lower initial voltage of V,- = 100 V. For this case, 12 was found to be 20.8 :t 0.4 V/us. A series of such studies were then undertaken to obtain values of k as a func- tion of V; for all three cases VC, A, and B. The results are plotted in Figure 3-7. For any particular initial voltage V;, a lower sweep rate is needed to bring about case B behavior, a somewhat higher rate to equalize the veloci- ties, and a much higher rate to achieve case A. Note that for any V,-, the sweep rate corresponding to case V0 is very nearly the mean of the the case A and case B sweep rates. 51 50 " 0 VC . A i 40 " ‘ B I 3 3° ' I \ .. B i M 20 d I . I I 10 " i ! V ' I .4 . I o I T U I ' I j l 1 I 0 50 100 150 200 250 V-initial (Volts) Figure 3-7. Relation of k (dV/dt) values to initial voltage for cases VC, A, and B. Parameters other than V,- are those in Table 3-1. From these results it would first appear that the velocity compaction voltage function brings about an improvement to resolution not only due to the intended case VC efi‘ect alone, but also because this voltage is a “compromise” between the case A and case B effects. Recall, however, that the case VC values obtained empirically do not correspond to any actual velocity compaction voltage function due to Muga’s imprecise approxima- tion for 1'. The disparity between the different k’s needed to bring about each Of the three efi'ects decreases with decreasing Vi, indicating that some optimization of the various instrumental parameters might yield superior re sults. Before attempting to achieve such an improvement, however, it 52 was decided to study ion behavior through the entire instrument (including the source) rather than only from the dynamic field region onward. 3.2.2.2 CasesSandE Two new cases of ion behavior were conceived and investigated in this new study. These are case S and case E effects (referring to space and Source FF1 Region DFF Region FF2 Region Detector O H S - O 4—d —><—z———~ f—u—> O» ' H E d-O O—> Figure 3-8. Two new models of ion behavior used for empirical studies. In case S, two ions begin at rest from different positions within the source. They travel through FF1 (which may extend beyond the space-focus plane, as pictured here) and enter the DFF region at different times and with different velocities. They are accelerated in this region and travel with new velocities through FF2, finally arriving simultaneously at the detector. Case E is similar except that the ions start from the same position but with positive and negative initial velocities. energy, respectively) illustrated in Figure 3-8. The patterns of ion behavior seen in each of these cases were ascertained with the help of the DFF Animation Program described below. The dynamic field region was given the name “DFF region” in anticipation of the “dynamic-field focusing" technique. Empirical searches for appropriate k and V,- values were carried out fOr cases S and E using values of so = 0.01 m, d = 0.02 m, f: 0.08 m, 53 l = 1.3 m, and m = 100 u. The study was repeated with d = 0.04 m. As shown in Figure 3-9, alteration of d changed the k-V} relationship for case S but not for case E. This occurs because the case E effect is essentially a compensation for the turn-around effect. The ions having initially opposite directions of motion travel through FF1 with identical velocities. The spatial separation they acquire during extraction remains constant throughout this region, therefore the voltage function appropriate to cause focusing for these ions is independent of the FF1 length. The fact that the k value for case S changes as a function of d, but the value for case E does not, indicates that perhaps a d value exists which would make the k values equal for both cases (and for a specific Vi). If this were true, then a single voltage function having the appropriate form could completely focus the isOlfnass packet. Ideally, this d would be independent of mass so that all masses could be focused. 4o- . S(short) i ' S(long) ao- ‘ E ‘3 q E i a 10 i i I I '1 I ‘ 0 v J I r I 1 l ' l o 50 100 150 200 250 V-initialWolts) Figure 3-9. Relation of k values to initial voltage for cases S and E. For the data labled “S (short)” and “S Gong)”, d = 0.02 m and 0.04 m, respectively. Identical points were obtained with both values of d for case E. Parameters other than V; and d are those in Table 3-1. Using values of so = 0.01 m, f: 0.08 m, l = 1.3 m, and m = 100 11, values for It were calculated with V; = 100 V and 221 V for both case S and case E. The results, plotted in Figure 3-10, indicate that with both V,- values, k ’8 for the two cases become equal (within the precision of the calculations) V"hen d is approximately 0.16 m. Moreover, the functions seem to converge as d increases beyond this value. This convergence can be explained as t‘Ollows: Consider the plots of kinetic energy vs separation distance for case S and case E ions shown in Figure 3-11. For case E, this plot is always a h~ o~—->' OE ' 9—) H E I q»—> o-r—> so: o—> o—> 40: (3+9 0*) ‘96“ d x f —v (a) U v +i— 3 x x Figure 3-13. Model for dynamic-field focusing within an isomass group. a: Illustration of ion behavior. b: Relationships between ion velocity and ion position at regions of the flight path. c: Voltage profile throughout the flight path. ewe” 2U1’ W; The acceleration is brought about by an electric field placed across the DFF region by the voltage function V(t). The final energies U0’ and UI’ are there- fore related to the initial energies as Uo’ = U0 - eV(to) (3-13) and UI’ = U1 — eV(to-At) (314) where to is defined to be the time ion 0 crosses the DFF region. (The voltage V(t) is always negative, so U0’ and UI’ are greater than Uo and U1, respec- tively, for positive ions.) FF1 FF2 IU1 | .p U e—L _f__ \ m... x m... (a, .....,/ (b, .:.,/ Figure 3-14. Two arbitary isomass ions used in deriving the general focus- ing equation. a: time of entry into FF2, b: time of arrival at detector 62 The electric field strength is again assumed to vary linearly while ions within a particular isomass group pass through the DFF region, so the voltage function may be approximated by V(t) = Vo - kAt (3-15) during this time. Letting Vo = V(to) and t = to - At, Eqs. 3-12—3-15 may be solved for k to yield 11 = [Vo + (U1’- U1)/e] /At (316) where -2 j. i "2 . _ m m . Thus, for any two arbitrary ions having mass m and known values of At, Uo, and U1, Eqs. 3-16 and 3-17 specify k as a function of Vo. That is, k = F(Vo, m) (318) Thus Eq. 3-18 describes a family of V(t) functions which can bring about simultaneous arrival for these two ions. Since mass separation begins to occur as ions travel through FF1, ions having different masses pass through the acceleration region at differ- ent times. All masses may be focused, therefore, by constructing a synchronized voltage function, the “DFF voltage function”, that behaves similarly to the appropriate linear ftmction for each mass, given by Eq. 3-18, during the time that ions of that mass pass through the DFF region. That is, at any time t, the instantaneous rate-of-change dV/dt of the DFF voltage fimction is given by dV/dt = k = F(V(t), m) (319) 63 if At, Uo, and U1 are known. Since m can be related to arrival time at the DFF region, this may be written as dV/dt = k = F’(V(t), t) (3-20) which may be integrated to yield V(t) = G(V(0), t) (321) Eq. 3-21 represents a family of DFF voltage functions, each of which has a unique value for the arbitrary constant V(O). Any of these functions will apply to all masses. In order to apply the formalism described above to a practical case, it is necessary to know values for the parameters of Eqs. 3-16 and 3-17 that depend upon the initial positions and kinetic energies of the ions, namdy At, Uo, and U1. Values for each of these will difl'er in form for each case of ion behavior. By the time this formalism had been developed, cases S and E had matured into the cases S, E4», and E- described in Chapter 2. If ion 0 in Figure 3-14 is defined to be the reference ion so that a :1 and fl = 0 (recall Eqs. 21 and 2-2), three expressions for U1 and At may be derived, one for each of these cases: U1. = “U. (322) ”1,, = (“M’- (3-23) U12- = (1 + DU. (324) 2m W 1/2 ' 423 = [77:] {ell-(a) ] + %(1 — 5%} (3.25) 1/2 AtE+ = [%J {so[1 4» (mm - (1+mm] + %[1 - (1+flfm]} (3-26) 64 mE_=[‘2t%)m{so[1-(fi)m —<1+m"2]+ [—141.41 ”2]}<3~27) These are substitued into Eqs. 3-16 and 3-17 to yield the three expressions for k given in Table 3-4. m expressionrfor 11. v0 +1-{L-1—d—(1-H-a'10-1-—;°7.-(1-a")+(U.-Voer"]4 - aU.} ks: viva—[30(1- -a'-) +d(1- a“) ten. v0 dngyh- (1+p>"')+—UL(1+p"- -(1+p)”)+(v.- voerl-I' -(1+fl)U.} l l VE[ro(1+p"—(1+p)")+ 4141.417]: 1 Va JWh- -(1+m"')+ 33:0- 5"— (1+m”)+(v.- woof-mom} 3.. W' 1+5)"- (1+m‘)+ 41- (14%] If ions were created that sufi‘ered from only one of the efi'ects S, E+, or E—, and if the related perturbation parameter (a or 0) were restricted to a single value, then the appropriate expression for It could be integrated immediately to give a family of DFF voltage functions. Unfortunately, a gaseous source will produce ions having a distribution of a and fl values. In addition, these ions will sufi‘er from not only the efi'ects S, E+, and E—, but also from combinations of these efi'ects. In order to obtain a DFF voltage function that can adequately focus all ions of interest, the following assumptions were made: 1. An average ’1 calculated from a practical range of a or 5 values will provide adequate focusing for all ions of interest within any of the three cases. 65 2. Instrument parameters (lengths of the field-free regions, etc.) can be found that make 123, km, and leg. similary enough that a single voltage function can adequately focus ions from all three cases. 3. Any process which simultaneously focuses ions of cases S, E+, and E- will focus all ions, including those which are not described by any of the three cases alone. The success of the simulations described above, as well as Muga’s reported success for velocity compaction, suggested that these assumptions were valid. A search for instrument parameters which would satisfy the condi- tions needed for dynamic-field focusing was therefore begun. 3.2.5 Selection of Imtrument Parameters for DFF-TOFMS The equations in Table 3-4 express each h as a function of so, (1, f, U,, a, fi, Vo, and m for each of the cases S, E+, and E-. In order to focus all ions of interest, values must be found for so, d, f, and U. that will make 113 ~ leg, ~ 113. for all practical values of a, [3, Vo, and m. In addition, these parameters should make each 12 approximately constant with respect to a and [3. Using these parameters, It can be treated as a function of Vo, and m only, as in Eq. 3-18, so that integration will yield the desired V(t). Inspection of Eq. 2-1 indicates that so should be made large relative to typical values of 6s, for any given extraction energy, so that any perturba- tion in initial position would result in only a small change to a and hence only a small change in kg. For initial positions obeying a normal distribu- $ tion with a standard deviation of 0,, the choice of so = 1000, seems reason- able. Estimating 0'. to be 0.1 mm for the CV C 2000 instrument, so was set to 10 mm. (Blueprints provided with the instrument indicated an electron beam slit width of 0.007 inches, or 0.178 mm. Thus 0', was set to be approx- imately half of this slit width.) Similarly, inspection of Eq. 22 indicates that U, should be made large relative to typical values of 5U. Initial kinetic energies are on the order of kBT/2, or about 0.02 eV at 500K. Thus U, should be at least 100 times larger, 2 eV, in-order to assure that km. and kg. do not depend strongly on EU. In addition, increasing U. causes 8 to approach zero. Inspection of the latter two equations in Table 3-4 indicates that km and kg. approach each other as )3 approaches zero. Unfortunately, kg., and kg- have a complicated depen- dence on U, which causes them to diverge from each other as U, increases, even though this causes [3 to decrease, so a final choice for U, was not made by inspection of these equations alone. As in any TOFMS instrument, differences in the arrival times of adjacent mass reference ions increase as the total flight path length is increased. Because this total length is essentially the instrument size, it cannot be enlarged without limit. The DFF technique was expected to be implemented first in the CV C 2000 instrument which had a path length of 2 m, so this length was chosen for the simulated instrument as well. The question of how to partition the total path length between d and f was not resolved, however, by inspection of the equations in Table 3-4. Values for U,, d, and f were chosen by simplex optimization. This technique searches for an optimum response from a system controlled by several independent parameters.5 In order to use simplex, it is necessary 67 to construct a response function which will be minimized or maximized. In this case, the response must be a function of two parameters, U, and d. (Since the sum of d and 1“ must equal the total length of 2 m, f is not an independent parameter.) The first response function used was a measure of the degree to which kg, kg." and kg. remain approximately equal over all practical values of a, fi, Vo, and m. Simplex optimization of this function, using a routine based on that of Press, et al.6, produced the values d = 34 cm and U = 5.75 eV which resulted in a rapidly-increasing “superlinear” DFF voltage function. (This occurred because d was so large.) From this first response function, the resulting DFF voltage function was guaranteed to produce small spreads in arrival time, but not necessarily high resolving power, since nothing about the separation between adjacent mass arrival times was specified. The superlinear voltage function would, in fact, cause ions of any given mass m + 1 to arrive very near to, or even before, those of mass m. Since the goal of dynamic-field focusing is to obtain good space and energy focusing over a large range of masses, a response function was designed to yield a measure of this overall resolving power directly. For a particular set of a, [3, Vo, m, d, and U, values, each of the three k values were calculated from the equations in Table 3-4 and then averaged to yield a single value, k“, These values of km... a, p, Vo, m, d, and U, were used to calculate a flight time tm. In addition, reference ion flight times if“ and t1“ were calculated by setting a to 1 and b to 0. The absolute difi‘erence between tn, and ti“, relative to the peak separation (ti;+1 - ti), was taken to be a represenation of the resolving power for mass m. This quantity was 68 summed over a range of a, [3, Vo, and m values to yield the new response function as o 0 V 1 V 2 'tm - ti, rein = if” f 3’: i“ ——,— 5% 0 “03. 412.. 6U, - 001, 002... Vo .. 100,200.. m . 100, 200.. tm+1 - tm (3-28) Simplex optimization of R(d, U.) yielded values of 0.010 m for cl and 10 eV for U,. The program SIMPLX which accomplished this is listed in the appendix. Setting so, d, f, and U, to the selected values enabled the three k values to be treated as functions of Vo, m, and a or 13. ks = F1(V0. m. a) (3-29) kE-o- = F2(V09 ms p) (3‘30) kn- = F 3(V0. m, 5) (3-31) ‘ From these, F(V(t), m) was approximated as F (V(t), m) = [F1(V(t), m, 1.01) + F1(V(t), m, 1.001) + F1(V(t), m, 1.0001) + F2(V(t), m, 0.01) + F2(V(t), m, 0.001) + F2(V(t), m, 0.0001) + FsCV (t), m, 0.01) + F3(V(t), m, 0.001) + F3(V(t), m, 0.0001)] / 9 (3-32) Substituting [2U,t2 / (280 + d)2] for m then yielded F’(V(t), t). The initial value problem dV/dt = F’(V(t), t) was integrated numerically, using the boundary condition that V(t) = 140 V as ions of mass 20 u pass through the DFF region, to yield the DFF voltage function shown in Figure 3- 15. The choice of the boundary condition affects the range and slope of V(t). The value of 140 V was chosen to keep V(t) < 1000 V and dV/dt < 10 V/us for masses up to 2000 u. The program SOLVE which accomplished the integration to calculate V(t) is listed in the appendix. m 3.2.6 Simulated DFF-TOFMS Performance A simulation program similar to VCTOF was written to generate peak shapes for a DFF-TOFMS instrument. This program, SIMTOF, is listed in the appendix. Although the DFF region length was assumed to be zero in the theoretical development, a finite length, l, was used for the simulation so that exact flight times could be calculated. No serious devia- tions from the expected focusing effects were seen for 1 values of up to 5m. 1000 ‘ 800 " 600‘ \hflflagai 400 ‘ 200 ‘1 O - I ' I ' I fl I o 20 40 60 so 100 120 {Dhaus(us) Figure 3-15. The DFF voltage function. Flight times are again calculated as the sum tm = t, + ta + t; + tf. Eqs. 3-7 and 3-9 yield t, and t4, then it is found through solution of a cubic 70 equation as in VCTOF. Motion in the DFF region is described by the function x = p3(t + 1)3 + p2t2 «1» mt + D0 (333) where the ion position, x, ranges from 0 to l as t increases from 0 to t1. Here 0 1' -'-(tm - in), so the DFF voltage is given by Vo + (t + 1)k. The coeficients in Eq. 3-33 are p3 = ek/6ml (334) p2 = eVol 2ml (335) p1 = d/t .1 - ek12/2ml (3.35) 120 = —ek13/6ml (3-36) To find i), x is set to l in Eq. 3-33 and the appropriate root of the equation pg? + <3p31+p2xf + (ti/1d», - z = o (237) is found by Newton’s method. In the final field-free region, the velocity of the ion, Uf, is given by vf = 311301 + 192 + Zpgtz + p1 (3-38) so tf is found as tf = [71],? (3-39) Using the parameter values shown in Table 3-5, simulated peaks were produced for a variety of masses. The results for masses 1000 and 1001 u, shown in Figure 3-16, indicate a resolving power of 3% valley, or 2900 using the FWHM method. Unit resolving power (5 50% valley) was achieved at all masses up to 2000 u, as shown in Figure 3-17. 71 TaBle 3-5. Values used by program SIM‘l‘CF. T Temperature 500. K a, spatial distribution std. dev. 0.0001 m so Center of ionization 0.0100 m d FF1 length 0.1000 m l DFF length 0.0020 m f FF2 length 1.9000 m U, Extraction energy 10.0 eV 12000 ' . 1000 1001 :3 E . E .5 o- ,4..fi....,.fi..,. 259.30 259.35 259.40 259.45 259.50 259.55 Flight Time (1.18) Figure 3-16. Simulated DFF-TOFMS peaks for ions of mass 1000 and 1001 u for parameters shown in Table 3-5. % Valley ' I I I ' T 1 0 400 800 1200 1600 2000 Mass (u) Figure 3-17. Simulated % Valley resolving power of DFF-TOFMS as a function of mass. The space and energy focusing effects were investigated separately by simulating peaks with either a, or a, set to zero. Keeping all other parame- ters at the values listed in Table 3-5, such deconvoluted peaks were gener- ated for masses 1000 and 1001 u; these are shown in Figure 3-18. It would appear from this figure that DFF energy focusing is more efi‘ective than space focusing. The reference ion of mass 1000 u enters the DFF region at time ‘2000 = 86.38 us; the value of the DFF voltage at this time is 614.6 V and the instantaneous slope is -7.25 V/us. Comparison of this slope to the k values calculated from the equations in Table 3-4, shown in Table 3-6, indi- cates that dV/dt is closer to both kg, and kg_ than it is to ks. This explains the superior energy focusing in this case. Certainly the weighting of the individual k values used to calculate dV/dt (Eq. 3-32) could be altered to equalize the degree of space and energy focusing, but this adjustment was 73 not studied. Such weighting could also be used to accentuate either space or energy focusing for cases where either a, or 0,, is dominant. -— NO spatial distribution --------- No energy distflbution 8000 " Intensity (arb. units) 0 . ' 259.30 259.35 259.40 259.45 259.50 259.55 FlightTimeQIS) Figure 3-18. Deconvoluted DFF-TOFMS peaks at masses 1000 and 1001 u. Table 3-6. m 07: values for 1000 11 ions (V0 = 614.6 V) a 5 ks 1311+ ks— (V/us) (V/us) (V/us) 1.01 0.01 -7.55 —7.17 -7.20 1.001 0.001 —7.56 -7.21 —7.22 74 3.2.7 TheDFFAnimationProgram An important tool used in the theoretical development of the DFF technique was the program AN IMATE, which illustrates motion of ions through a TOFMS instrument. Ions of user-specified mass, initial velocity and initial positions are displayed in any of eight user-specified colors. These ions move through an instrument described by user-specified parameters for the various region lengths as well as the Vo and k for the DFF voltage function. The program was written to run under IBM PC-DOS with IBM Professional Fortran, and it uses the IBM Graphics Development Toolkit device drivers for graphics output; a listing appears in the appendix. The screen is divided into two major windows; the upper window portrays the entire instrument while the lower one represents a close-up view of the ions. The upper view is divided into regions representing the ion source, FF1, and FF2 (shown at the left, middle, and right, respectively). The DFF region is considered to have negligible length in the version of the program listed in the appendix, but another version of ANIMATE presented motion through finite-width DFF regions as well—in that version, Runge-Kutta integration was used to advance the ions step-by-step through the DFF region. FF2 is scaled to extend through most of the right- hand half of the screen; the remaining portions of the instrument are scaled to fit the rest of the screen. In this upper window, ions move through the instrument leaving trails of the appropriate color behind. The lower view represents a “moving window” which travels along with the ions; motion of this window is matched to that of a reference ion so that the 75 location of that ion appears to remain fixed. Elapsed time is shown at the top center of the screen. The velocity of each ion is shown and constantly updated at the left edge of the upper window; current position values for each ion are shown at the left edge of the lower window. A sample run of the program is illustrated in Figure 3-19, where eight “snap-shot” views of the screen have been reproduced to represent the animation. This example shows motion of seven m/z 800 ions, as well as reference ions of m/z 799 and 801, traveling through an instrument with so = 0.01 m, d = 0.05 m, and l = 1.95 m. The center ion, shown in black, is considered to be the reference ion of m/z 800. The three upper-most m/z 800 ions, shown in grey, are initially located slightly farther back in the source; the remaining three m/z 800 ions, also shown in grey, start slightly forward in the source. The m/z 799 and 801 ions, shown in white above and below the other ions, respectively, have the same starting position as the m/z 800 reference ion. Within each group of three non-ideal m/z 800 ions, the upper-most ion has a positive initial velocity, and lower-most has a negative initial velocity, and the center ion starts at rest. These initial conditions are shown in Figure 3-19a. In Figure 3-19b, 11.25 us have elapsed (as indicated at the top of the figure) and the ions are nearing the source exit. The ions have moved into FF1 in Figure 3-19c and continue with constant velocities through this region in Figures 3-19d—e. Note that the ions have just passed the space-focus plane in Figure 3-19d. (The space-focus plane is located 20 mm past the source exit; the ions are all approximately 21 mm past the source,as indicated at the left of the figure.) In Figure 3-19f, the ions have been accelerated by the DFF region and have entered FF2. Though widely separated by this acceleration, the m/z 800 ions begin to come together while 76 the m/z 799 and 801 ions begin to separate, as shown in Figure 3-19g. Finally, all the m/z 800 ions have become focused (between the m/z 799 and 801 reference ions) at the end FF2, shown in Figure 3-19h. The input data file used by program ANIMATE in this example is shown below: 9 Numberofions 799., -0.0100, 0., 1 Mass,position,velocity,andcolorofion1 800., -0.0105, 50., 2 Mass,position,velocity,andcolorofion2 800., -0.0105, 0., 2 Mass,position,velocity,andcolorofion3 800., -0.0105, -50., 2 Mass,position,velocity,andcolorofion4 800., -0.0100, 0., 3 Mass,position,velocity,andcolorofion5 800., -0.0095, 50., 2 Mass,position,velocity,andcolorofion6 800., -0.0095, 0., 2 Mass,position,velocity,andcolorofion7 800 . , -0 . 0095, -50 . , 2 Mass, position, velocity, andcolorofion8 801., -0.0100, 0., 1 Mass,position,velocity,andcolorofion9 5, 0.020 Ref.ionis#5,halfwindowsizeis0.020m 58-8, 0. aisEOnafimelag-O 654.67, 8.9E6, 20., 0.05, 0.050001, 2.0 VakV,d,d+l,d+l-1f 5, 10 Screen-updatecpeeds In a typical study involving program ANIMATE, an input data file such as this is created, the program is run, a modification is made to the input data file, the program is run again, and so forth. Since the input data are contained in a plain ASCII file, this frequent alteration of the input data file is easily made with any of several editors or word processors. Though not as “user-friendly” as a menu or icon-based user interface, this method of data entry was very easily implemented as well as being satisfactory in performance. Ion motion can be stopped at any time by pressing the BEIUBN key. This enables the user to closely examine or record the exact positions or velocities of the ions. In addition, the key sequence E BELLE]! causes a hard-copy “snap-shot” of the screen to be generated. (The IBM Graphics 77 Development Toolkit provides a device driver for the Hewlett-Packard 7475A six-pen plotter.) 3.2.8 PredictedMetastableIonBehavior In conventional TOFMS, metastable ions (that is, ions which fragment after leaving the ion source) are detected at the same flight time as their parent ions. This is because the fragmentation process affects the ion velocity only slightly, and this perturbation takes place isotropically (in the center-of-mass reference frame). The result of a metastable decomposi- tion is therefore the detection of a somewhat broadened peak superimposed over the parent ion peak. In a DFF-TOFMS instrument, however, a “more complicated situation will occur. Due to the relatively low extraction energy used, and hence the relatively long flight times through FF1, most metastable decompositions will occur prior to acceleration by the DFF voltage. Consider ions of mass mp traveling through FF1. If some of these ions undergo fragmentation along the way, the resulting fragment ions of mass mf will arrive at the DFF region concurrent with the parent ions. These fragment ions will therefore experience a dynamic acceleration field adjusted to focus ions of mass m rather than mf. Because mf< mp, the P instantaneous rate of voltage change will be too low to properly focus the fragment ions. In addition, these ions will be accelerated to a higher veloc- ity than the parent ions, due to their lower mass, and will therefore arrive prior to the parent ions. The effect is most severe for fragment ions having vastly decreased mass relative to their parent ions. Source 78 FF1 FF2 Detector 0.0000E+00 -0.01000 -0.01050 -0.01050 -0.01050 -0.01000 -0.00950 -0.00950 -0.00950 -0.01000 (a) ''''''''''''''''''' 0.11253-04 (b) Figure 3-19. Eight snapshots of the DFF Animation program (parts c-h continue through next three pages). 79 1522 1588 oooooooooooooooooooooooooo 1586 1590 1550 1509 1514 1512 1548 ............... gm” ''''''''''''''''''''''''''''''''''''''''''''''''''' 0.20258-04 0.01145 0.01185 0.01119 0.01055 0.01143 0.01223 0.01165 0.01100 0.01140 '''''''''''''''''''''''''''''''''''''''' ............... 0.2650E-04 0.02115 0.02177 0.02110 0.02049 0.02111 0.02167 0.02111 0.02145 0.02107 80 1552 0.3450E-04 1588 150 159 1550 1509 151 15 154 0.03356 0.03447 0.03379 .03321 .03351 .03374 .03322 .03254 .03346 12553 0.5600E-04 12592 1263 126 126 126 12702 - 12735 12656 ..... 0.18879 0.19871 0.19381 0.18907 0.18840 0.18736 0.18233 0.17754 0.18795 81 0.14353-03 1.29721 1.30052 1.29895 1.29722 1.29648 1.29577 1.29374 1.29188 1.29534 2.00027 1.99938 1.99992 2.00011 1.99933 1.99881 1.99869 1.99870 1.99774 82 A variety of methods could be used to eliminate the interference caused by metastable fragmentations. For example, a potential barrier nearly equal in magnitude to U, could be placed (by means of grids) just prior to the DFF region. This would prevent fragment ions, which have lower kinetic energy than the parent ions, continuing through the instru- ment. Those fragment ions that had lost only a small fraction of their parent mass would pass through this barrier, but these same ions would be fairly well-focused as well. In addition to the interference caused by fragment ions, the neutral species formed by metastable decomposition will be detected as well. These species are not accelerated by the DFF voltage and thus will travel through the entire instrument with their original velocity. Elimination of this inter- ference requires some part of the ion path to be curved (by electrostatic deflection, for example) so that the neutral species do not strike the detector. The studies described above demonstrate that dynamic-field focusing should be a viable technique for improvement of resolving power in TOFMS. It should provide focusing over the mass range of 0—2000 u for ions formed from from gaseous samples in an electron impact ion source. Even if this mass range is overly-optimistic (due to nonideal ion behavior not modeled in this study) by as much as a factor of 4, DFF would provide focusing adequate for routine GC-MS analyses based on TOFMS with time-array detection. Unfortunately, however, the predicted resolving power cannot be increased greatly over that described above due to two factors. First, the boundaries for voltage range and sweep rate of V(t) < 1000 V and 83 dV/dt < 10 V/us used to obtain the DFF voltage function approach the prac- tical limits with current electronics technology. Moreover, simulated studies of a variety of instrumental and sample parameters have indicated that the initial spatial distribution of ions present with gas-phase ionization remains, in spite of the dynamic-field approach, a serious impediment to achievement of adequate mass-independent focusing in TOFMS. In section 3.2.5, it was noted that the first attempt to choose DFF instrument parameters (by Simplex optimization of the mutual equality between ks, kg.,, and kg.) was unsuccessful. The parameters chosen in this first attempt were those that produce the smallest possible peak widths rather than the best mass resolving power. Though reduction of peak widths is a goal common to virtually all resolution-enhancement tech- niques in TOFMS, the failure to achieve good resolving power by merely minimizing peak widths is not entirely unexpected. For example, consider the most basic TOFMS experiment in which flight time through a distance of length l is given by the relation t =% , where m is the mass and U is the acceleration energy. The separation in arrival time between two ions of adjacent mass is filfiflm + 1 — m) and is thus inversely proportional to U. The turn-around time effect (and hence the peak width) is reduced, however, as U is increased. A compromise between the lowering of U to increase adjacent peak separation and the raising of U to decrease peak width is therefore required. This is analogous to the compromise between peak width and peak separation in the DFF situation. In fact, simplex optimization of an overall resolving power function (analogous to Eq. 3-28) could be used to pick the most appropriate value for U, as well as other 84 source parameters, for conventional TOFMS just as it was in the DFF studies. Notwithstanding these similarities between DFF and conventional TOFMS, the fact that efforts to improve resolving power by reducing peak widths can actually make it worse (not only by reducing the separation between peaks but, in the case of DFF, by actually reversing their order!) indicates that these approaches to the improvement of resolving power may have serious flaws. Recall that the study of techniques incorporating dynamic fields came about as a result of Stein’s conclusion (see section 2-4) that complete space and energy focusing could not be achieved with time- independent fields alone. Even the use of dynamic-fields, however, has not yet resulted in a truly attractive focusing technique—DFF has the problems described above, these must be shared by velocity compaction (due to its similarity to DFF), and post source pulse focusing (section 2-5) does not achieve truly mass-independent focusing despite its use of dynamic fields. Though these results do not preclude success for all dynamic-field techniques in the definitive way Stein’s conclusion proved concurrent space and energy focusing could not be achieved solely with static fields, they strongly suggest that DFF is unlikely to provide the panacea sought. Two alternative strategies which are quite different were pursued after completion of the DFF analysis; these are the subjects of the following two chapters. ' REFERENCES W. P. Poschenrieder, Int. J. Mass Spectrom. Ion Phys, 1972, 9, 357. M. L. Muga, Anal. Instrum., 1987 , 16, 31. G. E. Yefchak, C. G. Enke, and J. F. Holland, Int. J. Mass Spectrom. Ion Processes, 1989, 87, 313. M. L. Muga, U. S. Patent 4 458 149, 19842. S. N. Deming and S. L. Morgan, Anal. Chem., 1973, 45, 278A. W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, Numerical Recipes, Cambridge University Press, New York, 1986, pp. 292—293. Chapter 4 Beam Deflection in TOFMS “That is the curse of statistics, that it can never prove things. only disprove them! At best, you can substantiate a hypothesis by ruling out, statistically, a whole long list of competing hypotheses, every one that has ever been proposed. After a while your adver- saries and competitors will give up trying to think of alternative hypotheses, or else they will grow old and die, and then your hypothesis will become accepted. Sounds crazy, we know, but that’s how science works!” From Numerical Recipes, by William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vettening All varieties of time-of-flight (TOF) mass spectrometers share a need for sychronized ion packet production; the departure of ion packets from the ion source serves to indicate the starting times for ion velocity measure- ments and the dimension of the ion packet determines mass resolving power. Though most TOF mass spectrometers make use of so-called “pulsed ion sources” (i.e., ion sources which generate ion packets directly), there are a number of circumstances in which it is desirable to use sources which produce ions continuously. Beams produced by these “continuous ion sources”, which are similar to sources used in magnetic sector and quadrupole mass spectrometers, are spatially modulated as described in this Chapter to create the desired ion packets for TOF mass analysis. The $ 87 study of the resolving power aspects of beam deflection TOFMS presented here is part of a manuscript prepared by this author together with Gary Schultz and Drs. J. Allison, J. F. Holland, and C. G. Enke.1 4.1 Background A theoretical treatment of beam modulation techniques in nuclear physics appeared in 1960,2 and in 1973 many theoretical considerations for beam modulation in time-of-flight mass spectrometry (TOFMS) were elegantly described by Bakker.3 Shortly thereafter, Bakker reported the construction of a beam modulation TOF mass spectrometer and an experi- mental confirmation of the theory.4. Various other TOF instruments incorporating beam modulation have since been reported, including those of Pinkston,5 Glish,6 and Eckenrode.7 A beam modulation ion source was also developed for the early Bendix TOF spectrometers by Futrell.3v9 In addition, a similar technique has been used in a tandem TOF mass spec- trometer to select parent ions prior to a second stage of mass analysis.10 The “orthogonal-acceleration” TOFMS instrument recently described by Dawson and Guilhaus11 incorporates beam-deflection in the broadest sense, but the operating principle of orthogonal acceleration differs sum- ciently from conventional beam-modulation techniques to exclude its discussion in this work. Ion packet production by modulation of a continuous beam elimi- nates some of the difficulties encountered with more conventional pulsed- source techniques, particularly when gaseous samples such as those encountered in GC-MS are ionized. With pulsed ion sources, three patterns of ion behavior can lead to decreased mass resolving power.12»13 The distri- 88 bution of initial positions of ions within the source, especially important for gaseous samples, and the distribution of initial ion velocities both lead to a spread in final kinetic energy. This spread in kinetic energy leads to a distribution of arrival times for isomass ions and hence to the loss of resolv- ing power. Furthermore, the thermal motion of ions moving with equal speeds toward and away from the source exit prior to the application of the extraction field results in the “turn-around” separation between isomass ions ultimately having identical on-axis energies. The deterioration of resolving power due to this turn-around problem has normally been the most severe, necessitating the use of high extraction field gradients which minimize the turn-around time in pulsed ion sources. Unfortunately, the use of large field gradients exacerbates the spatial problem; this incompati- bility between space focusing and energy focusing with gaseous samples has been described in the literature. 12» 14 Production of ion packets by modu- lation of continuous beams eliminates the turn-around problem since all ions in the accelerated beam are moving in the same direction. Furthermore, this elimination of the turn-around efi‘ect permits low extrac- tion gradients to be used which significantly decrease the energy spread caused by the initial spatial distribution. For these reasons, studies of beam modulation have been undertaken in an effort to achieve adequate mass resolving power in GC-MS with TOF instrumentation. Both the theoretical and experimental results reported here demonstrate that beam deflection TOFMS is a viable technique for GC-MS when used in combination with time-array detection. 4.2Theory 4.2.1 ModelsforBeamModulation Techniques The ideal, desired behavior of all beam modulation techniques is illustrated in Figure 4-1; a packet having an arbitrarily short temporal width is “chopped” out of a continuous beam. Note that the packet retains the kinetic energy distribution present in the original beam and is finite in . .—) . ) . ’ Continuous r 3 ’ O—* H H H O—> H beam H. ’90 I > H Ion packet ..__,' H ) Figure 4-1. Ideal ion behavior in beam modulation; the process essentially yields a slice from the continuous beam. Arrow lengths indicate relative ion velocities; only isomass ions are considered in this illustration. spatial and temporal width; these are the only nonidealities. All ions depicted in Figure 4-1 and throughout this work have the same mass-to- charge ratio. In actual operation, of course, an instrument would produce ions of various masses. Ion trajectories in a beam deflection instrument are independent of mass, though the velocities of the different isomass packets are mass-dependent. 90 Modulation techniques have so far all relied upon deflection of the beam by an electric field, generated by some voltage function V(t), applied across a pair of deflection plates between which the ions pass. Some portion of the beam is deflected across an aperture, causing an ion packet to emerge from the opposite side. Various V(t) functions may be used to generate ion packets via at least three modes of ion behavior. The ion behavior patterns corresponding to these modes are illustrated in Figure 4- 2. These include a pattern referred to here as the Gate mode, as well as the Impulse Sweeping and Differential Impulse Sweeping modes that were identified by Fowler and Good.2 In each of these modes, the “default” condition, which exists before and after application of the packet-forming voltage pulse, is the deflection of the ion beam away from the aperture. In the Gate mode (Figure 4-2a), the field changes to allow the beam to pass directly through the aperture for some period of time; at the end of this time the field returns to its original state. In this mode, V(t) serves most closely as a “gate”, either preventing or allowing passage of ions through the aper- ture. The Impulse Sweep mode (Figure 4-2b) is similar to the Gate mode, in that the field is pulsed “on” for a period of time and then returned to its original value. In Impulse Sweeping, however, the deflection voltage pulse is short in duration, compared to the flight time through the plates. The pulse serves to add a velocity component perpendicular to the direction of ion motion; the resulting angular trajectories cause part of the beam to be swept into the aperture. Here the width of the emerging ion packet is related, but not equal, to the duration of the deflection pulse. The width and ion trajectories are also mass-dependent in this mode. Impulse Sweeping can be dificult to accomplish, since it requires precise geometrical designs well as a voltage impulse of precisely-defined amplitude. Furthermore, it 91 does not appear to have any advantage over the other two modes, so it will not be discussed further here. In the Differential Impulse Sweep mode (Figure 4-20), the deflection voltage switches polarity causing a “kink” to form in the beam. The portion of this kink which continues to move parallel to the original beam passes through the aperture to form the packet. The Gate mode is the simplest case. Here the width of the ion packet is essentially equal to the duration of the deflection pulse (neglecting the intermediate ion behavior which occurs when the voltage change takes place). Ions which pass through the plates while the deflection field is off continue onward and pass through the aperture; those that pass through before or after this pulse do not. In the description of this mode, the tran- sient ion behavior caused by the voltage change itself is ignored; only the steady-state trajectories either through or away from the aperture are considered. Ion packets produced in the Gate mode are therefore always longer in duration than the flight time of the ions through the deflection plate region. This disadvantage may perhaps be offset by the fact that the Gate mode yields ion packets for which the temporal width is independent of mass. Figure 4-2. Three models for beam modulation techniques. Isomass ions are shown to pass through a pair of deflection plates and move toward an aperture. Relative duration and polarity of the deflection voltage pulse is indicated for each case. The darker shading indicates ions which will pass through the aperture and form the ion packet. a: Gate model; b: Impulse Sweep model; c: Differential Impulse Sweep model. 93 The transient ion behavior which was ignored in the Gate mode is in fact responsible for packet formation in the Differential Impulse Sweep mode. This mode is therefore capable of producing much shorter ion pack- ets. Consider ions which enter the deflection plate region just before the switch in the field direction. (The time under consideration here is some- what earlier than that of the “snap shot” shown in Figure 4-2c.) These ions are deflected downward as they travel through the region. When the field changes polarity, however, they begin to experience an upward force. Those ions that have traveled half-way through the plate region when the pulse occurs will experience equal durations of downward and upward forces and thus exit the region moving parallel to their original trajectory. The aperture is assumed here to be located in line with the initial beam axis and the deflection plates. Some ions very near to the exact half-way point of the deflection plate region at the time of the field reversal will also obtain final trajectories which allow for their passage through the aperture. The extent to which this occurs contributes to the temporal width of the packet and will be discussed in the following section. 4.2.2 IonPacketQuality As derived by Bakker,3 the temporal base width of an ion packet resulting from the Differential Impulse Sweep process is given by the expression w, .9229. an (4.1) LVd 2e where B is the beam width, S is the aperture width, D is the deflection plate separation, L is the distance between the plates and the slit, and V, and Vd 94 are the acceleration and deflection voltages respectively. (That is, the deflection voltage switches from —Vd to +Vd.) The subscript in w 1 is meant to represent “ideal” since this is the width which would be obtained if the ion beam were ideal in terms of kinetic energy and angular dispersion. The principal assumptions for Eq. 4-1 are that the rise time for the voltage change is negligible and, more importantly, that the distance from the plates to the aperture, L, is much greater than the length of the plates. (Note, however, that the actual plate lengths do not appear in the expres- sion.) This latter assumption implies that the aperture should not be placed near the deflection plates but rather at the detector. In fact, it is possible for the detector surface itself to serve as the aperture. In addition to the ideal width w I derived by Bakker, the packet is broadened by the kinetic energy distribution of ions within the packet. Two ions leaving an initial position x = 0 simultaneously, but with differing kinetic energies U and (1 + [3)U, will arrive at a location 1: = L separated in time by At ~ flL(2m/U)1’2/4. Thus an ion packet having negligible initial width but with a normal kinetic energy distribution having standard devia- tion O'U would be broadened, after traveling distance L, to have a half-width given approximately by - 22%. PI: wU - Vae 4 (4‘2) where [3 = 1.670y/Uo. % A third cause for packet broadening was identified in this study for ion beams having nonzero angular divergence. Consider the two ions shown in Figure 4-3. The lower ion enters with no off-axis energy and is initially accelerated downward by the deflection field. As it reaches point a, half-way through the plate region, the field reverses and accelerates the ion in the upward direction. Since downward and upward force are experi- enced for equal periods of time, the ion leaves the region with no off-axis energy and thus is included in the final packet. The upper ion enters the Figure 4-8. Two ions entering the deflection plate region with different trajectory angles. Field reversal occurs when the lower ion is at point a and the upper ion is at point b. region At seconds prior to the lower ion and at an angle 9 from the beam axis. Due to its off-axis energy, this ion continues to move upward for a period of time but is eventually deflected downward by the electric field. This ion experiences the downward force longer than the the lower ion does, since the upper ion travels to point b before the field reverses. This longer duration of the applied downward force, followed by a shorter dura- tion of upward force (experienced from point b to the end of the deflection region), compensates for the initial off-axis energy. The ion therefore % leaves the region parallel to the beam axis and is included in the final packet, despite being offset from the ideal ion by a time At. The value of At which satisfies these conditions may be related to off- axis angle,9, as follows. Consider an “ideal” (i.e. initially on-axis) ion trav- eling with the most-probable velocity vo = (2Vae/m)1’2. An ion entering the deflection plate region with an off-axis angle 9 will have a velocity vector perpendicular to the beam axis given by vy = v0 cos 9. When leaving the region, however, the perpendicular velocity vy’ is zero. If the ideal ion passes half-way through the plate region in time tm, then the off-axis ion experiences downward and upward forces for times tm + At and “/2 — At, respectively. The final perpendicular velocity of the off-axis ion is related to the initial value by the expression V dc V dc v’=0=vsin0-—(t +At)+—-—(t -At) f 0 mD 1’2 mD 1’2 which rearranges to At = % vosin 0 . This represents the broadening of the peak to lower flight times due to ions with trajectories that diverge in the upward direc- tion. (Only two-dimensional motion in the plane of Figure 4-3 is considered here.) For a true beam having a divergence half-angle of 9, those ions having trajectory angles in the downward direction will cause similar broadening to higher flight times as well. Thus the quantity 2At could be used to approximate the base width of a packet broadened only by this angu- lar efi‘ect, yielding 2V m we = 1%- ——e° sin 9 (4.3) 97 Equation 4-3 yields an underestimate of peak broadening due to the angular effect, however, since it is not necessary for ions to be moving exactly paral- lel to the beam axis as they leave the deflection region in order to pass through the aperture. Consider, for example, an ion which enters the deflection region with the same trajectory as the upper ion discussed above but slightly ahead of it in time. This ion would experience even more net downward force than the upper ion pictured in the figure, and would thus leave the region with a small downward velocity component. This final trajectory could, however, still carry the ion through the aperture (at a posi- tion somewhat below the point at which the pictured ion passes through). Ions acting in this way, as well as the analogous ions having initial down- ward motion, serve to futher increase the final packet width. Though Eq. 4- 3 cannot be used to obtain the complete magnitude of the peak broadening due to angular divergence, the digital simulation described below can be used to measure this efi‘ect. The broadening caused by ions with positive and negative initial trajectory angles need not be symmetric, since in both cases the forward velocity (in the direction of the beam axis) of these off-axis ions is reduced from the ideal velocity by a factor of cos 0 for ions having the same kinetic energy. The flight time for ions having an initial downward velocity component is increased over that of the ideal ion both by their lower velocity in the beam axis as well as the angular efi‘ect described above. For the ions having some initial upward motion, however, flight times tend to be decreased by the angular effect but increased by their reduced velocity. The net result of this is that the peak is skewed toward higher flight times. % It is difficult to combine the expressions for w 1, wt}, and we directly to obtain an expression for true peak width, but any of the expressions can be used alone to approximate peak widths for cases in which one effect (geometry, energy distribution, or angular divergence) predominates. The combination of the three effects was explored by means of digital simula- tions as described below; the individual expression were useful for. checking the validity of these simulations as well. 4.3 Simulations In order to explore the combination of the energy spread and angular divergence effects with the ideal packet width given by Eq. 4-1, computer programs were developed to model ion packet behavior. First, an anima- tion program was developed which illustrates ion behavior in beam modu- lation by moving colored dots, representing individual ions, across the screen of an IBM AT-compatible computer. (This program was used to ascertain the pattern of ion motion shown in Figure 4-3.) Then a simulation program was written to generate peak shapes for beam modulation TOFMS. The method used for this simulation will be explained with the aid of Figure 4-4. The program models the motion of various ions, chosen systematically from the region indicated, by means of Runge-Kutta integration through the deflection plate region and onward to the aperture. Flight times for those ions found to pass through the aperture are tabulated in the form of a histogram to generate the peak shape. The three grey regions in Figure 4-4 are meant to indicate the locus of points occupied by these ions at three instants in time: prior to entering the deflection region, Q part-way along the flight path, and just after passage through the aperture. (See ref. 3 for a complete description of the shapes of these regions.) Packet prior Packet while Final to deflection in beam packet / / h—d Search area Figure 4-4. Illustration of ion behavior modeled by the simulation program (see text). An example of the output from this program is given in Figure 4-5 for the parameters shown in Table 4-1. The peak widths obtained by this simulation method may be approximated by means of Eqs. 4-1—3 by using calculated values of wt, wt], and we to obtain estimates of peak variances. The variance of the overall peak is then given by the sum of the contributing variances. Examples of this process and comparisons with the simulated peaks are summarized in Table 4-2. Values for variances shown in paren- theses were calculated as the difference between the other simulated values under the additivity-of-variances assumption. The peak shape obtained by the Baker effect alone may be approximated as - a triangle. (This was found to yield more accurate results than a rectangular peak shape.) The variance of an isosceles triangle having a base width w I is given by w12/24. Similarly, the variance contributed by the angular efl‘ect may be approxi- 100 mated by w92/12; a rectangular peak shape is assumed here to model cases in which all values of 0 within the limits given are equally likely. If the peak shape corresponding to the energy efl‘ect is assumed to be normal with a standard deviation of wU/2.35, the variance contributed by the energy effect is then (w U/2.35)2. The accuracy of the simulated peak variances cannot be well-characterized without, for example, detailed Monte Carlo analysis, but these widths are believed to fall within a few percent of the true values. Note that the prediction of peak widths from variance calcula- tions is unreliable, in particular for the angular divergence effect. This is due to the variety of peak shapes (nearly rectangular to nearly Gaussian) which can occur as the various parameters are altered. For cases in which the angular divergence is very small (e.g. 9 < 0.01°), the predictions can be quite accurate; this was the case in the experimental study described below. Table 4-1. FEameters used for simulated beam deflection peak shape. 1000 u 500. V 100. V 1.500 0.005 0.005 0.003 or =. 1.67(kBT/2) = 0.0215 eV to CD wMUh§°<3 8 BB 8 101 fible 4-2. (Ymparison of peak variances obtainedfrbm calcula- tion using Eq. 1—3 and from digital peak shape simulation. Source of calculated calculated simulation peak broadening base width variance variance x10‘9 8 x10"18 8 x10'18 8 Bakker effect 13.6 8 9 Energy 7.7 11 (11) Angle 8.9 7 (16) Bakker 4» Energy — 19 2) Baker + Angle — 15 % Bakker + Energy + Angle — as 35 0.1' Intensi 0.0 e - . - - - . 150.62 150.64 150.66 150.68 Flight Time (us) Figure 4-5. Simulated peak shape for m/z 1000. —Bakker effect only,--° Bakker effect with energy dispersion, --- Bakker effect with angular dispersion, -- — all effects combined. 102 4.4 Experimental Results A spectrum of perfluorotributylamine (PFTBA) was obtained by Schultz with direct inlet introduction with an ion source temperature of 150°C; 5000 transients were collected in 1 s and summed by the ITR. A comparison of peak base-widths for major ions in this spectrum to those produced by digital simulation is shown in Table 4-3. For the simulated data, parameters matching the physical dimensions and voltages of the instrument were used, namely L = 2.1 m, S = 6.35 mm, B = 0.13 mm, D = 13 mm, Va = 3000 V, and Vd = 63 V. The standard deviation of the kinetic energy distribution, on, was approximated as 0.5 eV based on the potential distribution within the source; the angular divergence of the beam was neglected. The slope of base-width vs. W for the experimental values is calculated to be 3.7 :1: 0.2 ns, and that for the simulated data is 4.0 i 0.1 ns, demonstrating that the instrument performance follows the theory described above. An “expected” slope can be obtained by summing Eqs. 4-1 and 4-2, then factoring out m. This procedure yields a value of 3.9 us if 5 is assigned a value of 6oU/Uo to represent base-widths. This simple method is not appropriate when the angular divergence is large, but it is quite adequate for this case. 103 Table 4-3. Comparison of measured and simulated peak widths. - ma Measured Simulated (:5 ns) (:3 ns) m 40. 38. 100 36. 42. 131 52. 46. 219 64. 61. %4 67. 69. 502 88. 92. 45 Practical Considerations 4.5.1 Mass Resolving Power The PFTBA spectrum described above was obtained with unit or better mass resolution up to at least m/z 502. An estimate of the upper mass limit for unit mass resolving power with this instrument can be found as follows. The flight time separation between ions of two adjacent m/z values is given by -161. At-WUm/z-l-l—Vm/z) (44) where u is the atomic mass unit. Eq. 4-4 may be appron'mated by the first term of the Taylor series as At ~ _IdiI__ 2%? (4-5) In the previous section, the peak base width was found to be given approxi- mately by 3.942751... (Either the experimental slope or the value found via simulation could also be used.) For simplicity, the width at half-height may be approximated as half of this value, thus 104 1017/2 '3 2.0 X 10—9 m/z 8 (4'6) Setting At ~ 501,2 yields the m/z value at which peak separation just equals peak width at half-height, and hence the approximate upper m/z limit for unit mass resolving power. For the parameters in this example, this upper limit is an m/z value of 708. An improvement could be made if an ion mirror were incorporated into the instrument. The ion mirror would remove the efl‘ect of the energy dispersion and, in addition, increase the effective flight path length by a factor of four. (The decreased flight time in the mirror contributes a factor of two, while the travel in the forward and reverse directions through the flight path contributes another factor of two.) In this case, the expected slope is obtained from Eq. 4-1 alone and has the value 2.5% ns. Using this value, and replacing L by 4L in Eq. 4-5, the upper m/z limit increases to 4400. This is certainly adequate for most GC-MS applications. 4.5.2 Signal-toNoise Considerations It would appear that beam modulation in TOFMS would experience greatly reduced detectability and sensitivity due to the very small portion of the ion beam that is selected for detection. In addition, it would appear that the beam dimensions required for beam deflection, which are much smaller than those in conventional TOFMS, would further contribute to poor ion statistics. It is important to realize, however, that during the time an ion packet is striking the detector, the measured ion flux is the same as that seen from a continuous beam. The consequences of this have been analyzed in detail by Enke,15a1 who showed that TOFMS with TAD enjoys a significant SIN advatage over scanning mass spectrometers. 105 4.6 Conclusions Beam deflection is becoming a common technique in TOFMS, yet beam deflection systems are often designed with the assumption that the ion behavior so produced will follow the Gate model. For optimum time- resolution, however, the more complex Differential Impulse Sweep mecha- nism is required. This study has shown that accurate predictions of ion behavior under this model can be obtained either by simple inspection of the equations given or by digital simulation of ion motion. Such predictions can be of assistance in the design of beam deflection TOFMS instruments. The study has also demonstrated that a beam deflection TOFMS instrument incorporating an ion mirror and an ITR would have mass resolution and sensitivity suitable for modern GC-MS applications. REFERENCES 1 G. E. Yefchak, G. A. Schultz, J. Allison, C. G. Enke, and J. F. Holland, submitted for submission in J.A.S.M.S. T. K. Fowler and W. M. Good, Nucl. Instrum. Meth. 1960, 7, 245. J. M. B. Bakker, J. Phys. E: Sci. Instrum., 1973, 6, 785. J. M. B. Bakker, J. Phys. E: Sci. Instrum., 1974, 7, 364. J. D. Pinkston, M. Rabb, J. T. Watson, and J. Allison, Rev. Sci. Instrum., 1986, 57(4), 583. 6 G. L. Glish and D. E. Goeringer, Anal. Chem., 1984, 56, 2291. 7 B. A. Eckenrode, J. T. Watson, C. G. Enke, and J. F. Holland, Int. J. Mass Spectrom. Ion Processes, 1988, 83, 177. 8 J. H. Futrell, T. D. Tiernan, F. P. Abramson, and c. D. Miller, Rev. Sci. Instrum., 1968, 39, 340. 9 C. D. Miller, T. D. Tiernan, and J. H. Futrell, Rev. Sci. Instrum., 1969, 40, 503. 10 K. Schey, R. G. Cooks, R. Grix, and H. Wollnik, Int. J. Mass Spectrom. Ion Processes, 1987, 77, 49. memento 11 J. H. J. Dawson and M. Guilhaus, Rapid Commun. in Mass Spectrom., 1989, 3, 155. 12 G. E. Yefchak, C. G. Enke, and J. F. Holland, Int. J. Mass Spectrom. Ion Processes, 1989, 87, 313. 13 W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum., 1955, 26, 1150. 14 R. Stein, Int. J. Mass Spectrom. Ion Physics, 1974, 14, 205. 15 C. G. Enke, Proceedings of the 37th ASMS Conference on Mass Spectrometry and Allied Topics, Miami Beach, Florida, May 21-26, 1989. Chapter 5 Combination of a Pulsed Electron Impact Source with an Ion Mirror “I have yet to see any problem, however complicated, which when you looked at it the right way did not become _still more complicated.” P. Anderson As the DFF project was nearing its completion, Dr. Enke delivered a presentation at an American Society for Mass Spectrometry meeting1 in which he pointed out the requirement of non-static fields for complete focusing, as well as the other issues discussed in section 24. The specific point illustrated in Figure 2-7 (that initially-moving ions would be spatially focused at some location distinct from the nominal space-focus plane, and hence ion mirrors could not be used in this situation) caught the attention of Professor Hermann Wollnik; after the presentation, Wollnik told Enke of a gas-phase electron impact ion source which could be used together with an ion mirror without serious complications from this efi'ect. Preliminary results from Wollnik’s laboratory in Giessen, Federal Republic of Germany, indicated that resolving powers as high as 20,000 (FWHM) had 107 108 been achieved with this source. With encouragement fiom these results, together with Wollnik’s desire to import the ITR technology to his laboratory, a collaboration between MSU and the Giessen laboratory was begun. This collaboration has so far resulted in the construction of an instrument similar to those in Giessen, with the novel ion source and a grid-free ion mirror, for use at MSU. 5.1 Background A schematic diagram of the Wollnik-type instruments is shown in Figure 5-1. Instruments in this family have been termed M-TOF instruments, where “M” represents “mirror”. This name was chosen for consistency with other TOFMS instruments at MSU (e.g., the B-TOF and E- TOF spectrometers), and so it is generally used to refer to the particular Wollnik-type instrument now located at MSU, rather than to those in Giessen. The source consists of a three-grid storage or trap region, in which ions are formed by the emissions of a nearly-circular filament, and an acceleration region, through which ions exit after extraction. The ions are formed continuously by the filament current, and some of these ions are confined to the trap region by a potential well formed by voltages applied to the three grids. (A more detailed description of the trapping process is the subject of studies described below in §5.3.2.) At the time of extraction, the potential applied to the center grid is raised (see Figure 5-2), so that the electric field between the first and second grids matches that between the first grid and the aperture at the end of the acceleration region. This electric field accelerates the ions out of the source and toward the ion mirror. The mirror is somewhat more complex than the homogeneous- 109 field mirrors illustrated in Figures 2-5 and 2-6, since it incorporates no grids. The field distribution is therefore inhomogeneous (i.e., it varies in two dimensions, rather than just one) so that the device acts as a lens as well as a mirror. An Einsel lens, placed between the source and the mirror, acts in combination with the lens function of the mirror to focus the reflected ion packets spatially (as well as temporally, of course) on the detector. Einsel Source Lens Mirror lnilll Ill llllllllll 3W (a) I“; ................................................................................. “lulu” Detector Electron Pushers Filament (c) Figure 5-1. a: Schematic diagram of the Wollnik-type instruments showing ion source, mirror, detector, and nominal ion path. 1): three-dimensional view of the ion source showing circular filament and “electron pusher” electrodes. c: Block diagram of the M-TOF. 110 I I I I I Tj I G4 GB G2 G1 G4 G3 G2 G1 (a) (b) Figure 5-2. Applied potential profile within the Wollnik ion source. a: storage mode, b: extraction mode. Preliminary results fiom an instrument similar to that pictured in Figure 5-1 demonstrated a resolving power of about 20,000 (FWHM) for m/z 866.2 (This instrument had an overall length of approximately 4 m and a total flight-path length of about 7 m; the accelerating potential used when these data were obtained was 500 V.) The FWHM value for the m/z 866 peak was about 20 ns. An attempt was made by this author to compare these experimental results with those of a digital simulation. Since the ion motion within the grid-free mirror is quite complex, and since the tools needed to simulate such trajectories were not available, ion motion was at first simulated only up to the nominal space-focus plane of the source. This is equivalent to simulating a perfect ion mirror, since such a mirror would simply reproduce, at its object plane (the detector surface), the ion behavior which occurs at its image plane (the space-focus plane). The results of this study are presented in Figure 5-3. Since a perfect mirror was assumed in this study, it would seem that the simulated peak should have a width somewhat smaller (or at least not larger) than the peak obtained experimentally with a real mirror. In fact, however, only peaks simulated 111 for extremely low ion temperatures showed widths less than or equal to that of the experimentally-obtained peak; simulations for more “realistic” temperatures produced much broader peaks. source which performs “better than it should” was both serendipitous and puzzling. While plans for applying this source technology were proceeding rapidly, therefore, a parallel effort was taken by this author towards elucidating the ion behavior mechanism responsible for the unexpectedly high resolving power. .3; III: .6 .- . l J“ ‘a g 1 ' I “\t - ’5 4 O MM/‘I I I ' 7.55 7.56 7.57 7.58 7.59 Flight Time (us) 7.60 The discovery of an ion Experimentally- obtalned peak 7.61 Figure 53. Simulated peak shapes for m/z 866 from various initial kinetic energy distributions (temperatures) calculated for parameters matching the 4 m Wollnik instrument in Giessen. The peak corresponding to 50 K is most similar to the experimentally obtained peak. 112 5.2 PreliminaryStudies oronBehaviorintheWollnik Source The first modeling program used in this study of the Wollnik source simulated ion behavior from the time of extraction until the time of arrival at the nominal space-focus plane. The geometry and potential profile of this situation, as reported by Grix, et al.2, is shown in Figure 54. Prior to the time of extraction, the potential applied to grid 3 is held slightly lower than that of grids 2 and 4. (The field shape resulting fi‘om these grid potentials i “1+2az i ament G4 G3 G2 I?" Hun I ll / Electron Space-Focus “Pushers” Plane V I I I I G4 G3 G2 G1 Figure 5-4. Geometry (above) and potential profile (below) of the Wollnik source. In the illustration of potential between G4 and G2, the shaded lines represent the storage condition; black lines represent the potential during extraction. 113 forms, or at least affects, the potential well in which ions are trapped.) At extraction, however, the voltage applied to grid 3 is raised to the value needed to make a linear acceleration field across the region of grid 3 to grid 1. The ions are accelerated out of the source and achieve good temporal focusing at the space-focus plane, located at the distance a1 + 2a2 from grid 1. In order to generate peak widths similar to those of the experimentally-produced peaks, the temperature parameter used by the program had to be set to approximately 50K (recall Figure 5-3). The value for this parameter, which essentially determines the initial energy distribution of ions in the source, has typically been set to 500 K in other studies; this higher value is thought to represent the true kinetic energy distribution in a typical TOFMS electron impact ionization source. To verify that the assumption of a perfect mirror, and hence the simulation of ion motion only from the source to the space-focus plane, did not in some way yield erroneously-high peak widths, motion through a complete mirror instrument was simulated as well. The resources necessary to model the grid-free Wollnik mirror were not available, so the two-stage homogeneous-field mirror simulation developed with Damaschin Ioanoviciu (described in §6.2.3) was used to model ion extraction out of the Wollnik source, motion through the field-free regions, and motion within the mirror. This more complex study produced peak shapes almost identical to those of the perfect-mirror model. These results clearly indicated that some unexplained behavior within the ion source— something not modeled by the simulation programs—was causing the reduced peak widths. 114 5.3 A Model for Ion Behavior in the Wollnik Source The search for one or more mechanisms which could explain the surprisingly narrow peak shapes discussed above lasted for over a year. During this time, the collaboration between MSU and the Giessen laboratory began to develop, first with a short visit by Enke and Holland to Giessen. Experiments performed at that time, which revealed primarily that GC-MS should be possible with a Wollnik-type TOFMS instrument, led to a three-month visit to Giessen by Dr. Ron Tecklenburg, as well as several trips to MSU by Wollnik. Tecklenburg succeeded in performing the first GC-TOFMS experiments using a Wollnik-type instrument. Meanwhile, Enke, Holland, and this author formed a hypothesis for the ion behavior which could account for the high mass resolving power seen in the Giessen experiments. More recently, Mary Puzycki (from the Enke laboratory) spent three months in Giessen working, in part, to carry out experiments designed by this author to test this hypothesis. Finally, Dr. Raimund Grix, who was heavily involved in the development of the Wollnik-type instruments, came to MSU to participate in the M-TOF project here. 5.3.1 The Revised Model Simulation Grix indicated to this author that calculations of peak widths made in Giessen did not yield results which differed as severely from the experimentally-measured widths as those shown in Figure 5-3. The Giessen calculations were not as sophisticated as those described above, in that they did not produce entire peak shapes, but they were thought to be sufficiently accurate to warrant concern over the validity of this author’s 115 results. A search for some modification to the model which would yield narrower peak widths was therefore carried out. It seemed possible that the optimum focus might occur at some location other than the space-focus plane. Consider, for example, case E+ (recall §2.2). The ideal and non- ideal ion are initially located at the same positions and become continuously more separated as they travel along the flight path. Though spatial focus (i.e., compensation for the case S effect) occurs at the space-focus plane, therefore, dispersion due to case E-l- must be more severe at that location than anywhere prior to it. A “compromise” between space and energy focusing might be reached at some intermediate location. Simulations were performed to calculate peak widths at a variety of locations on both sides of the space-focus plane, but'the minimum width was found to occur precisely at this plane. An hypothesis for ion behavior was eventually developed which accounts for a significant degree of peak narrowing (see the following section), but this ion behavior still did not account for the extraordinarily- narrow peaks seen in Giessen. Eventually, however, it became clear that the compromise between space and energy focusing sought above could be reached by increasing the extraction field strength between G2 and G3 relative to that between G1 and G2. This would produce a two-stage extraction field which would behave in the opposite manner to the Wiley- McLaren two-stage source (see §2.3.1). That is, the space-focus plane would be moved closer to the source exit, where the energy dispersion would be reduced. Discussion with Grix indicated that, indeed, the optimum performance was achieved with an extraction pulse applied to G3 having a greater magnitude than that indicated by Figure 5—4. 116 The position of the space-focus plane may be found from Eq. 5 of Wiley and McLaren3, shown here as Eq. 6-1. 1ng = 211r3’2 (1— LL ) 11(r + r1/2) (6-1) In this expression, lsfp is the distance from the source exit to the space- focus plane, 11 is the distance from the center of ionization to G2, 12 is the separation between G2 and G1, and r is a quantity given by the expression r = (llEo +12Eb)/11Ea, (6-2) where Ea and E5 are the field strengths in the regions G3 to G2 and G2 to 120}I 11o- . i ’37 100- I E 90- i k . i l g 80- . l i 70- i 60 . . . . . . - 1 . u 1.00 1.02 1.04 1.06 1.08 1.10 VoltageFactor,f Figure 5-5. Plot of ion packet width (analogous to peak base width) as a function of the electric field strength between grids G2 and G3 using a temperature of 500 K. The abscissa, “Voltage Factor”, is the quantity f defined in the text. For f values above 1.06, A widths at source exit; 0 widths at space-focus plane (see text). 117 G1, respectively. To test the two-stage extraction field theory, ion packet widths were simulated for a range of field distributions established by the potentials 0 V, 450 V, and 500f V applied to G1, G2, and G3, respectively. (For a completely linear field, f would be unity.) The ratio 12/11 was approximated with a value of 0.9. For each value of f, the position of the space-focus plane was calculated from Eq. 6-1, and packet widths were simulated for travel to that position. The results of this study, using a temperature of 500 K, are shown in Figure 5-5. As the G3 voltage is increased, and hence the field between G2 and G3 becomes greater with respect to that between G1 and G2, the packet widths (analogous to peak base widths) decrease. The field strength between G2 and G3 can be increased only to a certain limit, however, before the space-focus plane becomes located behind the source exit (i.e., lafp becomes negative). The value off corresponding to this limit may be found by setting 14,, = 0 in Eq. 6- 1 and solving for r, then substituting this value into the expression r = 500f/ (500f- 450), which is equivalent to Eq. 62 for the values under consideration. This yields a result of f = 1.065. Packet width values for voltage factors greater than this value are shown in Figure 5-5 both as the “ideal” width at the calculated space-focus plane position and at the source exit. Note that no practical problem is caused by the space-focus plane being located behind the source exit, or even entirely behind the source. The situation is somewhat analogous to that of a virtual image in light optics; the mirror (i.e., mirror voltages) must be tuned to view the space- focus plane as a virtual source, but the position of this plane relative to the actual ion source is irrelevant. 118 The temperature study shown in Figure 5-3 was repeated for the two- stage extraction field case with the parameter f set to 1.06. This value was chosen, after discussion with Grix, to correspond approximately to the conditions used in the Wollnik source to obtain the experimental data in i l 10 f I ' I ' I v 1 v ' 0 100 200 300 400 500 Temperature(K) Figure 5-6. Plot of peak width at half-height as a function of initial ion temperature calculated for parameters matching the 4 m Wollnik instrument in Giessen with a two-stage acceleration field. The horizontal line indicates the experimentally-measured peak width. question. (Recall that this author’s suggestion of the two-stage acceleration field was made on purely theoretical grounds; only later did dialogue with Grix provide confirmation of the theory.) The results of this study are shown in Figure 5-6 as a plot of peak width at half-height (i.e., FWHM) 119 versus ion temperature. In this revised model, the temperature corresponding to the measured peak width is approximately 150 K, rather than the 50 K or less indicated by the initial study. This new value seems somewhat more reasonable than the initial estimate, but a temperature of 150 K still would seem rather low for an electron-impact source. Thus, it seems that an additional mechanism responsible for resolving power enhancement must be at work. The hypothesis developed prior to discovery of the two-stage acceleration field appears to account for the remaining effect; this subject is addressed in the following section. 5.3.2 The “Velocity-Ines” Hypothesis Prior to discovery of the two-stage extraction field described above, Enke, Holland, and this author attempted to explain the high mass resolving power of the Wollnik-type instruments in the following way. Studies made in Giessen strongly suggested that a significant number of ions are stored in the source prior to application of the extraction field, so it seemed likely that a “plasma-like” ensemble of ions and electrons must exist in the ionization region (and hence the “storage region”) of the source during this “storage time”. Such an ensemble, consisting of electrons and ions (positively charged ions, in particular) would be, in effect, a conductor. Except under the passage of current, the electric field within a conductor is uniform; the potential profile through the storage regi0n was therefore hypothesized to be nearly flat, in contrast to the profile suggested by the voltages applied to the grids illustrated in Figure 5-4. Under the assumption that this was the case, it was first thought that ions having significant kinetic energies would escape from the storage region during 12) the storage time. Because only ions having very low kinetic energies would remain at the time of extraction, the ion behavior (i.e., peak widths) observed would correlate with that of a very low temperature sample. The peak width for the temperature of 50 K in Figure 5-3, for example, would correspond to a 2x10“3 eV barrier. (This is obtained from the relationship U = 1/2kBT, where U is the energy for a system with one degree of freedom; the one-dimensional treatment is used here because only motion along the flight-path dimension is of consequence.) Similarly, the value of 150 K indicated by Figure 5-6 would correspond to a barrier of 6x10“3 eV. Such low values for the trapping field depth seemed plausible under the assumption that the plasma-like ensemble of particles should act nearly like a conductor. The assumption of a nearly-flat potential field contradicts somewhat the study of Baker and Hasted,4 however, who derived an expression for the potential distribution within an electron beam used to trap positive ions. This potential distribution function is mathematically complex, but it can be described in general as a radially-symmetric function which decreases to a minimum value at a certain radius from the beam center and then increases from there outward. Positive ions having hnetic energies less than the depth of the well would be expected to occupy the radial trap region. The shape of the trap is a consequence of two opposing contributions: the potential caused by space charge of the electrons alone would have a minimum at the center of the beam and increase monotonically outward, while the positive ions alone would yield a maximum potential at the center and would decrease monotonically outward. Except for the shape of the trapping potential, however, the ion behavior described in this work seemed fairly similar to that described 121 above. No clear procedure for calculation of the well depth could be found for the geometrical configuration of the Wollnik source. A sample calculation in the article indicated that trap depths of more than 0.1 eV could be “readily obtained” for the case of a cylindrical electron beam confined by a magnetic field, and this author’s attempt to apply the Baker and Hasted equations to the Wollnik source geometry also resulted in a value of nearly 0.1 eV for the well depth. These calculations may have little relevance to the Wollnik source, however, since there are at least two potentially important differences; the Wollnik source does not incorporate a magnetic field, and the electron current emitted from the circular filament is quite different fi'om that in a linear beam. The potential well depths suggested by the Baker and Hasted study differ by two orders of magnitude from those indicated by the simulations described above. This author maintained, however, that the local hypothesis for Wollnik-source ion behavior was viable enough to warrant experimental investigation. A complete statement of the proposed hypothesis is given below. The superposition of the electric fields applied to G2, G3, and G4 with the electron space charge yields a region of nearly-constant potential between G2 and G3. (The potential is slightly lower near the middle of this region, along the plane of the filament.) The formation of positively charged ions in this region contributes to near-flatness of the potential in this region as well. This near-flat potential is established fairly rapidly, relative to the storage time. Ions formed in the trap region after establishment of the near-flat potential acquire energies given by the sum of their initial kinetic energies and the potential energies associated with their point of formation on the electric field potential surface. 122 The newly-formed ions move about in the trap region according to their energies. Those with sufficient energies and directions of motion escape from the region and are lost. Others oscillate in the region; some of these strike wires of G3 and are also lost. Eventually, only those ions which do not acquire kinetic energies sufficient for escape from the trap region are left when the extraction field is applied. At the time of extraction, these ions gain final kinetic energies which are the sum of their kinetic energies at that time and their initial location on the extraction—field potential surface (not the same as their initial location on the trap potential surface). As the storage time is increased, an increasing fraction of the generated ions are able to leave the trap. Those ions having greater kinetic energies are most able to leave; thus, the spread of final kinetic energies decreases as the storage time is increased. (In an alternate model, the trap region becomes more nearly flat as more positive ions are formed; this would result in a similar relationship between final kinetic energy spread and storage time.) Experimental work performed in order to test the validity of this hypothesis is described below. 5.3.3 ExperimentalStudiesinGiessen The studies of ion behavior in the Wollnik-type source were begun several months before the MSU M-TOF was available, so this author suggested a number of experiments to be peformed by Puzycki on a 1 m Wollnik-type instrument in Giessen. The first of these was to measure true ion-packet widths near the nominal space-focus plane by placing the detector at various positions shortly past the ion source exit. If the ions were to act as expected, a minimum packet width should be observed for a certain flight path (i.e., when the detector is placed at the true space-focus 123 plane). If some other behavior were found, such as packet widths which increase monotonically with increasing path length, this would indicate a serious incompatability between the Wollnik source and the Wiley/ McLaren-like treatment used to model it. Puzycki found that this experiment had already been done by workers in Giessen. As expected, the packet widths reached a minimum when the detector was located precisely at the nominal space-focus plane. (A completely linear field, i.e., f = 1, was used for this study.) Thus, it would seem that the most general aspects of the model are correct. The remaining studies described here were made with the detector located at its normal position. The next experiment suggested by this author was to record the effect of the voltage applied to- G3 on peak width and intensity. It was reasoned that if the trapping process depended strongly the electron space charge, little effect on peak shape would be seen for small changes in the grid voltages. Adjustment of the G3 voltage would shift the overall potential of the entire electron cloud rather than changing the potential distribution within the cloud. If, however, a precise relationship between the G2 and G3 voltages were required, changes in the G3 voltage in the millivolt range (i.e., comparable to the proposed trap depth) should strongly affect the peak shape. Puzycki found that the G3 voltage could be varied over a range of about 1 V without significantly affecting peak shape or intensity. It seems, therefore, that the trap shape is determined primarily by the electron space charge. Under this author’s proposal that the more energetic ions preferentially escape from the trap, the observed peak widths should decrease as storage time is increased (i.e., as the extraction frequency is 124 decreased). This is because a greater proportion of the “faster” ions would escape, compared to the “slower” ions, per unit storage time. Puzycki therefore measured peak widths and intensities as a fimction of extraction frequency. In this experiment, as well as those described below, the m/z values chosen for observation are those for major “background” ions; no sample introduction was used. Results from this study are shown in Figure 5-7. As the storage time is increased (right-to-left on the frequency axis), the peak width (FWHM) decreases from 14.0 us to about 10.5 ns. The sigmoidal shape of this curve is consistant with that of curves observed for other m/z values. From the peak-width data alone, it would seem that the preferential loss of high-energy ions occurs as predicted. The situation becomes more complex, however, when the intensity data are considered. For the frequency range in which peak width decreases with increasing storage time, the peak intensity exibits a corresponding increase. This would indicate that though the proportion of “faster” ions decreased with storage time, the total ion population increases with storage time. This is explained by the fact that ionization continues throughout the storage time in this experiment, and hence the more energetic ion can be replaced by nacent, less-energetic ones. An attempt was made to pulse the filament voltage in such a way that a constant ionization period was maintained as the storage time was varied, but experimental dificulties made the results from this experiment inconclusive. Note that both the decrease in peak width and the increase in peak intensity cease as the storage time is increased to 500 ps (i.e., as the extraction frequency is reduced to about 2 kHz). It would seem that the ions remaining in the trap beyond this time do not have suflicient kinetic energy to escape. As the storage time is increased beyond this value, however, the intensity begins to decrease. This 125 is unexpected, since ionization continues to occur throughout the storage time. According to the Velocity-Loss hypothesis under consideration, more and more ions should be able to escape from the trap as the storage time is increased. A continuous supply of new ions was provided during the trapping time, however, since the electrons continued to be emitted by the filament throughout the storage time. Consider, then, a model of ion storage in which the number of trapped ions, n, behaves according to the expression dn/dt = 121 — kgn. Here 161 represents the constant formation rate, and Inn represents a loss rate proportional to the number of trapped ions. (This is a reasonable approximation for the loss process, but this treatment does not attempt to model the velocity-dependent loss postulated in the Velocity-Loss hypothesis.) The solution to this equation yields the k function n(t) =%1-;1e4¢; this is simply a growth curve which rises 2 . 2 exponentially from zero, at t = 0, to the limit k1/k2 at infinite time. That is, the intensity (related to the number of trapped ions at the time of extraction) would increase and eventually level off with increasing storage time under this model. This steady-state condition (in which the intensity would level off after the formation and loss rates became equal) was expected to occur, since it was believed that the trap region would become “full” in the sense that the electron space chage would repell all positive ions beyond a certain population. The eventual decrease in intensity observed with increasing storage time suggests, however, that steady-state was not achieved. 1500- -15 /‘ . Intensity " 13 1000 - a FWHM ' 12 500 u ‘ Intensity (counts/shot) FWHM (ns) 1 ‘M e" A o I __'-‘ I I I ' I ' I ‘ I 10 0 2000 4000 6000 8000 1 0000 Extraction Pulse Frequency (Hz) Figure 5-7. Plot of peak width (FWHM) and intensity for m/z 18 as a function of extraction pulse frequency. It appears that some mechanism in which the loss rate eventually exceeds the formation rate must be used to account for the observed data. Perhaps this mechanism would include a decrease in the ion formation rate (assumed up to this point to remain constant), but no evidence for this has been developed to date. On the other hand, some evidence suggests that the eventual loss in intensity observed for m/z 18 ions discussed above might be caused by their preferential loss relative to higher-mass ions. Plots similar to those in Figure 5-7 obtained by Puzycki for other masses suggests that the storage time corresponding to the maximum intensity varies as a function of m/z. The curve for m/z 4 reached a maximum at about 4 kHz, while the curve for m/z 220 seemed to remain fairly constant as the 127 frequency was varied. This seems to indicate that as storage time is increased, ions having very light mass (i.e., m/z 4) are depleted and replaced by higher-mass ions (i.e., m/z 18). As storage time continues to increase, these ions are replaced by even heavier ones. No decrease in intensity was observed for the m/z 220 ions, which would be expected since these were the heaviest ions in the experiment having significant abundance. Since ion velocity in the source is proportional to the square root of m/z, this preferential loss of low-mass ions is in accord with the Velocity-Loss hypothesis. Regardless of the mechanistic details, the change in peak width caused by variation of the extraction frequency must point to the “unexplained behavior” responsible, together with the two-stage extraction field, for the extrordinarily high resolving power in the Wollnik-type instruments. 5.4 Studies Performed with the MSU M-TOF After the M-TOF arrived at MSU, a period of several months passed before fairly reliable operation was achieved. During this time, the occasional periods of M-TOF operation often occurred concurrently with periods in which the ITR was inoperative. When all components of the system were working, most of the work done was aimed at implementing and demonstrating the performance of GC-MS. Future studies are planned to further explore the effect of extraction frequency on peak shape. In particular, plans are underway to permit separate control of the ionization and extraction periods so that effects of storage time alone, rather than combined storage and ionization time, can be studied. Results from these 128 future studies will be presented at the upcoming American Society for Mass Spectrometry conference.5 One interesting discovery was made by accident with the M-TOF when it was found that the instrument had been running for several days with no voltage applied to G4. This author had previously thought that floating G4 might eliminate the trapping behavior, so that the source would operate similarly to a conventional TOFMS pulsed source. The apparent irrelevance of the G4 voltage, however, further indicates that the space charge located between G2 and G3, rather than the fields defined directly by the grids, has the dominate effect on ion behavior. An example of the mass resolving power achievable with the M-TOF is shown in Figure 58 The compound tris(heptafluoropropyl)-S-triazine, often used in mass calibration, was introduced into the M-TOF by drawing about 0.2 ul of the pure liquid into a syringe and then inserting the syringe into the GC inlet without advancing the syringe plunger. This procedure, which is the only convenient method of direct sample introduction available, other than chromatographic introduction, provides a steady supply of the sample material which lasts for ten minutes or more. (This method of sample introduction is not suitable, however, for studies of sensitivity or detection limits. Such studies have not been carried out directly by this author, but preliminary studies made by other workers at MSU have indicated that detection limits in the low picogram range will be feasible. Sensitivity and detection limit values will be reported in the future.6) The voltages applied to the various source elements are listed in Table 5-1. The ITR was used to sum 2500 successive transients with a 5 kHz extraction frequency, therefore the summed spectrum was collected in 129 500 ms. (That is, scan files representing summed spectra were generated at a rate of 2 Hz.) Two regions of the observed spectrum are shown. In Figure 5-8a, a resolving power of 920 is seen for m/z 28. In Figure 5-8b, the m/z 466 peak shows a resolving power of 1500. In fact, much higher resolving power was observed via oscilloscope; data obtained with the ITR suffer from peak broadening of several nanoseconds. The lower resolution observed for the low-mass region occurs because peak broadening by the ITR afl‘ects narrow, low-mass peaks more severely than the wider, high- mass peaks. 120001 4000 1 as , 100001 . 45° 4 am: so 6000< . 5 60001 E 20004 40001 ‘ 20001 . I , 0----.----.fifi ....... f---.----. 22.5 23.0 23.5 24.0 24.5 91.0 91.5 920 . Flight Time (118) Flight Time (us) (a) (b) Figure 5-8. Two segments from the mass spectrum of tris(heptafluoro- propyl).S-triazine obtained from the M-TOF using time-array detection. a. m/z 28-32 region (residual air ions), showing resolution of 920 (FWHM = 12 ns); b. m/z 466-467 region, showing resolution of 1500 (FWHM = 30 ns). It was not possible to compare the experimentally-observed resolution to that of the simulation program since the field shape within the M-TOF source is quite different from that in the modeled source and not accurately 130 known. (This difficulty was caused by the failure of various high-vacuum resistors, etc. within the source.) Resolving power predicted by the simulation (assuming the intended source configuration and using the voltages listed in Table 5-1) is nearly a factor of two better than the observed values, due to the altered source details as well as the ITR peak broadening. (In fact, M-TOF resolving powers up to nearly 3000 have been seen on the oscilloscope, but such data were unfortunately not collected.) Though perhaps disappointing, the prediction of better resolving power than that seen in practice seems much less disturbing than the opposite situation seen earlier in this work. Table 5-1. M-TOF source voltages used to obtain data in Figure 5-8. G4 827 V G3-extract 979 G3-store :M G2 817 Filament 777 Pusher #1 773 Pusher #2 779 An example of the complete GC-TOFMS-ITR system performance is shown in Figures 5-9—11. A sample of a nine-component mixture containing approximately 1 ng of each component was introduced into the GC column; a temperature program was selected such that all these components eluted within a two-minute time span. The M-TOF was operated at an extraction frequency of 5 kHz so that successive summation of 250 transients by the ITR yielded mass spectral scan files at a rate of 20 Hz. The reconstructed total-ion chromatogram, excluding the solvent peak, is shown in Figure 5-9. Each of the 2400 dots represents the time at 131 which a complete scan file was generated. Since each chromatographic peak has a width of at least 1 s, more than 20 mass spectral scan files were generated for each of the nine components. Peaks 2 and 3 overlap some- what; if mass spectra were generated at a rate of 1 Hz, for example, a reconstructed chromatogram would not adequately represent the chro- matographic separation actually obtained (see Figure 1-1a). Sample mass spectra from peaks 2 and 3 (scan files #668 and #704, respectively) are shown in Figures 510 and 5-11. Reference spectra are taken from the Atlas of Mass Spectral Data.7 Relative Intensity 6.034 2 7 ' 3 4 20 Scans/Sec ll ’ 5 l 4.0E4 -~ 1 , s 1 . 6 ‘ 9 2.034 "P ' 1 l 0.0 ‘ A r H . -~ 4 - : , 0 600 1200 1600 2400 Sean Number Figure 5-9. Reconstructed total-ion chromatogram; the nine peaks are: 1. cyclohexanol, 2. bromohexane, 3. 2-cyclohexene-1-one, 4. methoxy-ethyl ether, 5. 1,3-dichlorobenzene, 6. benzyl chloride, 7. 1,2-dichlorobenzene, 8. acetophenone, 9. benzyl bromide. Column: DB-5, 5 m x 100 um. Tem- perature program: 50°C-150°C, 20°C/min. Sample size: 1 ng of each component injected on column. Scan 668 2-Cyclohexen-1-one 100 Intensity 0| \1 O 01 I I to (It I III I ll .1I I . 20 60 so 100 -l 1000 _ 800 .. 600 _ 400 - . 200 .. o IllIlllI Illll! I I II I I I I fil I 30 40 50 60 70 80 90 1 00 Figure 5-10. Mass spectrum of 2-cyclohexene-1—one obtained with the M- TOF (top); reference spectrum (bottom). Scan 704 1-Bromohexane 100 ,Q‘ 75' U) 5 50~ .E 25 1 l u 50' 717 9'0 '110j150'150'1io m/z 1000 - 800 - 600 .. 400 .. 200 - 0- 10 30 50 70 90 110 130 150 170 Figure 5-11. Mass spectrum of 1-bromohexane obtained with the M-TOF (top); reference spectrum (bottom). REFERENCES C. G. Enke, “Time-of-Flight Mass Spectrometry: Meeting Chromatog- raphy’s Challenge”, Presented at the 36th ASMS Conference on Mass Spectrometry and Allied Topics, San Francisco CA, June 5—10, 1988. R. Grix, R. Kutscher, G. Li, U. Griiner, and H. Wollnik, Rapid Commun. Mass Spectrom., 1988, 2, 83. W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum., 1955, 26, 1150. F. A. Baker and J. B. Hasted, Phil. Trans. Roy. Soc. London, 1966, 261, 33. G. E. Yefchak, M. A. Puzycki, C. G. Enke, R. Grix, J. F. Holland, G. Li, Y. Wang, and H. Wollnik, to be presented at the 38th ASMS Conference, Tucson, AZ, June 3—6, 1990. R. Tecklenburg, Jr., R. Grix, J. Allison, J. F. Holland, C. G. Enke, C. C. Sweeley, J. T. Watson, U. Gruner, H. Glitz, and H. Wollnik, to be presented at the 38th ASMS Conference, Tucson, AZ, June 3—6, 1990. Ed. E. Stenhagen, S. Abrahamsson, and F. W. McLafl‘erty, Wiley (Interscience), New York, 1969. Chapter 6 Models Developed for Collaborative Work “Scientific research is becoming more and more a cooperative enterprise... We know Edison invented the phonograph, but who is the inventor of television?” Martin Gardner The potential for TOFMS to provide unsurpassed mass spectral generation rates and superior sensitivity has led to a number of research projects at MSU both prior to and concurrent with the studies described above. This author has participated in some of these as well, and two of these collaborative projects are described in this Chapter. The accounts have been made fairly brief since complete reports on these works have been (or will be) made by the collaborators. 6.1 Studies on the Mass-Dependence of Time-Lag Focusing The Wiley-McLaren time-lag focusing/space-focusing technique (§2.3.1) was for many years the standard method by which fairly reasonable mass resolving power could be achieved in TOFMS. Time-lag focusing was 136 137 initially considered inappropriate for TAD, however, because ions from only a small range of m/z values could be focused by any particular set of instrument parameters. Yet during the development of the DFF technique, it became clear that the question of just how small such m/z ranges were had not been addressed. Conventional TOFMS instrumentation incorporating time-slice detection generally provides a lag time appropriate to focus whatever m/z value the detection electronics are set to observe; when the observed m/z value is incremented, the lag time is also adjusted to insure focusing for the new m/z value. When only one m/z value is sampled for each transient (time-slice detection), this adjustment schedule is appropriate. If, however, TAD is used and a particular lag time could result in adequate focus for ten m/z values instead of one (for example), an entire spectrum could be collected with one tenth the number of transients required for time-slice detection. In this approach, the portions of each transient that received sumcient focusing would be appended to each other to yield a complete spectrum. Eric Erickson studied the “mass windows” over which adequate focusing could be achieved, as well as the effects which various instrumental parameters have on the size and location of these windows.1 The results of this study indicate that as few as three distinct lag-time settings could provide completely focused spectra over the mass range 50—700 u. Though spectra produced in this way would not have mass resolving power as high as those produced by, for example, the M- TOF, this technique does permit TAD to be applied over a fairly wide mass range by the use of conventional TOFMS instrumentation. The approach used in this study and the results obtained are summarized below. W {H V0 V1 2 V3 V4 V4 t t 7‘ I‘ Figure 6-1. Illustration of the CVC 2000 mass spectrometer showing nomenclature for parameters used in the modeling program by Erickson. Voltages are represented by the V terms and geometry by the x terms. The distance from an ion’s initial position to the first grid is 31, and the rise time of the voltage pulses applied to the first and second grids is t,. The heart of this study was the digital simulation of peak shapes as a function of the various instrumental parameters, most notably the acceler- ation grid voltages and the lag time, for various masses. This simulation was based on the CV C 2000 time-of-flight mass spectrometer, which incor- porates the four-region ion source pictured in Figure 6-1. Ions are formed by electron impact in the first region. Then, after the lag time occurs, the voltages applied to grids 1 and 2 are pulsed from V1.- to Vlf and 0 to sz, respectively. Grids 3 and 4 are always held at potentials V3 and V4, respec- tively. Erickson wrote a FORTRAN function to calculate the flight time of 139 an ion from the'source to the detector as a function of its mass, its initial velocity in the flight direction, its distance s1 from grid 1, the lag time, and the voltages V1.3 Vlf , V2,- , V3 and V4. (During the lag time, the simulated ion moves only according to its initial velocity and the field applied by volt- age Vlg.) Using this function, Erickson and this author wrote a program (similar to the SIMTOF programs described in Chapter 3) to simulate peak shapes for pairs of adjacent m/z values. From these data, the efi‘ects of the lag time and the various voltages were analyzed. (In addition, the efi‘ect of a linear voltage change between the initial and final values of the voltages applied to grids 1 and 2 was studied. The linear function was meant to approximate the behavior of imperfect pulse shapes which occur in prac- tice.) 5 ‘ Optimum Focus 4 w ‘k ’i - 90% Intensity j; 3 . Boundaries IE g 2 'll 3° , . 0 - 1 . . V4 0 200 400 600 800 1000 m/z Figure 6-2. Resolution and intensity boundaries shown on lag time—m/z space. The shaded area represents the locus of points at which adequate (see text) peak shapes are obtained. The shaded curve shows the optimum-focus lag time (proportional to V; ) . The most significant results of this study are summarized in Figure 6-2. As an example, consider the behavior for m/z 200. The figure 140 indicates that the optimum lag time for m/z 200 is approximately 1.3 us. With lower or higher lag times, the peak becomes somewhat broadened and reduced in height. If the lag time is lowered to 1.2 as or raised to 1.7 119, the peak height is reduced to 90% of its maximum value. If the lag time is increased to 4.0 as, the resolving power deteriorates to the 10% valley level. Consider now the mass dependence of focusing for, as an example, a lag time of 1.5 ps. The figure indicates that the mass window 150 < m/z $250 is adequately focused with this lag time.I This study indicates that the three lag time values of 1.0, 1.5, and 2.4 as can be used to build a completely focused mass spectrum from m/z 50 to 700. The three partial spectra would comprise m/z ranges of 50 to 150, 150 to 250, and 250 to 700, respectively. The results of this study indicate that the mass spectra of reasonable quality should be obtainable by TAD without the use of the novel resolution- enhancement techniques described elsewhere in this thesis. Erickson experimentally demonstrated the feasibility of this technique using the CV C 2000 instrument and the ITR.2 The practical implications of the study are, however, somewhat limited since the technology required to carry out TAD (i.e. an ITR) is currently much more complex and expensive than either M-TOF or beam deflection instrumentation. 6.2 Studies of Two-Stage Homogeneous-Field Ion Mirrors 6.2.1 Backgxmnd Information This second collaboration involved derivation of the second-order transfer matrix for TOFMS spectrometers incorporating two-stage homo- geneous-field ion mirrors (i.e. mirrors such as the one illustrated in 141 Figure 2-6). A complete discussion of transfer matrices is beyond the scope of this work, but a simplified explanation will be given here.3 Consider an ion initially located at coordinates (x0, yo) and moving at angles x’o = dx/dz and y’o = dy/dz to the y—z and x—z planes, respectively. This situation may be expressed by the vector A0 = . If the ion is moving through a field- 3",, L. .— free region, its inertia will carry it a certain distance dz along the z axis after time dt; this new state can be described by the vector A1 = y’, Since the direction of motion remains constant in a field-free region, x’1 = x’o and y’1 = y’o. The new positions are thus given by the relations x1 = xo + x’odz and y1 = yo + y’odz. The transfer matrix for this field-free region is the matrix M which satisfies the relationship A1 = AM and is thus given by M = . Each element of M may be identified OHOC HNOOI OOOH COD-IN 142 by a symbol of the form a lb, where a and b represent rows and columns of the matrix, respectively. Thus the second element of the first row of M is symbolized by x lx’ and can be thought of as the effect x’ has on x for a given value of dz. That is, since x1 = xo(x Ix) + x’o(x lx’), x Ix and x Ix’ represent the “contributions” to at; from x0 and x’o, respectively. As presented in this example so far, transfer matrices simply provide a concise way to represent the solutions to the equations of motion for a particular optical element. Their true utility, however, results from the fact that matrices for consecu- tive optical elements may be multiplied to yield a transfer matrix which describes the combined efi‘ect of the two elements. Other optical elements more complex than a field-free region can be described by transfer matrices as well. Furthermore, additional elements can be added to describe other quantities of interest, such as energy, momentum, or mass. By applying the appropriate relationships between energy, mass, and velocity, flight-time information can be conveyed by transfer matrices as well. These additional quantities are often expressed in the form of energy difl‘erences (63), mass differences (6",), and time dif- ferences relative to some reference ion having a specified kinetic energy, mass, and arrival time. The final ion coordinates, angles, and arrival time differences at some reference plane are found from the initial parameters at some previous reference plane through equations of the following form. 961 = fa(xo, x’o.yo.y’o. 5K. 5m) x 1 = fxixo. x’o.yo.y’o. 5K. 5.1.) y1 = $060. x’o.yo.y’o. 6x. 6".) y’]. "' 34x01 x’OI 3’0» y’O, 6K: 5m) to + ft(x0: x’09 yo: y’OI 6K: 8m) N H II 143 If terms from the series developments of these equations are available, a first, second, or higher-order description of the ion motion may be obtained, depending on the desired accuracy. 6.2.2 Ion MirrorTransferMatrix The second-order transfer matrix for two-stage homogeneous-field mirror TOFMS instruments is much more complex than that for a field- free region. As above, however, the matrix could be used to yield a vector A1, describing the state variables of an ion which has arrived at the detec- tor, from a vector A0 which represents the initial conditions of the ion leav- ing the source. The additional complexity is due in part to the number of state variables required to describe the situation (there are three position variables x, y, and 2, two angles a and 6, an energy term dx, and a mass term 6",) and also because second-order terms (such as zl a8) have been included. As derived by Damaschin Ioanoviciu, et al.4 the complete list of non-zero elements from the portion of the transfer matrix which carries flight-time information is given below: tlx=—tan9/v tla=tan9(A-L)/v tl6,,,=—tan9’(2v) t I the = (A —-L)/(2v) t Ixa = tan26/v 11x5, = -tan9’(2v) t Ixsg = tanO/(Zv) t I are: = (L + B/2) tan29/v + (L -A)/(2v) t I aim = tan6 (A — L)/(2v) t I mix = tano (A + B+L)/(2v) t I 8min = -(C + L)/(8v) t I smog = (A — L)/(4v) tl5x53=(3L+B-A)/(80) tIfifl=-t|53 144 (The definitions for the symbols are not essential to this discussion.) Using the transfer matrix, Ioanoviciu then derived the following expression for resolving power of the two-stage homogeneous field mirror instrument 62]+,u plus -1 K 6-1 &—;—-_ :1) < ) 5R; Lu A+stan0[1+ 20ltan9+ Here file the resolving power (FWHM definition). L is the total field-free region length, A is the initial ion packet width at the source exit, 9 is the source slit width, and [.11 is the ratio of the accelerating potential to the retarding potential applied to the first mirror stage, respectively. As an example, a value of 25,000 was calculated for K using the parameters m = 1000 u, s = 1mm,L= 1m, a: 15°, 0:: 1°, 5K: 104,111 =2/3, andil=0. Similarly, an expression for the resolving power of a single-stage mirror instrument was found as -1 6K ‘ 52 RF [%4- L —tan9 [1+ 2atan9+?] + aztanza + 2ao‘K time + '5' (6‘2) 6.2.3 Digital Simulation Values for resolving power may also be found by numerical simula- tion of peak shapes. This author used the transfer matrix elements derived by Ioanoviciu to write a function FTIME ( ) , similar to that discussed in Chapter 3, which calculates flight times given values for ion mass, initial energy, position, direction (angles) of motion, etc. This function was then used with a modified version of program SIMTOF, listed in the appendix, to generate peak shapes. Using the same parameters as the example above, 145 the simulated peak shapes indicate a resolving power of 25,300 which is in close agreement with the calculated value. Numerical simulation enables ion behavior in the source to be easily modeled as well. For example, the simulation was repeated for a similar instrument incorporating a typical electron-impact ion source. Values for a were chosen from a normal distribution function of 025°, while values for x were selected from a uniform distribution corresponding to a 1 mm object slit. Ions were assumed to have a Boltzmann distribution of initial kinetic energies at 500 K and a normal initial spatial distribution having a standard deviation of 0.2 mm. The source employed a single extraction field of 500 V applied across a 20 mm region. The peak shapes from both simulations are shown in Figure 6-3. The vastly reduced resolving power of 1300 obtained for the electron-impact source illustrates the reason that mirrors have been used almost exclusively with desorption or laser ionization techniques in which the ionization volume is nearly planar and thus the initial spatial distribu- tion is nearly eliminated. (The Wollnik source discussed in Chapter 5 is, of course, a recent exception.) The function FTIME () actually exists in three versions. The main version, listed in the appendix, calculates flight times for the gas-phase ionization situation as the sum t = twum + Inf-1' tum. Here twang , the time required for the ion to leave the source and travel to the space-focus plane, is calculated as tm = “80% + 280 ___m__ V (“trifle l}? i [fie—K— ,\/ ias'l'pslx (6.3) 146 1000 1001 Gas-Phase K Planar / ,.. L_1 143.75 ' 149.95 145.95 ' 144.05 Flight Time (usec) Intensity (arb. units) Figure 6-3. Simulated peak shapes for m/z 1000 and 1001 from planar and gas-phase (electron impact) ion sources. The widths at half-height are 2.7 and 72 ns, respectively. where a, and )3, are the perturbation parameters defined in Eqs. 21 and 2-2, K is the ion acceleration energy, and so is the distance from the center of ionization to the source exit. The quantity tnf is the flight time for an ideal ion (that is, one formed the center of ionization with no initial energy and moving exactly along the beam axis) from the space focus plane to the detec- tor given by the expression t,¢=4ll§(%v£) (6-4) 147 where v is the ideal ion velocity (for the mass under consideration) and d2 and V2 are the length of and voltage applied to the second mirror stage, respectively. (Note that parameters related to the first mirror stage are not required for this calculation when the mirror potentials appropriate for energy focusing are used.) The final quantity, tmt, is the deviation from the ideal flight time calculated from the transfer matrix as _ it row,- x col.- ‘M‘ " .-.1 (6-5) U In order to simulate the planar-ionization case, a second version of FT IMB () was written in which the quantity twum, calculated from Eq. 6-3, was neglected. A third version of FITIME () , which does not make use of the transfer matrix, was written in order to check the validity of the main version. Fortunately this version produced results identical to the transfer matrix method. The calculation procedure used in this test version is particularly convenient and has general utility for a variety of applications, so it will be discussed in detail below. 6.2.4 A Convenient Simulation Method Once an ion has been accelerated out of the source, its motion along the beam axis (i.e., in one dimension) can be modeled as a series of move- ments within various regions—these may be field-free regions, or regions in which accelerating or decelerating fields are applied. Considering only static fields, two possibilities exist. The ion may enter a region with suffi- cient kinetic energy to pass completely through it (this is the case, of course, for field-free or accelerating regions), or it may enter a decelerating region 148 with only enough energy to slow down and stop, he reaccelerated in the opposite direction, and finally to exit the region at its entrance point. These situations may be described mathematically as follows. Let Ugnmaz = 1/2mv2, where m is the ion mass and v is the velocity, and let Ufinal = Uinmaz + qV, where q is the ion charge and V is the voltage applied to the region of length I under consideration. If Ufinal > 0, the ion will pass completely through the region, and the flight time for this will be given by [[275 ”mm at... (6-6) Furthermore, the ion will leave the region with a new velocity v' = W (no If Ufiml < 0, the ion will pass only part-way into the region and will exit it after time i ' 212112 (6—8) with the same velocity (except, of course, for the sign) as it had when enter- ing the region. A function tregion () was written in C which calculates flight times for an ion (of specified mass and initial velocity) through a region using the equations above. The function is called as tregion (l, V, ion) where l and V are variables representing the length of the region and the voltage applied to it, and ion is a pointer to a structure in the form struct ionstrt { double m; double vel; double time; } *ion; 149 Once the structure ion has been initialized (that is, ion .m is set to the appropriate mass, ion . vel is set to the initial velocity, and ion . time is set to zero), the ion motion can be modeled by repeated calls to tregion () with the appropriate I and V values. Upon each call, the function increments ion . time by an appropriate value calculated from Eq. 66 or 6-8, and it replaces ion . vel with a new value (either —ion . vel or a value calculated from Eq. 6-7, as appropriate). The call sequence used to simulate the two- stage mirror instrument described above is shown below. 7 ion .m = (double) m; ion .vel == sqrt (2 .0 * (alpha_s + beta_s) * K * COUELE / (m * KGAMUH; ion.time = 0.0; tregion(L, 0. 0, &ion); Flightthroughfield-freeregions tregion(d_ refl _1, -V_ refl _1, &ion); mwdmmfiml tregion(d_ refl_ _,2 -V_ refl_ _2, &ion); reflection tregion(d_ refl— __1, v:refl_1, &ion); re-acceleration The variables d_ref1_1, V_refl_1 , d_refl_2, and v_ref1_2 represent the lengths and voltages of the first and second mirror stages, respectively. Note that it is necessary to provide a value for the first mirror region length (d_ref1__1) when modeling the instrument in this way, even though this parameter was not needed for the transfer matrix calculation. (The voltage applied to this region is determined by the focusing equations even though the length is not.) In the simulation, this region was given an almost negligible length (1 pm) in order to simplify the comparison of the results with those of the matrix calculation. In an actual instrument, of course, there would be a measurable length for this region and a significant flight time through it; this would slightly alter the length of the field-fies regions necessary to achieve temporal focusing, but this efl‘ect was not studied in detail. 150 The repeated calls to function tregi on () make this algorithm fairly slow, in comparison to a more direct approach, but the tregion () method has the great advantages of convenience and broad applicability. Many TOFMS configurations of interest can be easily modeled by an appropriate set of function calls. In fact, it is not necessary for one to be more than casually acquainted with C programming in order to build a complete instrument simulation in this way. One need only to write an FTIME () function with an appropriate set of tregion () calls and inserting this func- tion into an existing program such as SIMTOF () listed in the appendix. (Some modifications to SIMTOF () would be necessary in order to account for some parameters specific to the instrument under consideration, of course.) 151 REFERENCES E. D. Erickson, G. E. Yefchak, and C. G. Enke, Presented at the 37th ASMS Conference on Mass Spectrometry and Allied Topics, Miami Beach, FL, May 21-26, 1989. E. D. Erickson, G. E. Yefchak, C. G. Enke, and J. F. Holland, Int. J. Mass Spectrom. Ion Processes, in press. The tutorial on transfer matrices presented here ls based loosely on that of J. H. Boerboom, Adv. Mass Spectrom., 1979, 5, 269. D. Ioanoviciu, G. E. Yefchak, and C. G. Enke, Int. J. Mass Spectrom. Ion Processes, 1989, 94, 281. Chapter 7 Conclusions and Future Work “Cool, calm dellberatlon disentangles every knot” Anonymous Time-of-flight mass analysis compares favorably in many respects to other techniques used in mass spectrometry. TOFMS can be accomplished in an instrument having great mechanical simplicity, and ion transmission is quite efflcient since few apertures are needed along the flight path. Mass spectra can be obtained very quickly in TOFMS, but the complexity of the ITR required to do this overshadows, to some extent, the simplicity of the mechanical components. As advances in available electronic technology continue to be made, however, the design and construction of data acquisition equipment similar to the ITR should become more practical. The need for improved resolving power in TOFMS has been addressed in this work, which has shown that both the beam deflection technique and the combination of a pulsed storage source with an ion mirror (i.e., the M-TOF) can provide resolving powers adequate for a variety of mass spectrometric applications. 152 153 The M-TOF can provide higher resolving power than that obtained from a beam deflection instrument having similar length. Moreover, the increased sensitivity expected from the storage of ions between extractions makes the M-TOF approach even more attractive. On the other hand, the beam deflection technique can be readily applied to any ionization process, while the M-TOF is currently only capable of electron impact ionization. For most GC-MS applications in which electron impact ionization is used, the mass resolving power provided by both techniques is more than adequate. Current plans for continued development of high-speed GC-MS at MSU involve mainly the M-TOF, since the sensitivity and detection limits expected from a mature version of this instrument should match or surpass those of commercial GC-MS instruments such as the ion trap. The new technique of orthogonal acceleration TOFMS1 may compete strongly with the M-TOF in the filture. In this technique, ions are formed continuously, as in beam deflection; TOF mass analysis begins when an acceleration field is applied orthogonally to the beam axis. The energy provided by this orthogonal field greatly exceeds the original ion acceleration energy, so the ion packets produced by the orthogonal acceleration travel nearly perpendicularly to the beam axis. Flight times are recorded after these packets travel through a field-free space along their new trajectory and strike a detector. The advantage of orthogonal acceleration TOFMS lies in the fact that Stein’s conclusion (§2.4) does not apply to cases where ion extraction and flight time analysis occur in separate dimensions. Collimating the ion beam so that velocity components perpendicular to the beam axis are reduced will reduce the effective initial kinetic energy distribution, and hence increase mass resolving power, even though the total energy distribution within the beam is not reduced. Thus 154 energy focusing can be accomplished here with static fields, and space focusing can be simultaneously accomplished by either a Wiley/McLaren- like two-stage orthogonal acceleration field or by an ion mirror. The orthogonal acceleration technique in its present conception, however, does not provide any means of ion storage, and hence it may not provide the high sensitivity expected from the M-TOF. It should be noted here that time-of-flight mass analysis can be applied to tandem mass spectrometry. For example, Glish has combined TOF with a quadrupole mass filter;2 parent ions are selected by the quadrupole, then fragment ion mass analysis is performed by beam deflection TOF analysis. At Michigan State University, Stults measured flight times through a magnetic mass spectrometer3 so that parent and metastable or collisionally-induced fragment ion masses could be determined through a combination of magnetic field strength and flight time data. It seems certain that the improvements to resolving power for single-stage TOFMS discussed in this work will find application in MS/MS techniques as well. REFERENCES 1 J. H. J. Dawson and M. Guilhaus, Rapid Commun. in Mass Spectrom., 1989, 3, 155. 2 G. L. Glish, S. A. McLuckey, and H. S. McKown, Anal. Instrum., 1987, 16, 191. 3 J. T. Stults, C. G. Enke, and J. F. Holland, Anal. Chem., 1983, 55, 1323. APPENDIX Program Listings Weinberg’s Second Law: If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. From Murphy '6 Law and other reasons why things go wrong, by Arthur Bloch Velocity Compaction Project .......................... 157 Dynamic-Field Focusing Project ..................... 168 Beam Deflection Project ................................. 225 Transfer Matrix Project ................................ 268 157 Simulation Program for Velocity Compaciton This is a listing of the program VCTOF which simulates peak shapes from Muga’s Velocity Compaction TOFMS instrument. VCTOF ................................................................................... 16) GETX ..................................................................................... 1. GENCDF ................................................................................ 163 ERF ....................................................................................... 164 TAB ....................................................................................... 164 FTIME ................................................................................... 165 LTIME . .' ................................................................................. 1% VCTOF VCTOF is a program which simulates time-of-flight peak shapes. Only two non-instrumental parameters affect the flight time of an ion having a given mass-to-charge ratio—the initial location of the ion in the source and the initial velocity of the ion in the direction of the flight path. . The program calculates flight times for ions having a specified mass (one positive charge is assumed) and randomly chosen initial positions and velocities corresponding to normal distribution functions. These flight times are tabulated as a histogram (an array of (time, intensity} values) which represents the peak shape and output to a file. The user supplies values for the ion mass, the mean and standard deviation of the initial velocity distribution, the mean and standard deviation of the initial spatial distribution, and step sizes related to the number of desired iterations through the two distributions. In addition, the user supplies the range of the desired histogram (usually in the form of mass values from which to calculate low and high time limits) and the desired name for the output file. Description of Routines: PROGRAM VCTOF The main program obtains the required input from the user and controls the iterations through the space and energy distributions. FUNCTION GETX This function returns an abscissa corresponding to a specified cumulative distribution value. SUBROUTINB GENCDF This routine generates the cumulative distribution function for a normal distribution having specified mean and standard deviation. FUNCTION ERF This function, from Press, Flannery, Teukolsky, and Vetterling, Numerical Recipies, p. 164, evaluates the error function erf(x). SUBROUTINE TAB 159 In this routine, flight times are tabulated in a histogram. The flight times are mapped into bin numbers (array positions, that is); then the corresponding array value is incremented. FUNCTION FTIME This function calculates and returns flight time through the instru- ment for an ion of specified mass fiom its initial position and velocity. SUBROUTINE LTIME This routine calculates flight time through the dynamic field region of the velocity compaction TOFMS instrument. GOO 000 10 000 PROGRAM VCTOF Simulate velocity compaction time-of-flight peak shapes PARAMETER (SIZE - 64) PARAMETER (NCDF - 128) REAL TMIN, TMAX REAL VCDF (NCDF) , SCDF (NCDF) REAL VMIN, VMAX, SMIN, SMAX REAL VSIGMA, SSIGMA, v0, so REAL PV, PS, VSTEP, SSTEP, v, E, 5, TIME REAL TEMP INTEGER SPECT(SIZE) INTEGER DIRECT, MASS CHARACTER*4O FNAME Init spectrum DO 10 I I 1, SIZE SPECT(I) ‘ 0 CONTINUE TYPE *, 'Enter STD. DEV. and MEAN for velocity distribution' ACCEPT *, VSIGMA, vo TYPE *, 'Enter STD. DEV. and MEAN for space distribution' ACCEPT *, SSIGMA, SO IF (VSIGMA .NE. 0.0) THEN CALL GENCDF(VCDF, VMIN, VMAX, VSIGMA, V0) TYPE *, 'Enter PV step size' ACCEPT *, VSTEP ENDIF IF (SSIGMA .NE. 0.0) THEN CALL GENCDF(SCDF, SMIN, SMAX, SSIGMA, SO) TYPE *, 'Enter PS step size' ACCEPT *, SSTEP ENDIF TYPE *, 'Enter mass' ACCEPT *, MASS TYPE *, 'Calculate min & max from what two masses?‘ TYPE *, '(Enter equal numbers for manual input)‘ ACCEPT *, MINMAS, MAXMAS Find min and.max times of spectrum IF (MINMAS .EQ. MAXMAS) THEN TYPE *, 'Enter TMIN and TMAX' ACCEPT *, TMIN, TMAX ELSE TMIN - FTIME(MINMAS, 1, 0.2, 0.0, 1) TMAX - PTIMEtMAXMAS, 1, 0.2, 0.0, 1) ENDIF 100 200 300 000 999 1000 900 161 TYPE *, 'TMIN, TMAx - ', TMIN, TMAx IF (VSIGMA .NE. 0.0 .AND. SSIGMA .NE. 0.0) THEN DO 100 PV = 0.0, 1.0, VSTEP v a GETX(PV, VCDF, VMIN, VMAX) E - 0.5 * V * V I Note absence of MASS (mv‘Z/Z) DIRECT - 1 IF (V .LT. 0.0) DIRECT - -1 DO 100 PS - 0.0, 1.0, SSTEP S ' GETX(PS, SCDF, SMIN, SMAX) TIME - FTIME(MASS, 1, S, E, DIRECT) CALL TAB(TIME, SPECT, TMIN, TMAX) CONTINUE ELSE IF (VSIGMA .EQ. 0.0 .AND. SSIGMA .NE. 0.0) THEN E ' 0.5 * V0 * V0 DIRECT - 1 IF (V0 .LT. 0.0) DIRECT 3 -1 DO 200 PS = 0.0, 1.0, SSTEP s = GETX(PS, SCDF, SMIN, SMAX) TIME - FTIME(MASS, 1, S, E, DIRECT) CALL TAB(TIME, SPECT, TMIN, TMAX) CONTINUE ELSE IF (VSIGMA .NE. 0.0 .AND. SSIGMA .EQ. 0.0) THEN S - SO DO 300 PV - 0.0, 1.0, VSTEP V - GETX(PV, VCDF, VMIN, VMAX) E - 0.5 * v * V ! Note absence of MASS (mv‘2/2) DIRECT - 1 IF (V .LT. 0.0) DIRECT = -1 TIME - FTIME(MASS, 1, S, E, DIRECT) CALL TAB(TIME, SPECT, TMIN, TMAX) CONTINUE ELSE DIRECT - 1 IF (V0 .LT. 0.0) DIRECT - -1 TYPE *, 'TIME - ', FTIME(MASS, 1, SO, E0, DIRECT) ENDIF Spectrum complete, now output to file TYPE *, 'Enter output filename' ACCEPT 999, FNAME FORMAT(A) OPEN(UNIT-1, FILE-FNAME, TYPE-'NEW') TEMP = (TMAx - TMIN) / SIZE Do 900 I - 1, SIZE . TIME - (FLOAT(I) - 0.5) * TEMP + TMIN WRITE(1, 1000) TIME, SPECT(I) FORMATth, F10.6, ',', Is, '.') CONTINUE CLOSE (UNIT=1) CALL EXIT END 162 0000 000 10 20 000 100 163 FUNCTION GETX(P, CDF, XMIN, XMAX) Find and return X value having cumulative distribution function (CDP) value I P PARAMETER (NCDF I 128) REAL P, CDF(NCDF), XMIN, XMAX REAL DELTAX, DELTAY INTEGER I IF (P .LT. 0.0) STOP 'INVALID P VALUE IN GETX()' IF (P .GT. 1.0) P I 1.0 DELTAX I (XMAX - XMIN) / FLOAT(NCDF - 1) This should use a binary search instead... DO 10 I I 1, NCDF IF (CDF(I) .GE. P) GO TO 20 CONTINUE GETX I XMAX RETURN DELTAY I CDF(I) - CDF(I - 1) GETX I (P - CDF(I - 1)) * DELTAX / DELTAY + 1 (I - 2) * DELTAX + XMIN RETURN END SUBROUTINE GENCDF(CDF, XMIN, XMAX, SIGMA, X0) Generate gaussian cumulative distribution function PARAMETER (NCDF I 128) REAL CDF(NCDF), XMIN, XMAX, SIGMA, X0 REAL FAC XMIN I X0 - 3.0 * SIGMA XMAX I X0 + 3.0 * SIGMA RANGE I XMAX - XMIN FAC - RANGE / FLOAT(NCDF - 1) $2 - SIGMA * SIGMA Do 100 I - 1, NCDF x - XMIN + PAC * FLOAT(I - 1) CDF(I) I 0.5 * 1 (1.0 + ERF((x - x0) / SQRT(2.0 * 52))) CONTINUE RETURN END 000 000 FUNCTION ERF(X) From Numerical Recipies, p. 164. Z I ABS(X) T I 1./(1. + 0.5*Z) ERFC I T * EXP(-Z*Z-1.26551223+T*(1.00002368+T*(0.37409196+ 1 T*(0.09678418+T*(-0.18628806+T*(0.27886807+T*(-1.13520398+ 2 T*(1.48851587+T*(-0.82215223+T*0.17087277))))))))) IF (X .LT. 0.0) ERFC I 2.0 - ERFC ERF I 1.0 - ERFC RETURN END SUBROUTINE TAB(TIME, SPECT, TMIN, TMAX) Tabulate flight times in a histogram PARAMETER (SIZE I 64) REAL TIME, TMIN, TMAX INTEGER SPECT(SIZE) INTEGER INDEX RANGE I TMAX - TMIN INDEX I INT((TIME - TMIN) * SIZE / RANGE) + 1 IF (INDEX .GT. SIZE + 1 .OR. INDEX .LT. 1) RETURN IF (INDEX .EQ. SIZE + 1) INDEX I SIZE SPECT(INDEX) I SPECT(INDEX) + 1 RETURN END 000 0000000 165 REAL*4 FUNCTION FTIME(M, Q, R4SS, R4U0, DIRECT) Return flight time through velocity compaction TOFMS IMPLICIT REAL*8 (A-H, O-Z) INTEGER M, Q, DIRECT REAL*4 R4SS, R400 M I mass (amu) Q - charge (elementary charges) ss - initial position (cm) uO I initial energy (eV) direct I initial direction (+1 or —1) REAL*8 SS, 00 REAL*8 TIME REAL*8 CONVER REAL*8 L, TS, TD, TL, TF REAL*8 TOP, TEMP DATA CONVER /101.805/ I SQRT(amu / elementary charge) * 1E6 DATA vx, so, D, L, F /10.0, 0.01, 0.02, 0.08, 1.3/ SS = R488 U0 I R4U0 S I SS + 0.8 S - S / 100. I Conver cm to meters TOP I CONVER * SQRT(2.0 * M) TEMP - SQRT(Q * s * vx / so + U0) + DIRECT * SQRT(UO) Ts - TOP * s / TEMP TEMP I 2.0 * SQRT(Q * S * VX / $0 + UO) TD I TOP * D / TEMP V0 - D / TD I Velocity into velocity compaction region TSD I TS + TD CALL LTIME(M, Q, SO, D, L, V0, VX, TSD, TL, VF) TF I F / VF FTIME I TS + TD + TL + TF RETURN END 000 000 20 166 SUBROUTINE LTIME(M, Q, S, D, L, V0, VX, TSD, TL, VF) IMPLICIT REAL*8 (A-H, O-Z) COMMON /CCR/ CC, R INTEGER M, Q REAL*8 L, K, V0, TL, VF REAL*8 KGAMU, COUELE REAL*8 YY(2) DATA VREF /70./ I VOLTAGE AT M I 1 DATA CONVER /101.805/ DATA KGAMU /1.66057E-27/ I kg per amu DATA COUELE /1.60219E-19/ I elementary charge in Coulombs DELTAT I 0.1 Conver time to seconds TSD I TSD / 1.E6 DELTAT I DELTAT / 1.E6 V0 I V0 * 1.E6 R - 0.5 K = (CONVER/1.E6*((2. * S + D) / SQRT(2. * VX))) ** R CC = VREF / x VINIT - CC * SQRT(TSD) CC - CC * COUELE / (L * M * KGAMU) Start TL at Muga's approximation TL I 2. * M * KGAMU * L * L / (COUELE * VINIT) TL I SQRT(TL) P I V0 - CC * (TSD**(R + 1.) QQ I -CC * (TSD**(R + 2.)) / XX I CC * ((TSD+TL)**(R + 2.) 1 + P * TL + QQ - L IF (XX .GT. 0.0) THEN SGN I I1. ) / ( + 1.) ( 1.) * (R + 2.)) R + 1 ) * (R + 2.)) ELSE SGN I 1. ENDIF DELTAT - DELTAT / 10. IF (ABS(XX) .LT. 1.E-8) Go To 30 OLDXX - xx TL - TL + SGN * DELTAT xx - CC * ((TSD + TL)**(R + 2.)) / ((R + 1.) * (R + 2.)) 1 + P * TL + QQ — L IF (SIGN(1.0Do, XX) .NE. SIGN(1.0D0, OLDXX)) THEN SGN - —SGN DELTAT - DELTAT / 2.0 ENDIF Go To 20 30 000 167 VF I CC * ((TSD + TL)**(R + 1.)) XX I CC * ((TSD + TL)**(R 2.)) 1 + P * TL + 00 Back to meters per mdcrosecond VF - VF / 1.E6 TL I TL * 1.E6 RETURN END / ( / ( R+1.)+P (R+1.) * (R+2.)) 168 ' Programs for the Dynamic-Field Focusing Project The following are listings of programs developed over the period from 1986 to 1988 which were used for the Dynamic-Field Focusing (DFF) project. Program SIMTOF: ........................................................................... 170 main ...................................................................................... 172 gasdev .................................................................................... 177 ran ........................................................................................ 177 tab ......................................................................................... 178 dfitime ................................................................................... 179 gettvk ..................................................................................... 181 find ........................................................................................ 182 Program SOLVE: ............................................................................. 183 main ...................................................................................... 184 rk4 ......................................................................................... 185 derivs ..................................................................................... 186 ave ......................................................................................... 187 kep ......................................................................................... 187 kem ....................................................................................... 188 ks .......................................................................................... 188 Program SIMPLX: ........................................................................... 189 SIMPLX ................................................................................. 191 FUNK .................................................................................... 192 AMOEBA ............................................................................... 193 respon .................................................................................... 1% kep ......................................................................................... 197 kem ....................................................................................... 197 ks .......................................................................................... 1% dfltime ................................................................................... 1% gettvk ..................................................................................... 201 169 Program VALLEY: ....................................................................... ...202 main .............................................................. ' ........................ 203 gauss ..................................................................................... 206 finds ...................................................................................... 216 Program AN IMATE: ........................................................................ 207 AN IMATE .............................................................................. 209 ~ DONE ..................................................................................... 213 DRAW .................................................................................... 214 FAST ..................................................................................... 215 FINDXV ................................................................................. 216 GCLOSE ................................................................................. 217 GENY .................................................................................... 217 GOPEN .................................................................................. 218 MOVE .................................................................................... 22) NUMBERS .............................................................................. 221 XFORM .................................................................................. 223 XMAP .................................................................................... 223 YMAPl .................................................................................. 224 YMAP2 .................................................................................. 224 170 SIMTOF SIMTOF is a program which simulates time-of—flight peak shapes using a Monte Carlo method. Only two non-instrumental parameters affect the flight time of an ion having a given mass-to-charge ratio—the initial location of the ion in the source and the initial velocity of the ion in the direction of the flight path. The program calculates flight times for ions having a specified mass (one positive charge is assumed) and randomly chosen initial positions and velocities corresponding to normal distribution functions. These flight times are tabulated as a histogram (an array of (time, intensity} values) which represents the peak shape and output to a file. The program uses the file “FUNCTION.DAT” produced by program SOLVE to obtain the DFF voltage and thus calculate flight times. The user supplies values for the ion mass, the temperature (which determines the width of the initial velocity distribution), the mean and standard deviation of the initial spatial distribution, and the number of desired iterations through the two distributions. In addition, the user supplies the range of the desired histogram (usually in the form of mass values from which to calculate low and high time limits) and the desired name for the output file. Description of Routines: main The main program obtains the required input from the user, opens access to the DFF voltage file function . dat, and controls the iterations through the space and energy distributions. gasdev This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 203, generates random numbers drawn from a normal distribution with zero mean and unit variance. ran This routine returns a random number between 0.0 and 1.0. The built-in library routine rand supplied by the VAX-11 C compiler generates integer random numbers from the range 0 to (231 - 1). These integers are 171 converted to floating point and divided by (231 — 1) to yield the desired uniform deviates. . tab In this routine, flight times are tabulated in a histogram. The flight times are mapped into bin numbers (array positions, that is); then the corresponding array value is incremented. dfftime This routine calculates the flight time for an ion having specified mass, charge, initial position, and initial velocity. The velocity information is actually specified as a combination of kinetic energy (a scalar quantity, unlike velocity) and a direction. The integer variable direct, one of the arguments sent to this routine, is set by the calling program to be either +1 or —1 to indicate motion either towards or away from the detector, respectively. gettvk This routine calculates and returns the flight time for the reference ion, the initial DFF voltage, and the DFF voltage rate of change for an ion of specified mass. find . This routine executes a binary search through the DFF voltage function array. /* *‘k ** ** *‘k ** *‘k *‘k ** *‘k ** ** ** */ 172 simtof.c Monte-Carlo simulation of time-of-flight peak shapes. Means and standard deviations are input for generation of gaussian distribution functions representing the spatial and velocity spreads of ions in the source. Ions are randomly picked from.these distributions, and the flight times of these ions are calculated. The flight times are tabulated in a histogram to generate the peak-shape. George Yefchak #include #include #define SIZE 64 /* Spectrum array size */ #define NCDF 128 /* Cumulative distribution function array size */ #define MAXV 500 /* Maximum array size for FUNCTION.DAT */ #define KBOLT 1.38007e-23 /* Boltzmann constant */ #define COUELE 1.60219e-19 /* electron charge */ #define KGAMU 1.66057e-27 /* kg / amu */ #define CHARGE 1 /* One electron charge on ions */ /* ** External declarations for DFF paramters */ double are I 0.01; double dffreg - 0.100; double dffend - 0.102; double tofend - 2.000; double Vext I 10.0: float tfile[MAXV], vfile[MAXV]; int mref, fsize: main() I double tmin, tmax; /* Spectrum extrema */ double u0, so, vsigma, ssigma; /* Means and standard deviations */ double v, e, s, time; /* Velocity, energy, location, time */ double temp; /* Temperature */ double dev; /* Deviation from.mean */ double range; /* Range of spectrum */ double mkg; /* Mass (kg) */ int spect[SIZE]; /* Histrogram for spectrum */ int nviter, nsiter; /* I of velocty and space iterations */ int iveloc, ispace, i; /* Loop variables */ int mass, direct; /* Ion mass, ion direction */ int mdnmass, maxmass; /* Spectrum.extrema (Da) */ int peak; /* Index for peak 1 or 2 */ char string[80]; /* *‘k */ /* ** */ /* *‘k */ 173 FILE *fp; double gasdev(); /* Gassian deviate function */ double dfftime(); /* Time-of—flight function */ Open DFF Voltage Function file if ((fp I fopen("FUNCTION.DAT", "r")) II NULL) { printf("Unable to open FUNCTION.DAT\n"); exit(0); } for (i I 0; i < MAXV; ++i) { if ((fscanf(fp, "%f, %f, %*f", &tfile[i], & vfile[i])) II EOF) break; } fclose(fp); fsize I i; Initialize spectrum to zeros for (i = 0; i < SIZE; ++i) spect[i] I 0; Input mass, distribution function parameters, etc. printf("Enter mass (amu)\n"); mass I atoi(gets(string)); mkg I (double) mass * KGAMU; mmef I mass; printf("Enter temperature (K)\n"); temp I atof(gets(string)); if (temp II 0.0) { printf("Enter energy (eV) and direction (+l- 1)\n"); scanf("%f, %d", &u0, 5direct); gets(string); /* Clean up buffer from scanf() call */ vsigma I 0.0; } else { no I 0.0; vsigma I sqrt((KBOLT * temp) / mkg); } printf("Enter mean for spatial distribution\n”); so I atof(gets(string)); printf("Enter standard deviation for spatial distribution\n"); ssigma I atof(gets(string)); if (vsigma :- 0.0) /* *‘k */ 174 { printf("Enter number of energy iterations\n"); nviter I atoi(gets(string)); } if (ssigma !I 0.0) { printf("Enter number of space iterations\n"); nsiter I atoi(gets(string)); } if (vsigma !I 0.0 II ssigma !I 0.0) { printf("Calculate min 5 max from what two masses?\n“); printf(" (Enter two equal numbers for manual input.)\n"); scanf("%d, %d", aminmass, &maxmass); gets(string); /* Clean up buffer from scanf() call */ if (minmass II maxmass) { printf("Enter tmin\n"); tmdn I atof(gets(string)); printf("Enter tmax\n"); tmax I atof(gets(string)); } else { tmin I dfftime(minmass, CHARGE, s0, u0, 1); tmax I dfftime(maxmass, CHARGE, s0, no, 1); } printf("Tmin I %e, Tmax I %e\n", tmin, tmax); srand(1); /* Initialize random number generator */ } Now calculate spectrum for (peak I 1; peak <- 2; ++peak) /*** START OF PEAK LOOP ***I { if (peak II 2) ( mass I mass + 1; mkg I (double) mass * KGAMU; mref I mass; ) if (vsigma !I 0.0 as ssigma !I 0.0) /* REAL CASE... */ for (iveloc I l; iveloc I 0.0) ? l : I1: for (ispace I 1; ispace = 0.0) ? 1 : -1; time I dfftime(mass, CHARGE, s, e, direct); tab(time, spect, tmin, tmax, SIZE); } . } { s I 30; v I sqrt((2. * uO) / mkg); time I dfftime(mass, CHARGE, so, no, direct); printf("Time I %e\n", time); exit(0); } else /* SINGLE ION */ } /*** END OF PEAK LOOP ***/ Spectrum complete; now output to file printf("Enter output filename\n"); gets(string); if ((fp I fopen(string, "w")) II NULL) { printf("Error opening fi1e\n"); exit(0); } range I (tmax - tmin) / SIZE; for (i I 0; i < SIZE; ++i) { time I ((float) i - 0.5) * range + tmin; fprintf(fp, "%12.8e, %8d.0\n", time, spect[i]); } fclose(fp); 176 177 double gasdev() /* ** *‘k ** */ Return gaussian deviate See Numerical Recipes, p. 203. { double v1, v2, r, fac; static double gset; static int iset I 0; double ran(); if (iset II 0) { do { v1 I 2. * ran() - 1. v2 I 2. * ran() - l. r I vl*vl + v2*v2; } while (r >- 1.): fac I sqrt(-2. * log(r)/r); gset I v1 * fac; iset I 1; return(v2 * fac); } o I o I else { iset I 0; return(gset); } double ran() /* *‘k ** *‘k *‘k */ Return random number between 0.0 5 1.0 Library routine rand() returns an int between 0 and 2‘31 - 1. We divide this by 2‘31 to return a double >- 0. and < 1. { double temp; int rand(); temp I(double) rand() / 2147483648.; return(temp): } 178 tab(time, spect, tmin, tmax, spsize) double time, tmin, tmax; int spect[l, spsize; /* ** */ Tabulate ion‘s time-of-flight in histogram { double range; int index; range I tmax - tmin; index I (int) ((time - tmin) * (double) spsize / range); if (index >- spsize ll index < 0) return; /* ...out of range */ if (index II spsize) --index; spect[index] +- 1; } 179 /* ** dfftime.c ** ** Return flight time through DFF TOFMS instrument */ #include #include #define KGAMU 1.66057E-27 #define COUELE 1.60219E-19 #define CONVER 1.018056E-4 /* sqrt(KGAMU/COUELE) */ #define MAXNM 100 /* Maximum iterations for Newton's Method */ #define MAXV 500 /* Maximum size of FUNCTION.DAT */ double dfftime(m, q, s, u0, direct) double 3, uO; int m, q, direct; { double v; double top, tmp, tsrc, tffl, time, tf, tref; double tdff, old; double tp, dfflen; double pp, qq, rr, 33, aa, bb, cc, dd; double f, fprime; double dffVO, dffk; int i; extern double src, Vext, dffreg, dffend, tofend; /* ** Get DFF voltage function parameters: ** ** Time to OFF region for reference ion I tref ** Initial DFF voltage I dffvo ** Rate-of—change of DFF voltage I dffk */ gettvk(m, &tref, EdffVO, &dffk); /* ** Now find flight time */ top I CONVER * sqrt(2.*m); tmp I sqrt(q * s*Vext/src + u0) + direct*sqrt(u0); tsrc I top * s / tmp; tmp - 2, * sqrt(q * s*Vext/src + u0); tffl I top * dffreg / tmp; v I dffreg / tffl; time I tsrc + tffl; tp I time - tref; dfflen I dffend - dffreg: /* ** We need to solve ** ** ** ** *‘k ** ** ** */ 180 dfflén I pp*(tdff+tp)**3 + qq*tdff**2 + rr*tdff + 88 This is expressed as aa*tdff**3 + bb*tdff**2 + cc*tdff + dd I 0 which we solve using Newton's Method. tmp I COUELE / (m * KGAMU * dfflen); pp I tmp * dffk / 6.; qq I tmp * dffVO / 2.; rr I v - tmp * dffk * tp*tp / 2.; ss I -tmp * dffk * tp*tp*tp / 6.; aa I pp; bb I (3.*pp*tp + qq): 00"" dd I Idfflen; tdff I 1.e-4; /* Initial point for Newton's Method */ for (i I 1; i <- MAXNM; ++i) { f I aa*tdff*tdff*tdff + bb*tdff*tdff + cc*tdff + dd; fprime I 3.*aa*tdff*tdff + 2.*bb*tdff + co; tdff II f/fprime; if (tdff < 0.0) tdff I 0.; if (fabs(f) - MAXNM) printf("Newton failed: f I %e, f' I %e, t I %e\n", f, fprime, tdff); tmp I COUELE / (m * KGAMU * dfflen); v - 3.*pp*(tdff+tp)*(tdff+tp) + 2.*qq*tdff + rr; tf I (tofend - dffend) / v; return(time + tdff + tf); } 181 gettvk(m, t, v, k) double *t, *v, *k; int m; /* *‘k */ /* ** */ { double top, tmp, tsrc, tffl; double tmref; int i, index; extern double src, dffVO, dffk, Vext, dffreg, dffend, extern float tfile[MAXV], vfile[MAXV]; extern int mref, fsize; Find tref for reference mass ion top I CONVER * sqrt(2.*mref); tmp I sqrt(Vext); tsrc I top * src / tmp; tmp I 2.*sqrt(Vext); tffl I top * dffreg / tmp; tmref I tsrc + tffl; Find tref for current ion top I CONVER * sqrt(2.*m); tmp I sqrt(Vext); tsrc I top * src / tmp; tmp I 2.*sqrt(Vext); tffl I top * dffreg / tmp; *t I tsrc + tffl; index I find(*t, tfile, fsize); *k I (vfilelindex+1] - vfile[index]) / (tfile[index+1] tfilelindexJ); *v I vfile[index] + *k * (*t - tfileIindexl): return; } tofend; /* ** ** kt ** */ find.c Binary search through array find(x, array, asize) double x; float array[]; int asize; ( float xhi, xlow, xmid; int hi, low, mid; low I 0; hi I asize - 1; xlow I array[low]; xhi I array[hi]; if (x < xlow II x > xhi) { printf("%f is out of range!\n", x); exit(0): } if (x II xhi) return(hi);- mid I (hi + low) / 2; xmid I array[mid]; while (mid !I low 85 x !I xmid) { if (x < xmid) hi I mid; else low I mid: mid I (hi + low) / 2; xmid I array[mid]; } return(mid): } SOLVE SOLVE is the program which numerically integrates the average 12 function to yield the final DFF voltage function. Routines ks(), kep(), and kemO return values for leg, km, and kE_, respectively; these are averaged by routine ave(). The initial value problem dV/dt = k(V, t) is solved by fourth- order Runge-Kutta integration. The actual integration is performed by routine rk4(). The user must supply the boundary condition as a voltage to be applied at the time ions of a specified mass pass through the DFF region. For the published work, the value of 140 V was assigned to mass 20 u. Description of Routines: main The main program accepts the required boundary condition from the user, specified as values for a mass and a voltage, open the output file, and controls the integration loop. rk4 This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 553, performs fourth-order Runge-Kutta integration. derivs This routine calculates derivatives (dV/dt values) for rk4. These values are found simply by calling ave. ave This routine averages individual ks, leg-1, and leg. values to yield an overall k, which is dV/dt . The values of 0.0001, 0.001, and 0.01 for fl and 1.0001, 1.001, and 1.01 for a were picked in a fairly arbitrary manner. kep This calculates 133+. kem This calculates k 3.. ks This calculates ks. /* ** solve.c *1: ** Find V(t) from known dV/dt I f(t, V). *‘k ** Runge-Kutta integration is used to calculate V(t) as ** V(t) I integration { f(t, V)}. ** */ #include #include #define S 0.01 #define D 0.100 #define Us 10. #define AMU 1.66057e-27 #define E 1.60219e-19 main() { float t, tmax, dt, y[1], dydx[1]; float vold: char string[80]; FILE *fp; FILE *fopen(); /* ** Initialize t to arrival time (at DEF) for 20 amu ion. ** */ printf("Enter initial mass\n“); t I atof(gets(string)); /* AMU */ t I sqrt(2.*AMU*t) * (S/sqrt(Us*E) + D/(2.*sqrt(Us*E))); tmax I 2100.0; /* AMU */ tmax I sqrt(2.*AMU*tmax) * (S/sqrt(Us*E) + D/(2.*sqrt(Us*E))); /* ** Input starting voltage and time increment */ printf("Enter voltage for initial ion\n"); y[0] I atof(gets(string)); printf(“Enter delta t (seconds)\n"); dt I atof(gets(string)); /* ** Open output file */ printf("Enter output filename\n"); gets(string): if ((fp I fopen(string, "w")) II NULL) { printf(”Error opening file\n"); exit(0); } 185 /* ** Now do Runge—Kutta integration to find V(t) */ while (t (I tmax && y[0] #define S 0.01 #define D 0.100 #define L 1.900 #define Us 10.0 #define AMU 1.66057e-27 #define E 1.60219e-19 derivs(t, v, dvdt) float t, v[1], dvdt[1]; /* Array usage is for compatability with rk4, which can solve sets of simultaneous /* ** *‘k ** ** */ (2 /* ** *‘k */ equations. */ { float dvdtlo, dvdthi, tlo, thi; int mlo, mhi; double ave(): .*AMU)); Find mlo & mhi such that: tlo I ffltime(mlo), thi I ffltime(mhi) tlo (I t <- thi mlo I (int) (pow(t/(S/sqrt(Us*E)+D/(2.*sqrt(Us*E))),2.) / mhi I mlo + 1; tlo I sqrt(2.*AMU*mdo) * (S/sqrt(Us*E) + D/(2.*sqrt(Us*E))), thi I sqrt(2.*AMU*mhi) * (S/sqrt(Us*E) + D/(2.*sqrt(Us*E))); Find dV/dt for mlo & mhi for voltage v. Then interpolate linearly to find dV/dt for time t. dvdtlo I ave((double)mlo, v[0]); dvdthi I ave((double)mhi, v[0]): dvdt[O] I (t-tlo)*(dvdthi-dvdtlo)/(thi-tlo) + dvdtlo; return; } double ave(m, v) double m, v; ' { double sum; double kep(), kem(), ks(): sum I 0; sum += kep(s, D, L, Us, v, m, 0.0001); sum +I kep(S, D, L, Us, v, m, 0.001); sum +I kep(S, D, L, Us, v, m, 0.01); sum +I kem(S, D, L, Us, v, m, 0.0001); sum +I kem(S, D, L, Us, v, m, 0.001); sum +I kem(S, D, L, Us, v, m, 0.01); sum.+- ks(S, D, L, Us, v, m, 1.0001); sum +I ks(S, D, L, Us, v, m, 1.001); sum.+I ks(S, D, L, Us, v, m, 1.01); sum /I 9.0: return(sum); } #define Us us . double kep(s, d, 1, Us, 00p, m, b) double 3, d, l, Us,_UOp, m, b; /* ** kE+ */ { double q, r; if (b II 0.0) return(0.0); m *I AMU; Us *I E; UOp *- E; q I d*(1.-l./sqrt(l.+b))lsqrt(Us); q +- 2.*s*(1.+sqrt(b)-sqrt(1.+b))/sqrt(Us); q /I l; q += 1./sqrt(Us+UOp); q I UOp - 1./(q*q) + Us*(1.+b); I s*(1.+sqrt(b)-sqrt(1.+b))/sqrt(Us); +I d*(1.-1./sqrt(1.+b))/(2.*sqrt(Us)); *I sqrt(2.*m); HHH return(q/(r*E)); } 188 double kem(s, d, 1, Us, UOp, m, b) double 3, d, 1, Us, UOp, m, b; /* ** kg- */ { double q, r; if (b II 0.0) return(0.0); m *I AMU; Us *I E; UOp *I E; q I d*(1.-1./sqrt(1.+b))/sqrt(Us); q +- 2.*s*(1.-sqrt(b)-sqrt(1.+b))/sqrt(Us); q /I l; q +I 1./sqrt(Us+U0p); q - UOp - 1./(q*q) + Us*(1.+b); " . I s*(1.-sqrt(b)-sqrt(1.+b))/sqrt(Us); +I d*(1.-1./sqrt(1.+b))/(2.*sqrt (Us) ); *I sqrt(2.*m); NH return(q/(r*E)): } double ks(s, d, 1, Us, UOp, m, a) double 3, d, 1, Us, UOp, m, a; { double q, r; if (a II 1.0) return(0.0); m *I AMU: Us *I E; U0p *I E; q I d*(l.-1./sqrt(a))/sqrt(Us); q +- 2.*s*(1.-sqrt(a))/sqrt(Us); q /I l; q +I 1./sqrt(Us+UOp); q I U0p - 1./(q*q) + Us*a; I s*(1.-sqrt(a))/sqrt(US); +- d*(1.-1./sqrt(a))/(2.*sqrt(Us)): *- sqrt(2.*m); HHH return(q/(r*E)); } SIMPLX SIMPLX is a program which performs downhill simplex method optimization to find the best DFF-TOFMS instrument parameters. The main program and two subroutines are written in VAX FORTRAN; the remaining routines are written in VAX C. Description of Routines: S IMP LX The main program accepts the starting coordinites of the simplex as well as the tolorance condition for termination of the search. FUNK This little function calls the C function respon() which evaluates the actual response function. AMOEBA This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, pp. 292-293, carries out the multidimensional minimization of FUNKO by means of the downhill simplex method. respon This C function calculates the response function. kep This calculates 133+. kem This calculates 1:13.. ks This calculates ks. dfftime This routine calculates the flight time for an ion having specified mass, charge, initial position, and initial velocity. The velocity information is actually specified as a combination of kinetic energy (a scalar quantity, unlike velocity) and a direction. The integer variable direct, one of the arguments sent to this routine, is set by the calling program to be either +1 190 or —1 to indicate motion either towards or away from the detector, respectively. ‘ gettvk This routine calculates and returns the flight time for the reference ion, the initial DFF voltage, and the DFF voltage rate of change for an ion of specified mass. 00000000 10 20 191 PROGRAM SIMPLX Run~simplex optimdzation routine AMOEBA to find best parameters for DFF. Response function is respon(s, d, 1, Us), written in C. This program is linked to AMOEBA and a version of respon() callable by FORTRAN. PARAMETER (NDIM I 2) PARAMETER (MP I 3) PARAMETER (TOTAL I 2.0) REAL F(MP, NDIM), Y #include #define amu 1.66057e-27 #define e 1.60219e-19 double respon(sp, dp, 1p, Usp) double *sp, *dp, *lp, *Usp; { double 3, d, 1, Us; double a, b; /* alpha I s' / 3, beta I dU/Us */ double ds, d0; /* Position & energy perturbations */ double UOp, m; /* UOprime, mass */ double k1, k2, k3, kave; double trefO, trefl, timel, timez; double respon: extern double src, Vext, dffreg, dffend, tofend; extern double dffVO, dffk; extern int mref; double kep(), kem(), ks(); /* dV/dt functions for 8+, E-, s S */ double dfftime(): /* flight time function */ 3 I *sp; d I *dp; l I *lp; Us I *Usp; src I s; Vext I Us; dffreg I d; dffend I d + 0.001: tofend I d + 1 + 0.001; respon I 0.0; printf("s I %f, d I %f, 1 I %f, Us I %f\n", s, d, 1, Us); for (ds I -3e-4, a-(s+ds)/s; ds I MAXNM) printf("Newton failed: f I %e, f' I %e, t I %e\n", f, fprime, tdff); tmp I COUELE / (m * KGAMU * dfflen); v I 3.*pp*(tdff+tp)*(tdff+tp) + 2.*qq*tdff + rr; tf I (tofend - dffend) / v; return(time + tdff + tf); I 201 gettvk(m, t, v, k) double *t, *v, *k; int m; /* ** This dummy routine returns the external values for dffVO * dffk. */ { double top, tmp, tsrc, tffl; double tmref: extern double src, dffvo, dffk, Vext, dffreg, dffend, tofend; extern int mref: /* ** Find tref for reference mass ion */ top I CONVER * sqrt(2.*mref); tmp I sqrt(Vext); tsrc I top * src / tmp: tmp I 2.*sqrt(Vext); tffl I top * dffreg / tmp: tmref I tsrc + tffl; /* ** Find tref for current ion */ top I CONVER * sqrt(2.*m); tmp I sqrt(Vext); tsrc I top * src / tmp: tmp I 2.*sqrt(Vext); tffl I top * dffreg / tmp; *t I tsrc + tffl; *v I dffVO + (*t - tmref) * dffk; *k I dffk: return; } VALLEY This program generates a % Valley plot (“Wendy Plot”) for the DFF- TOFMS instrument. Description of Routines: main The main program accepts the required input from the user and then loops through various user-specified masses calculating the appropriate percent valley value. For each of these, intensity at the valley and peak locations are calculated (rather the generating the entire peak silape). The ratio of these two (multiplied by 100%) yields the percent valley v ue. gauss This returns the value at location x of the a gaussian distribution function having mean mu and standard deviation 8 igma. finds This function returns the value of the spatial coordinate s which yields a flight time t for an ion of energy e and direction direct. /* ** valley.c ** ** Calculate % valley height. ** ** ** George Yefchak */ #include #include #define MAXV 500 /* Maximum array size for FUNCTION.DAT */ #define KBOLT 1.38007e-23 /* Boltzmann constant */ #define COUELE 1.60219e-19 /* electron charge */ #define KGAMU 1.66057e-27 /* kg / amu */ #define CHARGE 1 /* One electron charge on ions */ /* ** External declarations for DFF paramters */ double src I 0.01: double dffreg I 0.100: double dffend I 0.102; double tofend I 2.000: double Vext I 10.0: float tfile[MAXV], vfilelMAXV]; int mmef, fsize; main() { double tpeakl, tpeak2, tvalley; /* Flight times */ double Ppeak, Pvalley, Pe, Ps; /* Probabilities */ double vmin, vmax, smin, smax; /* Distrib. function extrema */ double vinc; /* Velocity increment */ double uO, so, vsigma, ssigma; /* Means and standard deviations */ double v, e, s, time; /* Velocity, energy, location, time */ double temp; /* Temperature */ double dev; /* Deviation from mean */ double mkg; /* Mass (kg) */ int nviter; /* # of velocty iterations */ int iveloc, i; /* Loop variables */ int mass, direct; /* Ion mass, ion direction */ char string[80]; FILE *fp; double dfftime(); /* Time-of-flight function */ double find8(): /* Returns value for s */ double gauss(); /* Gaussian distribution */ /* ** */ Open DFF Voltage Function file /* ** */ /* ** */ /* ** */ 204 if ((fp I fopen("FUNCTION.DAT", "r")) II NULL) { printf("Unable to open FUNCTION.DAT\n"); exit(0); } for (i I 0; i < MAXV; ++i) { if ((fscanf(fp, "%f, %f, %*f", &tfile[i], & vfile[i])) II EOF) break; } fclose(fp); fsize I i; for(;:) { Input mass, distribution function parameters, etc. printf("Enter mass (Da) or negative number to stop\n"); mass I atoi(gets(string)); if (mass <= 0) exit(0); mkg I (double) mass * KGAMU; printf("Enter temperature (K)\n"); temp I atof(gets(string)); no I 0.0; vsigma I sqrt((KBOLT * temp) / mkg): printf("Enter mean for spatial distribution\n"); so I atof(gets(string)); printf("Enter standard deviation for spatial distribution\n"); ssigma I atof(gets(string)); printf("Enter number of energy iterations\n"); nviter I atoi(gets(string)); Get flight times: mref I mass: tpeakl I dfftime(mass, CHARGE, so, uO, 1); mass +- 1; mref I mess; tpeak2 I dfftime(mass, CHARGE, so, uO, 1); tvalley I (tpeakl + tpeak2) / 2.0; mass II 1; mref I mass; Now calculate maximum.and valley intensities. Ppeak I 0.0; Pvalley I 0.0; vmax I 3.0 * vsigma; vinc I vmax / nviter; 205 for (v I 0.0, iveloc I 1; iveloc 1e-5) { tmid I dfftime(mref, CHARGE, smid, e, direct): if (t < tmid) { shi I smid: thi I dfftime(mref, CHARGE, shi, e, direct): . } else { slo I smid: . tlo dfftime(mref, CHARGE, slo, e, direct): } smid I (shi + slo) / 2.0; } return(smid): } ANIMATE This is the DFF Animation. The program displays ions in user- specified colors on the screen and moves them (hence “animation”) through a DFF-TOFMS instrument. Description of Routines: ANIMATE This is the main program. It accepts the required user input and calls routines to open the graphics window, move the ions, and finally close the window. DONE This function test whether or not any of the ions have reached the end of the flight path; if so, the animation is “done”. DRAW This routine draws the ions on the screen. FAST This function tests to see if all the ions have entered the final field- free region; if so, the animation is speeded up to account for the much longer length usually assigned to this region. FINDXV This routine calculates new positions and velocities for the ions to move them forward one step. The routine, which is called by MOVE () . is written to handel the case of an infinitely-thin DFF region. A previous version of AN IMATE used Runge-Kutte integration in routine MOVE () rather than FINDXV () to deal with finite-length DFF regions. GCLOSE This routine closes the graphics window when done. GENY This routine generates the initial vertical coordinites for the ions, which remain constant throughout the animation. GOPEN $8 This routine opens the graphics window and draws the basic screen layout. ' MOVE This routine moves the ions through one step. NUMBERS This routine outputs the numerical portions of the display. XFORM This routine transforms instrument coordinates to generic screen coordinates. XMAP This function maps horizontal screen coordinates to device coordinates. YMAP 1 This function maps vertical screen coordinates to device coordinates for the upper window. YMAP 2 This function maps vertical screen coordinates to device coordinates for the lower window. 0000000 000 209 PROGRAM ANIMATE Show motion of ions through DFF TOFMS. George Yefchak January, 1987 PARAMETER (NMAX I 9) REAL*8 X(NMAX), XINIT(NMAX), V(NMAX), V0(NMAX) REAL*8 MASS(NMAX), Y(NMAX), XMARK(NMAX) REAL*8 XREF, VREF, MREF REAL*8 DELTAT, TIME, WINSIZ, A, TEMP, TLAG REAL*8 KGAMU, COUELE REAL*8 DFFVO, DFFK, TEREE, VEXT, DFFREG, DEFEND, TOFEND REAL*8 TOP, TMP, 5, U0 INTEGER NIONS, I, UPnAT1, UPnATz, USAVEl, USAVEZ, IREF LOGICAL FAST, DONE, CHECK CHARACTER*1 ANSWER CHARACTER*40 FNAME COMMON /DFF/ DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND VDI declarations: INTEGER*2 DEVHDL, DEVPL, DUMMY(2), COLOR(NMAX), PEN(NMAX) INTEGER*2 WKINSC(19), WKINPL(19) INTEGER*2 VSMSTR, VQERR DATA KGAMU, COUELE /1.6606E-27, 1.60219E-19/ nATA PEN /NMAX*1/ nATA WKINSC /0, 1, 1, 3, 1, 1, 1, o, o, 1, 1, * 68, 73, 83, 80, 76, 65, 89, 32/ DATA WKINPL /0, 1, 1, 3, 1, 1, 1, 0, 0, 1, 1, * 80, 76, 79, 84, 84, 69, 82, 32/ CHECK I .TRUE. PRINT *, 'Do you want to use a command file? (Y/N) ' READ(*, 999) ANSWER IF (ANSWER .EQ. 'Y' .OR. ANSWER .EQ. 'y') THEN PRINT *, 'Enter filename: ' READ (*, 999) FNAME OPEN (UNITIl, FILE-FNAME, STATUSI'OLD') READ(1, *) NIONS IF (NIONS .GT. NMAX) STOP 'TOO MANY IONS' DO 5 I I 1, NIONS READ(1, *) MASS(I), X(I), V(I), COLOR(I) CONTINUE READ(1, *) IREF, WINSIZ READ(1, *) DELTAT, TLAG READ(1, *) DFFVO, DFFK, VEXT, DFFREG, DFFEND, TOFEND READ(1, *) UPDATl, UPDATZ CLOSE(UNITI1) 10 210 ELSE PRINT *, 'Enter number of ions, or 0 to STOP: ' READ (*, *) NIONS IF (NIONS .LT. 1) STOP IF (NIONS .GT. NMAX) THEN PRINT *, 'TOO MANY IONS' GO TO 2 END IF DO 10 I I 1, NIONS PRINT *, 'Enter mass, x, v, and color for ion', I, READ(*, *) MASS(I), X(I), V(I), COLOR(I) CONTINUE PRINT *, 'Enter reference ion number and window half-size: READ(*, *) IREF, WINSIZ PRINT *, 'Enter time step size and lag time: ' READ (*, *) DELTAT, TLAG PRINT *, 'Enter DFFVO, DFFK, VEXT, DFFREG, DFFEND, and TOFEND: ' 000M PRINT * READ(*, *) DFFVO, DFFK, VEXT, DFFREG, DFFEND, TOFEND PRINT *, 'Enter screen-update parameters: ' READ(*, *) UPDATl, UPDATZ END IF USAVEI I UPnATl USAVEZ I UPnATz no 20 I I 1, NIONS XINIT(I) I X(I) XMARK(I) I X(I) V0(I) I V(I) CONTINUE Initialization complete, now Open graphics. CALL GENY(NIONS, I) CALL GOPEN(DEVHDL, WKINSC) Calculate time of arrival at the DFF region for the reference IF (X(IREF) .GT. DFFREG) STOP 'Can"t calculate Tfree' IF (X(IREF) .EQ. DFFREG) THEN TFREE I 0.0 ELSE S I IXINIT(IREF) TOP I SQRT(Z. * MASS(IREF) * KGAMU / COUELE) U0 I 0.5 * MASS(IREF) * KGAMU * V0(IREF) * V0(IREF) TMP I SQRT(S * VEXT / 0.02 + 00) IF (V0(IREF) .GE. 0.) THEN TMP I TMP + SQRT(UO) ELSE TMP I TMP I SQRT(UO) ENDIF 211 TFREE I TOP * s / TMP TMP I 2.0 * SQRT(S * VEXT / 0.02 + U0) TFREE I TFREE + TOP * DFFREG / TMP ENDIF C C Set time I 0 and draw ions in their initial positions. C TIME I 0.0 CALL DRAW(NIONS, XINIT, X, Y, V, XMARK, 1, IREF, WINSIZ, * DEVHDL, COLOR, TIME) C C Start animation when is pressed. C If "P" is pressed, copy screen to plotter. C 99 READ(*, 999) ANSWER IF (ANSWER .EQ. 'P' .OR. ANSWER .EQ. 'p') THEN CALL GOPEN(nEVPL, WKINPL) CALL nRAW(NIONS, XINIT, x, Y, v, XMARK, 1, IREF, * WINSIZ, nEVPL, COLOR, TIME) CALL GCLOSE(DEVPL) PRINT *, 'PLOTTING DONE' GO TO 99 ENDIF 100 IF (DONE(NIONS, X, TOFEND)) GO TO 149 C C Check for a key; pause if found. C STATUS I VSMSTR(DEVHDL, 1, 0, DUMMY, ANSWER) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() IF (STATUS .GT. 0) THEN CALL DRAW(NIONS, XINIT, X, Y, V, XMARK, 1, IREF, * WINSIZ, DEVHDL, COLOR, TIME) IF (ANSWER .EQ. 'P' .OR. ANSWER .EQ. 'p') THEN CALL GOPEN(DEVPL, WKINPL) CALL DRAW(NIONS, XINIT, X, Y, V, XMARK, 1, IREF, * WINSIZ, DEVPL, COLOR, TIME) CALL GCLOSE(DEVPL) PRINT *, 'PLOTTING DONE' PRINT * ENDIF 105 STATUS I VSMSTR(DEVHDL, 1, 0, DUMMY, ANSWER) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() IF (STATUS .EQ. 0) GO TO 105 ENDIF IF (TIME .LT. TLAG) THEN TIME I TIME + 10. * DELTAT CALL MOVE(NIONS, X, XINIT, V, V0, 10.*DELTAT, TIME, MASS, TLAG) ELSE TIME I TIME + DELTAT CALL MOVE(NIONS, X, XINIT, V, V0, DELTAT, TIME, MASS, TLAG) ENDIF 252 IF (UPDATl .EQ. 1) THEN CALL * DRAW(NIONS, XINIT, X, Y, V, XMARK, UPDAT2, * IREF, WINSIZ, DEVHDL, COLOR, TIME) END IF IF (UPDATl .GT. 1) THEN UPDATl I UPDATl - 1 ELSE UPDATl I USAVEl END IF IF (UPDATZ .GT. 1) THEN UPDATZ I UPDATZ - 1 ELSE UPDAT2 I USAVE2 END IF IF (CHECK) THEN IF (FAST(NIONS, x, DFFEND)) THEN DELTAT I DELTAT * 10. CHECK I .FALSE. END IF END IF GO TO 100 149 CALL DRAW(NIONS, XINIT, x, Y, v, XMARK, 1, IREF, WINSIZ, * DEVHDL, COLOR, TIME) 150 READ(*, 999) ANSWER IF (ANSWER .EQ. 'P' .OR. ANSWER .EQ. 'p') THEN CALL GOPEN(nEVPL, WKINPL) CALL nRAW(NIONs, XINIT, x, Y, v, XMARK, 1, IREF, * WINSIZ, nEVPL, COLOR, TIME) CALL GCLOSE(nEVPL) PRINT *, 'PLOTTING DONE' ELSE CALL GCLOSE(DEVHDL) GO TO 1 ENDIF GO TO 150 999 FORMAT (A) END 253 LOGICAL FUNCTION DONE(N, x, TOFEND) Return true if any ions have reached the end of the flight path. 0000 REAL*8 X(N), TOFEND INTEGER I DONE I .FALSE. DO 10 I I 1, N IF (X(I) .GE. TOFEND) DONE I .TRUE. 10 CONTINUE RETURN END 000 000 000 O(7()F' 214 SUBROUTINE DRAW(NIONS, XINIT, x, Y, v, XMARK, UPDATE, IREF, WINSIZ, DEVHDL, COLOR, TIME) Draw line from Old point to new point for each ion. REAL*8 TOFSTA, L0, R1 PARAMETER (TOFSTA I -0.02) PARAMETER (L0 I 0.0) PARAMETER (R1 I 1.0) REAL*8 XINIT(NIONS), X(NIONS), Y(NIONS), V(NIONS), XMARK(NIONS), WINSIZ, TIME REAL*8 XLINE(2), YLINE(2) REAL*8 RANGE, LEFT, RIGHT REAL*8 OFFSET REAL*8 DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND REAL * 8 XFORM INTEGER UPDATE, IREF INTEGER I, K COMMON /DFF/ DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND VDI declaration: INTEGER*2 DEVHDL,- STATUS, ZERO INTEGER*2 XMAP, YMAPl, YMAP2 INTEGER*2 XYVDI (20) , COLOR(NIONS) INTEGER*2 VQERR, VPLINE, VPMARK, VSMCOL, VSLCOL DATA OFFSET /o.05/ DATA ZERO /0/ Draw ion trajactories in upper window. no 10 I I 1, NIONS STATUS I VSLCOL(DEVHDL, COLOR(I)) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() XLINE(l) I XFORM(XINIT(I)) XLINE(Z) I XFORM(X(I)) YLINE(1) I Y(I) YLINE(2) I Y(I) XYVDI(1) I XMAP(XLINE(1), XFORM(TOFSTA), XFORM(TOFEND)) XYVDI(3) I XMAP(XLINE(2), XFORM(TOFSTA), XFORM(TOFEND)) XYVDI (2) I YMAP1(YLINE(1)) XYVDI(4) I YMAP1(YLINE(2)) STATUS I VPLINE (DEVHDL, 2, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() CONTINUE Now draw ions in lower window. LEFT I X(IREF) _ WINSIZ RIGHT I X(IREF) + WINSIZ RANGE I RIGHT - LEFT IF (RANGE .GT. 0.0 .AND. UPDATE .EQ. 1) THEN 000 100 000 105 110 0000 10 215 Erase Old ions... STATUS I VSMCOL(DEVHDL, ZERO) IF (STATUS .LT. 0) PRINT *, 'ERROR IN VSMCOL', VQERR() K I 0 no 100 I I 1, NIONS IF (XMARK(I) .GE. 0.0 .AND. XMARK(I) .LE. 1.0) THEN XYVDI(K+1) I XMAP(XMARK(I), Lo, R1) XYVDI(K+2) I YMAP2(Y(I) + OFFSET) K I K + 2 ENDIF CONTINUE STATUS I VPMARK(DEVHDL, K/2, KYvnI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() .and draw new ones. DO 105 I I 1, NIONS XMARK(I) I (X(I) - LEFT) / RANGE CONTINUE DO 110 I I 1, NIONS IF (X(I) .GE. LEFT .AND. X(I) .LE. RIGHT) THEN STATUS I VSMCOL(DEVHDL, COLOR(I)) IF (STATUS .LT. 0) PRINT *, 'ERROR IN VSMCOL', VQERR() XYVDI(l) I XMAP(X(I), LEFT, RIGHT) XYVDI(2) I YMAP2(Y(I) + OFFSET) STATUS I VPMARK(DEVHDL, 1, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() ENDIF CONTINUE CALL NUMBERS(NIONS, V, X, Y, DEVHDL, TIME, COLOR) END IF RETURN END LOGICAL FUNCTION FAST(N, X, DFFEND) Return true if all ions have passed into the final flight path. REAL*8 X(N), DFFEND INTEGER I FAST I .TRUE. DO 10 I I 1, N IF (X(I) .LT. DFFEND) FAST I .FALSE. CONTINUE RETURN END 000 000 000 000 000 216 SUBROUTINE FINDXV(MASS, x0, vo, TIME, x, V) Return new X and V using zero-length DFF region. IMPLICIT REAL*8 (AII, OIZ) REAL*8 MASS, X0, V0, TIME, X, V REAL*8 ACCEL, TS, TD, KGAMU, COUELE REAL*8 TOP, TMP, U0 REAL*8 DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND COMMON /DFF/ DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND DATA KGAMU, COUELE/ 1.6606EI27, 1.60219E-19/ ACCEL I COUELE * VEXT / (MASS * KGAMU * 0.02) TOP I SQRT(2. * MASS * KGAMU / COUELE) U0 I 0.5 * MASS * KGAMU * vo * v0 / COUELE TMP I SQRT(IXO * VEXT / 0.02 + U0) IF (v0 .GE. 0.) THEN TMP I TMP + SQRT(UO) ELSE TMP I TMP - SQRT(UO) ENDIF TS I -xo * TOP / TMP TMP I 2.0 * SQRT(IXO * VEXT / 0.02 + U0) Tn I TS + TOP * DFFREG / TMP In source... IF (TIME .LT. TS) THEN X I ACCEL * TIME * TIME / 2.0 + V0 * TIME + X0 V I ACCEL * TIME + V0 ELSE IF (TIME .GE. TS .AND. TIME .LT. TD) THEN In FF1... X I V * (TIME - TS) ELSE IF (V .GT. 0.) THEN After FF1, but not yet accelerated by DFF region... TMP I 0.5 * MASS * KGAMU * V * V TMP I TMP + COUELE * (DFFVO + DFFK * (TIME I TFREE)) V I ISQRT(2. * TMP / (MASS * KGAMU)) X I DFFEND ELSE In FF2... (V set to IV as a flag) X I IV * (TIME - TD) + DFFEND ENDIF RETURN END 000 10 217 SUBROUTINE GCLOSE(DEVHDL) INTEGER*2 DEVHDL, STATUS, VQERR STATUS I VCLRWK(DEVHDL) STATUS I VENCUR(DEVHDL) STATUS I VCLSWK(DEVHDL) RETURN END SUBROUTINE GENY(NIONS, Y) Generate ordinate values for plotting ions on the screen. REAL*8 Y(NIONS), DELY INTEGER I IF (NIONS .EQ. 1) THEN Y(l) I 0.5 ELSE DELY I 0.8 / FLOAT(NIONS - 1) no 10 I I 1, NIONS Y(I) I 0.85 - DELY * FLOAT(I - 1) CONTINUE END IF RETURN END 218 SUBROUTINE GOPEN(DEVHDL, WORKIN) C C Open graphics window and draw TOFMS regions. C REAL*8 ZERO, ONE, BACK PARAMETER (ZERO I 0.0) PARAMETER (ONE I 1.0) PARAMETER (BACK I I0.02) REAL*8 X0, X1, X2, X3, X4, Y0, Y1 REAL*8 XBOX(5), YBOX(5), XZBOX(5), YZBOX(5) REAL*8 XLINE(2), YLINE(2) REAL*8 DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND REAL*8 XFORM INTEGER I, K COMMON /DFF/ DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND C C VDI Graphics declarations here: C IMPLICIT INTEGER*2 (V) INTEGER*2 WORKIN(19), WORKOT(66) INTEGER*2 STATUS, DEVHDL INTEGER*2 XYVDI(lO) INTEGER*2 SPEED C Function calls: INTEGER*2 XMAP, YMAPI, YMAP2 DATA Yo, Y1/o.o, 1.0/ DATA YBOX /0.0, 0.0, 1.0, 1.0, 0.0/ DATA xzsox /0.0, 1.0, 1.0, 0.0, 0.0/ DATA stox /0.0, 0.0, 1.0, 1.0, 0.0/ DATA YLINE /0.0, 1.0/ DATA SPEED /25/ X0 I XFORM(BACK) X1 I XFORM(0.0D0) X2 I XFORM(DFFREG) X3 I XFORM(DFFEND) X4 = XFORM(TOFEND) XBOX(1) I XFORM(BACK) XBOX(2) I XFORM(TOFEND) XBOX(3) I XFORM(TOFEND) XBOX(4) I XFORM(BACK) XBOX(5) I XFORM(BACK) C C********** OPEN WORKSTATION C STATUS I VOPNWK(WORKIN, DEVHDL, WORKOT) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() STATUS I VPNSPD(DEVHDL, SPEED) C C********** DRAW LOWER BOX C 10 C 219 K I 1 DO 10 I I'l, 5 XYVDI(K) I XMAP(X2BOX(I), ZERO, ONE) XYVDI(K+1) I YMAP2 (Y2BOX(I)) K I K + 2 CONTINUE STATUS I VPLINE(DEVHDL, 5, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() C********* DRAW UPPER BOX AND TOFMS REGIONS C 20 K I 1 DO 20 I I 1, 5 XYVDI (K) I XMAP(XBOX(I), XFORM(BACK), XFORM(TOFEND)) XYVDI(K+1) I YMAP1(YBOX(I)) K I K + 2 CONTINUE STATUS I VPLINE (DEVHDL, 5, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() XYVDI (2) I YMAP1(YLINE(1)) XYVDI (4) I YMAP1(YLINE(2)) XLINE (1) XFORM (X1) XLINE (2) XFORM (X1) XYVDI(l) I XMAP(XLINE(1), XFORM(BACK), XFORM(TOFEND)) XYVDI(3) I XMAP(XLINE(Z), XFORM(BACK), XFORM(TOFEND)) STATUS I VPLINE (DEVHDL, 2, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() XLINE(l) I XFORM(XZ) XLINE(Z) I XFORM(XZ) XYVDI(l) I XMAP(XLINE(1), XFORM(BACK), XFORM(TOFEND)) XYVDI(3) I XMAP(XLINE(Z), XFORM(BACK), XFORM(TOFEND)) STATUS I VPLINE (DEVHDL, 2, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() XLINE(l) I XFORM(X3) XLINE(Z) I XFORM(X3) XYVDI(l) I XMAP(XLINE(1), XFORM(BACK), XFORM(TOFEND)) XYVDI(3) I XMAP(XLINE(2), XFORM(BACK), XFORM(TOFEND)) STATUS I VPLINE(DEVHDL, 2, XYVDI) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() RETURN END 0000 000 100 220 SUBROUTINE MOVE(NIONS, X, X0, V, V0, DELTAT, TIME, MASS, TLAG) Replace each ion's position with the position it should have at TIME + DELTAT. REAL*8 X(NIONS), X0(NIONS), V(NIONS), v0(NIONS) REAL*8 DELTAT, TIME, MASS(NIONS), TLAG REAL*8 DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND REAL*8 KGAMU, COUELE REAL*8 CC, R, TSD, L REAL*8 YY(2), XX, nT INTEGER NIONS INTEGER I COMMON /DFF/ DFFVO, DFFK, TFREE, VEXT, DFFREG, DFFEND, TOFEND COMMON /CCR/ CC, R, TSD DATA KGAMU, COUELE /1.6606n-27, 1.60219n-19/ TSD I TFREE L I DFFEND I DFFREG VX I VEXT IF (TLAG .NE. 0.) PRINT *, 'TIME LAG NOT ALLOWED' Here we go... DO 100, I I 1, NIONS CALL FINDXV(MASS(I), X0(I), V0(I), TIME, X(I), V(I)) CONTINUE RETURN END 000 000 000 999 000 1000 10 0(7() 2000 221 'SUBROUTINE NUMBERS(NIONS, V, X, Y, DEVHDL, TIME, COLOR) Print ion velocities, etc. on graphics screen. PARAMETER (NMAX I 9) REAL*8 V(NIONS), X(NIONS), Y(NIONS), TIME REAL*8 OFFSET INTEGER I CHARACTER*7 TEXT CHARACTER*9 TEXT9 VDI Declarations: INTEGER*2 DEVHDL, STATUS INTEGER*2 XVDI, YVDI, XTVDI INTEGER*2 YMAPl, YMAP2 INTEGER*2 VQERR, VGTEXT INTEGER*2 COLOR(NIONS), WHITE DATA OFFSET /0.04/ DATA xvnI /1838/ DATA XTVDI /15000/ DATA WHITE /1/ Put time in upper window. WRITE(TEXT9, 999) TIME FORMAT(E9.4) YVDI I YMAP1(Y(1) + OFFSET) STATUS I VSTCOL(DEVHDL, WHITE) STATUS I VGTEXT (DEVHDL, XTVDI, YVDI, TEXT9) Put velocities in upper window. DO 10 I I 1, NIONS IF (X(I) .LE. 0.0) THEN WRITE(TEXT, 1000) V(I) ELSE WRITE(TEXT, 1000) ABS(V(I)) ENDIF FORMAT(F7.0) YVDI I YMAP1(Y(I) + OFFSET) STATUS I VSTCOL(DEVHDL, COLOR(I)) STATUS I VGTEXT(DEVHDL, XVDI, YVDI, TEXT) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() CONTINUE Put positions in lower window. DO 20 I I 1, NIONS WRITE(TEXT, 2000) X(I) FORMAT(F7.5) YVDI I YMAP2(Y(I) + OFFSET) 222 STATUS I VSTCOL (DEVHDL, COLOR(I)) STATUS I VGTEXT(DEVHDL, XVDI, YVDI, TEXT.) IF (STATUS .LT. 0) PRINT *, 'ERROR ', VQERR() 20 CONTINUE RETURN END 000000 000 223 REAL*8 FUNCTION XFORM(X) Transform world coordinates to screen coordinates. This squeezes the last field-free region into the second half of the screen. REAL*8 X REAL*8 DFFK, DFFVO, TFREE, VEXT, DFFREG, DFFEND, TOFEND COMMON /DFF/ DFFK, DFFVO, TFREE, VEXT, DFFREG, DFFEND, TOFEND IF (X .LT. DFFEND .OR. DFFEND .GE. TOFEND) THEN XFORM I X ELSE XFORM I (X - DFFEND) * DFFEND / (TOFEND - DFFEND) + DFFEND ENDIF RETURN END INTEGER*2 FUNCTION XMAP(X, XL, XR) Transform x to device coordinates. PARAMETER (MAXINT I 32767) REAL*8 X, XL, XR IF (X .LT. XL) THEN XMAP I 0 ELSE IF (X .GT. XR) THEN XMAP I MAXINT ELSE XMAP I INT(MAXINT * (X - XL) / (XR I XL)) ENDIF XMAP I 1638 + INT(0.9 * FLOAT(XMAP)) RETURN END 000 000 224 INTEGER*2 FUNCTION YMAP1(Y) Map Y from unit coordinates to upper window PARAMETER (MAXINT I 32767) PARAMETER (HLFMAX I 14000) PARAMETER (TOPHLF I MAXINT I HLFMAX) REAL*8 Y YMAPl I TOPHLF * Y + HLFMAX YMAPl I 1638 + INT(0.9 * FLOAT(YMAP1)) RETURN END INTEGER*2 FUNCTION YMAP2(Y) Map Y from unit coordinates to lower window PARAMETER (MAXINT I 32767) PARAMETER (HLFMAX I 14000) REAL*8 Y YMAP2 I HLFMAX * Y YMAP2 I 1638 + INT(0.9 * FLOAT(YMAP2)) RETURN END 225 Simulation Programs for the Beam Deflection Project This following are listings of the programs BBB and BDTOF, which were used in the beam deflection studies. PROGRAM BDR ............................................................................... 2% main ...................................................................................... 28 gopen ..................................................................................... 234 xmap ..................................................................................... 2% ymap ...................................................................................... 2% rk4 ......................................................................................... 237 draw ...................................................................................... 238 move ...................................................................................... 240 derivs ..................................................................................... 241 done ....................................................................................... 241 collide .................................................................................... 242 data_table ............................................................................... 244 Misc. utility functions .............................................................. 246 DIG routines ........................................................................... 247 PROGRAM BDTOF ........................................................................... 257 main ...................................................................................... 269 rk4 ......................................................................................... %2 derivs ..................................................................................... 263 test ......................................................................................... 261 tab ......................................................................................... % gasdev .................................................................................... %6 ran ........................................................................................ $7 Misc. utility functions .............................................................. %7 This is the animation program which models ion motion through a pair of deflection plates. (The name “BDR” is an acronym for Beam Deflection/Reflectron; it was originally intended for the program to model motion through both the beam deflection plate and a reflectron.) This program is written in Microsoft C and is to be run on an IBM (or compatible) computer. In a manner similar to program ANIMATE, from the dynamic-field focusing project, it displays colored dots on the screen which represent ions, and it moves these dots to represent ion motion. Graphics output to the screen is accomplished via the Microsoft C graphics library (included with the compiler). Output to an HPGL-language plotter and to a Postscript-language printer are accomplished routines written by Drake Diedrich using the dig . h header file. Description of Routines: main The main pregram obtains the required input from the user and controls the iterations through the routines which calculate ion motion, display ions on the screen, etc. Compilation of this and other modules requires the header files bdr .h and dig . h. gopen Open graphics window, draw box, deflection plates, slit, and ions at their initial positions. xmap Map x coordinate in (O, 1) space to physical device units. ymap Map y coordinate in (0, 1) space to physical device units. rk4 This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 553, performs fourth-order Runge-Kutta integration. derivs This routine calculates derivatives (dV/dt values) for rk4 . draw 227 Draw ions in new positions (and remove old ones) to simulation ion motion. move Calculate new positions of ions after one time step. done Check to see if program is done (all velocities equal zero). collide Stop ions which hit the plates, etc. data_tab 1e Output position and velocity of moving ions, as well as the packet width (max — min of moving ions) to the screen. Misc. utility functions These are functions from the C version of Numerical Recipies which allocate array space, etc. DIG routines This is Drake Diedrich’s library of Device-Independent Graphics routines for screen, HPGL, and Postscript graphics output. /* ** bdr.h */ #define TRUE -1 #define FALSE 0 #define OR ll #define AND && #define MAXIONS 50 #define KGAMU 1.66063-27 #define COUELE 1.60219E-l9 #define PI 3.14159265359 #define RperD (2.0 * PI / 360.0) #define ROWl (short) 1 #define COLl (short) 7 #define ROWZ (short) 2 #define COLZ (short) 7 #define ROW3 (short) 3 #define COL3 (short) 7 #define ROW4 (short) 1 #define COL4 (short) 40 #define Rows (short) 2 #define COLS (short) 40 /* ** dig.h */ #include #include extern FILE *gcom; #define SCREEN 0 #define HP 1 #define POST 2 int setvideomode(int,int); struct videoconfig *getvideoconfig(struct videoconfig *,int); int setcolor(int,int); int ellipse(int,int,int,int,int,int); void clearscreen(int,int); int rectangle(int,int,int,int,int,int)z int lineto(int,int,int); struct xycoord moveto(int,int,int); int setpixel(int,int,int); void outtext(char *,int); struct rccoord settextposition(int,int,int); int settextcolor(int,int); int arc(int,int,int,int,int,int,int,int,int); /* ** */ bdr.c #include #include #includeo #include #include #include #include "bdr.h" #include "dig.h" /* ** ** ** ** ** *‘k ** */ /* *1: */ */ BDR Animation of beam-deflection reflectron instrument. Deflection plates located from plate_x1 to plate_x2 in the x-direction, and at plate_y1 and plate_y2 in the y-direction. External variables: double window_x, window_y: /* View window extrema */ double x_slope, y_slope, x_intcp, y_intcp; /* Screen scale factors double plate_xl, plate_x2, plate_y1, plate_y2; /* Dev. plate */ double slit_x, slit_y1, slit_y2;/* Slit parameters */ double def_volt; /* Deflection plate voltage */ double def_v1, def_v2, def_v3; /* Initial, mid, and final voltages */ double def_v_tl, def_v_t2, def_v_t3, def_v_t4; /* Voltage held at def_v1 till time dev_v_t1, then ramped to def_v2, reaching it at time dev_v_t2, held there till def_v_t3, then ramped to def_v3, reaching it at time def_v_t4. */ char *quittext I "Hit to quit "; char *datatext I "Hit for data table “: char *pausetext I "Hit any other key to pause ('P' to Plot) char *conttext "Hit any key to continue "; char *donetext "DONE: Hit any key to finish ". main(int argc, char *argv[]) { /* ** Variable declarations: */ double massIMAXIONS], x[MAXIONS], VXIMAXIONS], y[MAXIONS], vy[MAXIONS]; double time, delta_t, rampl, ramp2; /* t, dt, def. volt. ramp times */ double vel, ang, swap; /* Temporary storage */ int color[MAXIONS]; /* Ion colors */ steps int n_ions; /* Number of ions */ int draw_freq; /* Redraw after this # of */ . int pltdev; /* Plot device code */ int 1: char string[80], ch; struct videoconfig vc; FILE *fp; /* ** Function declarations: */ void gopen(int); /* Open graphics */ void draw(int, double I], double [1, int [1, int); /* Draw ions */ void move(int, double *, double *, double *, double *, double *, double, double); /* Move ions */ int done(int, double *, double *, double *, double *):/* See if done */ void collide(int, double *, double *, double *, double *): /* Stop ions which hit plates, etc. */ void data_table(int, double *, double *, double *, double *): /* Output data */ /* ** Program: ** ** INPUT DATA */ if (argc > 1) /* Open file: */ { if ((fp I fopen(argv[1], "r")) II NULL) { printf("Error opening %s\n", argv[1]); exit(0); } } else do { printf("Enter name of data file: "): } while ((fp I fopen(gets(string), "r")) II NULL); n_ions I atoi(fgets(string, 80, fp)); /* Get number of ions */ if (n_ions > MAXIONS) { printf("ERROR: Too many ions!\n"); exit(0); l for (i I 0; i < n_ions; ++i) { fgets(string, 80, fp); /* Read a line... */ sscanf(string, "%lf, %lf, %lf, %lf, %lf, %d\n", mass+i, x+i, y+i, &vel, sang, color+i); /* ... and get initial position, velocity, angle, and ion symbol color */ 231 vx[i] I vel * cos(RperD * ang): /* Calculate velocities */ vy[i] I vel * sin(RperD * ang); /* in x and y directions */ } delta_t I atof(fgets(string, 80, fp)): /* Get time step-size */ fgets(string, 80, fp); /* Read a line and ... */ sscanf(string, "%lf, %lf, %lf, %lf\n", /* ... get plate dimensions */ &plate_x1, splate_x2, aplate_yl, &plate_y2): fgets(string, 80, fp); /* Read a line and ... */ sscanf(string, "%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf\n", /* ... get voltage parameters */ adef_vl, &def_v2, &def_v3, &def_v_t1, &def_v_t2, &def_v_t3, &def_v_t4); fgets(string, 80, fp); /* Read a line and ... */ sscanf(string, "%lf, %lf, %lf\n", /* ... get slit parameters */ Sslit_x, &slit_yl, sslit_y2); fgets(string, 80, fp): /* Read a line and ... */ sscanf(string, "%lf, %lf\n", /* ... get window extrema */ &window_x, Swindow_y); draw_freq I atoi(fgets(string, 80, fp));/* Get redraw frequency */ fclose(fp); /* ** Make sure plate and slit dimensions are ordered properly: */ if (plate_x1 > plate_x2) { swap I plate_x1; plate_x1 I plate_x2; plate_x2 I swap; } if (plate_yl > plate_y2) { swap I plate_y1: plate_y1 I plate_y2; plate_y2 I swap; ) if (slit_y2 < slit_yl) { swap I slit_yl; slit_y1 I slit_y2; slit_y2 I swap: } /* ** Calculate deflection voltage ramps: */ if (def_v_t1 lI de£_v_t2) rampl I (def_v2 - def_vl) / (def_v_t2 - def_v_tl); if (def_v_t3 !I def_v_t4) ramp2 I (def_v3 - def_v2) / (def_v;t4 - def_v_t3); /* ** OPEN GRAPHICS */ gopen(SCREEN); 232 if (argc > 2) t if (stricmp(argv[2], "HP") II 0) pltdev I HP: else if (stricmp(argv[2], "POST") II 0) pltdev I POST: else pltdev I SCREEN: if (pltdev !I SCREEN) if (argc > 3) { gcom I fopen(argv[3], "w"); } gopen(pltdev): } draw(n _ions, x, y, color, SCREEN); if (pltdev lI SCREEN) draw(n _ions, x, y, color, pltdev); time I 0. 0; /* Initialize time */ _settextposition(ROW4, COL4): /* Output time ... */ printf("Time I %10. 5e", time): /* ... on screen */ def_volt I def_v1;/* Initialize voltage */ _settextposition(ROW5, COLS); /* Output voltage on screen */ printf("Deflection Voltage I %+10. 5f", def _volt); while (lkbhit() ) /* Pause until keystroke */ if ((ch I getch()) II 27) /* Clean up char, */ goto EXIT: /* if ESC, quit. */ else if (ch II ' ')/* see if for data */ { data_table(n_ions, x, vx, y, vy); _settextposition(ROWl, COLl); _outtext(quittext): _settextposition(ROW2, COLZ); _outtext(datatext); } _settextposition(ROW3, COL3); _outtext(pausetext): /* ** START ANIMATION */ i I 0; while (! done(n_ions, x, y, vx, vy)) { time +- delta_t: if (time >- def_v_t1 AND time < def_v_t2) def_volt I def_vl + (time I def_v_tl) * rampl; else if (time >- def_v_t2 AND time < def_v_t3) def_ volt I def _v2: else if (time >- def_ v _t3 AND time < def_ v _t4) def_ volt I def_ _v2 + (time I def_ v _t3) * ramp2; else if (time >- def_v_t4) def_volt I def_v3: /* ** */ EXIT: 233 move(n_ions, mass, x, vx, y, vy, time, delta_t): if (kbhit() ) /* If keystroke... */ { if ((ch I getch()) II 27) /* Clean up last char, */ goto EXIT; /* if , quit, else */ else if (ch II ' ')/* see if for data */ data_table(n_ions, x, vx, y, vy); else { /* see if

for print */ if (toupper(ch) II 'P') draw(n_ions, x, y, color, pltdev); ‘_settextposition(ROW3, COL3): _outtext(conttext); while(!kbhit()) /* pause, and wait for */ ; /* next keystroke, */ getch(): /* then clean it up */ } Restore text: _settextposition(ROW1, COLl); _outtext(quittext); _settextposition(ROW2, COL2); _outtext(datatext); _settextposition(ROW3, COL3): _outtext(pausetext); } collide(n_ion3, x, vx, y, vy); ‘ /* Stop ions which have hit plates */ _settextposition(ROW4, COL4); /* Update time on screen */ printf("Time I %10.Se", time); if (1 II draw_freq) { ‘_settextposition(ROW5, COLS): printf("Deflection Voltage I %+10.5£", def_volt); draw(n_ions, x, y, color, SCREEN): i I 0: } else ++i: DONE, NOW PAUSE TO VIEW SCREEN, THEN EXIT _settextposition(ROW3, COL3); _outtext(donetext); while(!kbhit() ) /* Wait for keystroke */ getch(); /* Clean up char */ ._setvideomode(_DEFAULTMODE); /* Return to text screen */ if (pltdev !I SCREEN): setvideomode(_DEFAULTMODE, pltdev): } #include #include #include #include "bdr.h" #include "dig.h" void gopen(int pltdev) { /* ** */ /* ** */ /~k ** */ /* ** */ /* ** */ Variable declarations: struct videoconfig vc: extern double x_slope, y_slope, x_intcp, y;intcp; extern double plate_x1, plate_x2, plate_y1, p1ate_y2: extern double slit_x, slit_y1, slit_y2; extern double window_x, window_y; extern char *quittext, *datatext, *pausetext, *conttext: Function declarations: int xmap(doub1e, int): Ymap(double, int): Program: setvideomode(_ERESCOLOR, pltdev): if (pltdev !I SCREEN) setcolor(l, pltdev); if (pltdev II SCREEN) { _settextwindow(1, 1, 3, 80): _clearscreen(_CCLEARSCREEN); _settextcolor(7); } getvideoconfig(&vc, pltdev); x_slope I (0.9 * (float) vc.numxpixels); x_intcp I (0.05 * (float) vc.numxpixels); y_slope I (I0.8 * (float) vc.numypixels); y_intcp I (0.95 * (float) vc.numypixels); Draw box around screen. moveto(xmap(0., 1), ymap(0., 1), pltdev); lineto(xmap(l., 1): ymap(0., 1), pltdev); 1ineto(xmap(1., 1), ymap(1., 1), pltdev): lineto(xmap(0., 1), ymap(1., 1), pltdev); lineto(xmap(0., 1), ymap(0., l), pltdev); Output instruction text if (pltdev II SCREEN) { /* ** ** *‘k */ /* ** */ /* ** */ 235 _settextposition(ROW1, COLl); _outtext(quittext): _settextposition(ROW2, COLZ); _outtext(datatext): _settextposition(ROW3, COL3): ‘_outtext(conttext); ) Now set up proper transformation to map window onto screen. (Window goes from 0 to window_x in x-direction and 0 to window_y in y direction.) x_slope /I window_x; y_slope /I window_y: Draw deflection plates. moveto(xmap(plate_x1, 1), ymap(plate_y1, l), pltdev); lineto(xmap(plate_x2, l), ymap(plate_y1, 1), pltdev); moveto(xmap(plate_x1, 1), ymap(plate_y2, 1), pltdev); lineto(xmap(plate_x2, l), ymap(plate_y2, l), pltdev); Draw slit. moveto(xmap(slit_x, 1), ymap(slit_yl, 1), pltdev); lineto(xmap(slit_x, 1), ymap(O, 1), pltdev); moveto(xmap(slit_x, l), ymap(slit_y2, 1), pltdev); lineto(xmap(slit_x, 1), ymap(window_y, 1), pltdev); return: /* ** ** ** *‘k */ xmap.c Convert x-coordinate in (0, 1) space to physical device units for the window specified by mode. extern double x_slope, y_slope, x_intcp, y_intcp: int xmap(double x, int mode) { /* ** ** ** ** */ switch (mode) { case 1: return((int) (x * x_slope + x_intcp)); break: default: printf("Invalid mode (%d) in xmap\n", mode); exit(0); ymap.c Convert y-coordinate in (0, 1) space to physical device units for the window specified by mode. extern double x_slope, y_slope, x_intcp, y_intcp: int ymap(double y, int mode) { switch (mode) { case 1: return((int) (y * y_slope + y_intcp)); break: default: printf("Invalid mode (%d) in ymap\n", mode); exit(0); #include #include #include #include /* ** *t ** *a: */ rk4.c This is a Runge-Kutta routine based on that in "Numerical Recipies in C", p. 572. void rk4(double y[J, int n, double x, double h, void (*derivs)(double, double *, double *)) { /* ** */ /* ** */ Variable declarations: int i: double xh, hh, h6, *dyO, *dym, *dyt, *yt: Function declarations: double *vector(int, int): void free_vector(double *, int, int); dyO I vector(0, n I 1); dym I vector(0, n I 1); dyt I vector(0, n I 1); yt I vector(0, n I 1); hh I h * 0.5: h6 I h / 6.0: xh I x + hh; (*derivs) (x, y, dyO): for (i I O; i < n; ++i) ytlil ' Ylil + hh * dy0[i]; (*derivs)(xh, yt, dyt): for (i I 0; i < n; ++i) ytti] - Yli] + hh * dytli]: (*derivs)(xh, yt, dym): for (i I 0; i < n; ++i) { ytli] - y[i] + h * dymti]; dymli] +- dytli]: } (*derivs)(x+h, yt, dyt): for (i I 0; i < n; ++i) y[i] +- 116 * (dyOliJ + dyt[i] + 2.0 * dym[i]); free_vector(yt, 0, n I 1): free_vector(dyt, 0, n I 1): free_vector(dym, 0, n I l): free_vector(dy0, 0, n I 1): return; /* ** draw.c ** ** Draw ions. *1): */ void draw(int n_ions, double x[], double y[], int color[], int pltdev) { /* ** Variable declarations: */ int i: int x1, y1, x2, y2; static double xold[MAXIONSl, YoldtMAXIONS]: static int first I TRUE: /* ** Function declarations: */ int xmap(double, int), ymap(double, int); /* ** Erase old ions. */ if (! first AND pltdev II SCREEN) { for (i I 0: i < n_ions: ++i) { if (xoldli) II x[i] AND yold[i] II y[iJ) continue: x1 I xmap(xold[i], 1) I 2; yl I ymap(yold[i], 1) - 2: x2 I x1 + 4; y2 I yl + 4; _setcolor(0): _ellipse(_CFILLINTERIOR, x1, y1, x2, y2); _setcolor(color[i]); _ellipse(_CBORDER, x1, y1, x2, y2); } } else if (pltdev II SCREEN) { for (i I 0; i < n_ions; ++i) I xoldIi] I x[i]: YOldli] - y[i]; } } /* ** Draw ions in thein new locations. */ for (i I 0; i < n_ions: ++i) { if ((l first) AND (pltdev II SCREEN) AND (xold[il II x[i] AND yold[i] II y[i])) continue: setcolor(color[i], pltdev); 239 x1 I xmap(x[i], 1) I 2, yl I ymap(yli], 1) - 2: x2 I x1 + 4: y2 I yl + 4: ellipse(_CFILLINTERIOR, x1, yl, x2, y2, pltdev): } if (first) first I FALSE: for (i I 0: i < n_ions: ++i) ( xold[i] I XIi]: YOldli] - y[iJ; ) if (pltdev !I SCREEN) . grestore(): - } #include #include #include "bdr.h" /* ** move.c ** ** Move ions one step. */ void move(int n_ions, double mass[], double x[], double vx[], double Y”! double vy[], double time, double delta_t) { /* ** Variable declarations: */ double xxISJ: int i: /* ** Function declarations: */ void rk4(double *, int, double, double, void (*)()): void derivs(double, double *, double *): /* ** Move ions: */ for (i I 0; i < n_ions; ++i) { . um] I Hi]: xx[1] I vx[i]; xxl2] I Hi]: xx[3] I vyli]: xx[4] I mass[i]: rk4(xx, 5, time, delta_t, derivs): x[i] I xx{0]: vx[i] I xxlll: y[i] I xxl2]: vy[i] I xxl3]: ) /* *‘k */ 241 Here is the derivative function: void derivs(double t, double x[], double dx[l) { /* *i' ** */ /* *‘k */ extern double plate_x1, plate_x2, plate_y1, plate_y2: extern double def_volt: First, do x-direction: (Just move at constant velocity.) dx[O] I x[l]: /* dx/dt I V */ dx[l] 0.0: /* dv/dt I'a I 0.0 */ Now y-direction: region: */ if (x[0] < plate_x1 OR x[0] > plate_x2 OR /* Field-free: */ x[2] < plate_y1 OR x[2] > plate_y2) I dx[2] I x[3]; /* dy/dt I v */ dx[3] I 0.0: /* dv/dt I a I 0.0 */ } else /* In deflection { dx[2] I x[3]; /* dy/dt I v */ dx[3] I COUELE * def_volt / (KGAMU * x[4] * fabs(plate_y2 I p1ate_y1)); } dx[4] I 0.0; /* dx[4] is not used */ #include #include "bdr.h" /* ** ** ** */ done.c Return TRUE if all velocities are zero. int done(int n_ions, double x[], double y[], double vx[], double vy[]) { int i: extern double window_x, window_y: for (i I 0: i < n_ions: ++i) if (vx[i] > 0.0 OR vy[i] > 0.0) return(FALSE): return(TRUE); #include #include "bdr.h" /* ** collide.c ** ** Stop ions which have hit a deflection plate or slit, or leave window. ** ** Note: this code may not function properly if slit_x II 0. */ void collide(int n_ions, double x[], double vx[], double y[], double VY[]) { int i: static double xold[MAXIONS]; extern double plate_x1, plate_x2, plate_y1, plate_y2: extern double slit_x, slit_y1, slit_y2: extern double window_x, window_y; /* ** Check for those that have hit a deflection plate: */ for (i I 0: i < n_ions; ++i) { . if ((xti] >I plate_xl AND x[i] I plate_y2)) { vx[i] I 0.0: VYli] I 0.0: if (y[i] I plate_y2) y[i] I 1.001 * plate_y2: } } /* ** Check for those that don't pass throught slit */ for (i I 0; i < n_ions; ++i) { if ((xoldli] slit_x) AND (y[i] < slit_y1 OR y[i] > slit_y2)) { vx[i] I 0.0: vy[i] I 0.0: } xoldli] I x[i]: } /* ' ** Check for those that have left window: */ for (i I 0; i < n_ions: ++i) { 243 if (x[i] < 0.0 OR x[i] > window_x OR y[i] < 0.0 OR y[i] > window_y) { vx[i] I 0.0: vy[i] I 0.0: } #include #include #include #include "bdr.h" /* ** data_table.c ** ** Output position and velocity for moving ions. :: Also output packet width ([xmax-xmin] of moving ions). void data_table(int n_ions, double x[], double vx[], double y[], double VYIJ) { double min, max, width: int i_min, i_max; int line, last, 1: char string[80]; /* ** POSITIONS AND VELOCITIES: */ line I 1; last I 0: ‘_settextposition(l, 1): _outtext("\n\n\n\n\n"); /* Clear text window */ for (i I 0; i < n_ions; ++i) { if (vx[i] !- 0.0 OR vy[i] !I 0.0) { sprintf(string, "\nIon %2d: x I %10.5f, vx I %10.4f, y I %10.5f, vy I %10.4f", i+1l XIi], vx[i]: Y[i]r VYULJ); _settextposition(3, 1); _outtext(string); last I line: if (line < 3) ++line: else { while (! kbhit()) /* Pause to view */ getch(); /* Clean up char */ line I 1: l } if (last !I 3) { for (i I l; i <- (3 - last); ++i) _outtext("\n"); /* Blank lines */ while (! kbhit()) /* Pause to view */ getch(); /* Clean up char */ } /~k ** PACKET WIDTH: */ _outtext("\n\n\n\n\n"): /* Clear text window */ min I 1.e32; max I I1.e32: for (i I 0; i < n_ions; ++i) I if (vx[i] II 0.0 OR vy[i] II 0.0) I if (x[i] < min) I min I x[i]: i_min I i: } if (x[i] > max) I max I Klil: i_max I i: l } } width I max I mdn: sprintf(string, "Packet Width I %10.5f m", width): _settextposition(1, 1): _outtext(string); sprintf(string, " II> %15.8e sec", width * 2.0 / va[i_max] + vx[i_min])); _settextposition(2, 1): _outtext(string); while (! kbhit()) /* Pause to view */ getch(); /* Clean up char */ _settextposition(1, 1): } ‘_outtext("\n\n\n\n\n"); /* Clear text window */ 246 /* ** Here are the utility routines: */ void nerror(char error_text[]) I void exitI): fprintf(stderr, "Numerical Recipies run-time error...\n"); fprintf(stderr, "%s\n", error_text); exit(l); } double *vector(int nl, int nh) I double *v: v I (double *) malloc((unsigned) (nh I n1 + 1) * sizeof(double)); if (!v) nerror("allocation failure in vectorI)"): return(v I nl): } void free_vector(double *v, int nl, int nh) I free((char *) (v + nl)): } 247 #include #include #include #include "dig.h" #define PI 3.1415926535 FILE *gcom-NULL; int hp_x,hp_y,hp_highI0,hp_wideI0,hp_pen-0; float post_scale: int post_wide,post_high,post_x,post_y: #define SCREEN 0 #define HP 1 #define POST 2 int setvideomode(mode,dev) int mode; int dev: I switch (dev) I case SCREEN: return (_setvideomode(mode)); case HP: switch (mode) { case _DEFAULTMODE: if (gcom) { fprintf(gcom,"SP 0;\n"): fclose(gcom): } gcomINULL: return (_DEFAULTMODE); case‘_TEXTBW40: case _TEXTC40: hp_wideI40: hp_high-25: break: case _TEXTBWBO: case _TEXTCBO: case _TEXTMONO: hp_wideI80: hp_highI25: break: case _MRESACOLOR: case _MRESNOCOLOR: case';MRE8256COLOR: hp_wideI320: hp_highI200: break: case _RRESBW: case _RRESIGCOLOR: hp_wideI640: hp_high-200: break: case _ERESNOCOLOR: case _ERESCOLOR: hp_wideI640: I . hp_high-350: break; case _VRESZCOLOR: case _VRESlGCOLOR: hp_wideI640: hp_high=480: break; } if (gcomIINULL) gcomIfopen("com1","w"); if (gcomIINULL) return (0); fprintf(gcom,"IN; SC 0,%d,0,%d;\n“,hp_wideIl,hp_high-l); return (mode); case POST: switch (mode) { case _DEFAULTMODE: if (gcom) { fprintf(gcom,"showpage\ngrestore\r\n"); fclose(gcom): } gcomINULL; return (_DEFAULTMODE); case _TEXTBW40: case _TEXTCdO: post_wideI40: post_high-25: break; case _TEXTBW80: case _TEXTC80: case _TEXTMONO: post_wideI80: post_highI25: break: case _MRESdCOLOR: case _MRESNOCOLOR: case _MRESZSGCOLOR: post_wideI320: post_high-200: break: case _RRESBW: case _RRESlGCOLOR: post_wideI640: post_high-200: break: case _ERESNOCOLOR: case _ERESCOLOR: post_wideI640: post_high-350: break: case _VRESZCOLOR: case _VRESlGCOLOR: post_wideI640: post_high-480: break; } if (gcomIINULL) gcomIfopen("com1","w"); if (gcomIINULL) return (0); 249 fprintf(gcom,"gsave erasepage %f %f scale 90 rotate\n", (float)8*72./post_high,(float)10*72./post_wide); fprintf(gcom,"%d %d translate\n",post_wide/25,I (post_high*26/25)): fprintf(gcom,"/Times-Roman findfont %d scalefont setfont\n",post_high*4/5/25); return (mode); } return (0): } struct videoconfig * getvideoconfig(config,dev) struct videoconfig *config: int dev; I switch (dev) { case SCREEN: return ((struct videoconfig *)_getvideoconfig(config)); case HP: 5 config->numxpixels=hp_wide: ‘ configI>numypixelsIhp_high: configI>numtextcolsI25: configI>numtextrowsI80; configI>numcolorsI7; configI>bitsperpixelI3; configI>numvideopagesI1: return (config); case POST: config->numxpixelstost_wide: configI>numypixelstost_high: configI>numtextcolsI25: configI>numtextrowsI80: configI>numcolors-2: configI>bitsperpixelI1: configI>numvideopagesI1: return (config); I } return (NULL): } int setcolor(color,dev) int color: int dev: I int last: switch (dev) I case SCREEN: return (_setcolor(color)); case HP: if (gcom-INULL) return (0); fprintf(gcomr”SP %d;\n",color); last-hp_pen: hprenIcolor: return (last); return (0): } int ellipse(control,x1,y1,x2,y2,dev) int control,xl,y1,x2,y2; int dev; I int cx,cy,x,y,scale; switch (dev) I case SCREEN: return (_ellipse(control,x1,y1,x2,y2)); case HP: if (gcomIINULL) return (0); cx=(x1+x2)/2; cyI(y1+y2)/2: fprintf(gcom,"PU %d,%d; ",cx,hp_high-1Icy); scale-hp_high/(y2-cy)*(x2-cx); fprintf(gcom,"SC O,%d,0,%d; ",hp_wide-l,scale); fprintf(gcom,"CI %d; ",x2-cx); fprintf(gcom,"SC 0,%d,0,%d;\n",hp_wide-1,hp_high-1); return (1); case POST: if (gcomIINULL) return (0); cxI(x1+x2)/2: cy-(yl+y2)/2: /* don't ask me why I couldn't cx-xl cnyl scale, it didn't work */ fprintf(gcom,"gsave %d %d translate 1 %f scale newpath 0 0 %d 0 360 arc closepath ", cx,post_high-cy-1,(float)(cy-yl)/(cx-x1),cx-x1); switch (control) { case _GBORDER: fprintf(gcom,"stroke grestore\n"): return (1); case _GFILLINTERIOR: fprintf(gcom,"fill grestore\n"); return (1): default: fprintf(gcom,"grestore\n"); return (0): } fprintf(gcom,"grestore\n”): } return (0): } void clearscreen(area,dev) int area: int dev; { switch (dev) { case SCREEN: _clearscreen(area); return; case POST: 251 if (gcomIINULL) break; fprintf(gcom,"erasepage\n"); return: } int rectangle(control,x1,y1,x2,y2,dev) int control,xl,yl,x2,y2: int dev; I switch (dev) ( case SCREEN: return (_rectangle(control,x1,y1,x2,y2)); case HP: if (gcom-INULL) return (0); fprintf(gcom,"PU %d,%d; EA %d,%d;\n",x1,hp_high-y1- 1,x2,hp_high-y2-1); hp_xIx1: th'yl: return (1): case POST: if (gcomIINULL) return (0); fprintf(gcom,"newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto %d %d lineto closepath stroke\n", x1,post_high-y1-1,x2,post_high-y1-1, x2,post_high-y2-l,x1,post_high-y2-1, x1,post_high-yl-l); post_XIx1; post_y=y1: return (1): } return (0); } int lineto(x,y,dev) int x,y; { switch (dev) { case SCREEN: return (_lineto(x,y)); case HP: if (gcomIINULL) return (0); fprintf(gcom,"PD %d,%d;\n",x,hp_high-1Iy); return (1): case POST: if (gcom-INULL) return (0); fprintf(gcom,"newpath %d %d.moveto %d %d lineto stroke\n", post_x,post_high-post_y-1,x,post_high-y-1); post_xIx: post_ny: return (1): } return (0): } struct xycoord '5. 252 moveto (x,y, dev) int x,y: int dev; I struct xycoord xy: switch (dev) { case SCREEN: return (_moveto(x,y)); case HP: xy.xcoord=hp_x: xy.ycoord=hp_y: if (gcom-INULL) break; fprintf(gcom,”PU %d,%d;\n",x,hp_highI1-y); hp_xIx: th-y: return (xy); case POST: xy.xcoordeost_x: xy.ycoordeost_y: post_x-x; P°3t_Y'Y: return (xy); } return (xy); } int setpixel(x,y,dev) int x,y; int dev: I switch (dev) I case SCREEN: return (_setpixel(x,y)); case HP: if (gcomIINULL) return (0); fprintf(gcom,"PU %d,%d; PD; PU;\n",x,hp_high-1Iy); return (1): 1 return (0): } void outtext(text,dev) char *text: int dev; I int i: switch (dev) { case SCREEN: _outtext(text); return; case HP: if (gcomIINULL) return: fprintf(gcom,'PU %d,%d; LB %s\003\n",hp_x,hp_high-hp_y- 1,text): return; 253 case POST: if (gcomIINULL) return; fprintf(gcom,"%d %d moveto (",post_x,post_high-post_y+2); for (iI0;text[i]!I0;i++) { switch (text[i]) { case '\n': fprintf(gcom,"\\n"); break; case '\t': fprintf(gcom,"\\t"); break; case '\r': fprintf(gcom,"\\r"); break; case '\b': fprintf(gcom,”\\b"); break; case '\f': fprintf(gcom,"\\f"); break; case '(': fprintf(gcom,"\("); break; case ')': fprintf(gcom,"\)”): break: default: if (text[i])31 && text[i]<127) fputc(text[i],gcom); break; } ) fprintf(gcom,") show\n"); return; } return: } struct rccoord settextposition(row,column,dev) I struct rccoord rc: switch (dev) { case SCREEN: return (_settextposition(row,column)); case RP: if (gcomIINULL) break; rc.col-hp_x*80/hp_wide+1: rc.row-25Ihp_y*25/hp_high: hp_xI(columnI1)*hp_wide/80: hp;yIrow*hp_high/25: return (rc): case POST: if (gcomIINULL) break; rc.col-post_x*80/post_wide+1: rc.rowI25-post_y*25/post_high; post_xI(columnI1)*post_wide/80; post_yIrow*post_high/25: return Irc): l return (rc); } int settextcolor(pixel,dev) int pixel; int dev: I int pen; switch (dev) ( case SCREEN: return (_settextcolor(pixel)); case HP: 254 if (gcomIINULL) return (0); fprintf(gcom,"SP %d:\n",pixel): hp_penIpixel; return (pen); } return (0): } extern FILE *gcom; int arc(x1,y1,x2,y2,x3,y3,x4,y4,dev) int x1,y1,x2,y2,x3,y3,x4,y4; int dev: I int cx,cy,x,y,dx,dy; float start,sweep,r,scale: double atan(),sqrt()psin(),cos(); switch (dev) { case SCREEN: return (_arc(x1,y1,x2,y2,x3,y3,x4,y4)); case HP: if (gcomIINULL) return (0); cx-(x1+x2)/2: cyI(y1+y2)/2: scale-(float)(x2-cx)/(y2-cy); start-atan( (double)Iy3-cy)*scale/(x3-cx) )*180/PI; if (x3>cx) start+I180: sweep-atan( (double)(y4-cy)*scale/(x4-cx) )*180/PI; if (x4>cx) sweep+-180: sweep-startIsweep: while (sweep<0) sweep+I360: while (sweep>-360) sweep-I360; rIx2ch: xch+(x3ch)*r/sqrt( (double) (x3-cx)*(x3-cx)+(y3-cy)*(y3- CY) ): yIcy+(y3-cy)*r/sqrt( (double) (x3-cx)*(x3-cx)+(y3-cy)*(y3- CY) ): fprintf(gcom,"PU %d,%d; PD;",x,hp_high-1Iy); fprintf(gcom,”SC 0,%d,0,%3.0f; ",hp_wide-1,scale*(hp_high- 1)): fprintf(gcom,”AA %d,%3.0f,%3.0f; ",cx,(hp_high-cy- 1)*scale,sweep); fprintf(gcom,"SC 0,%d,0,%d;\n",hp_wideI1,hp_highI1); return (1): case POST: if (gcomIINULL) return (0); cx-(x1+x2)/2; cyI(y1+y2)/2i scale-(float)(x2ch)/(Y2-cy); start=atan( (double)(cy-y3)*scale/(x3-cx) )*180/PI; if (x3I360) start-I360; sweep-atan( (double)(cy-y4)*scale/(x4-cx) )*180/PI: if (x4-360) sweep-I360; fprintf(gcom,"gsave %d %d translate 1 %f scale newpath 0 0 %d %f %f arc stroke grestore\n", cx,post_high-cy-1,(float)(cy-yl)/(cx-x1),cx-x1, start,sweep): return (1); } return (0): fiinclude #include #include #include #include /* ** ** *‘k */ void gre I /* ** */ St "bdr.h" "dig.h" grestore.c Restore global scale factors to those of the screen. store(void) Variable declarations: ruct videoconfig vc: extern double x_slope, y_slope, x_intcp, y_intcp: extern double window_x, window_y: /* *‘k */ in /* ** */ Function declarations: t xmap(double, int), ymap(double, int): Program: _getvideoconfig(&vc): x_slope I (0.9 * (float) vc.numxpixels); x_intcp I (0.05 * (float) vc.numxpixels); y_slope I (IO.8 * (float) vc.numypixels); y_intcp I (0.95 * (float) vc.numypixels); x_slope /I window_x; y;slope /I window_y: return: k... 257 817101" This program, which is similar to the SIMTOF programs presented in this appendix, generates peak shapes for a beam deflection TOFMS instrument. main The main program obtains the required input from the user and controls the iterations through the space and energy distributions, etc.. rk4 This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 553, performs fourth-order Runge-Kutta integration. derivs This routine calculates derivatives (dV/dt values) for rk4 . test This routine checks to see whether the given ion (specified by initial location within the beam, velocity, and mass, etc.) will pass through the aperture and thus be part of the ion packet. tab In this routine, flight times are tabulated in a histogram. The flight times are mapped into bin numbers (array positions, that is); then the corresponding array value is incremented. gasdev This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 203, generates random numbers drawn from a normal distribution with zero mean and unit variance. ran This routine returns a random number between 0.0 and 1.0. The built-in library routine rand supplied by the VAX-11 C compiler generates integer random numbers from the range 0 to (231 - 1). These integers are converted to floating point and divided by (231 — 1) to yield the desired uniform deviates. "/ 258 Misc. utility functions These are functions from the C version of Numerical Recipies which allocate array space, etc. #include #include /* ** bdtof.c ** ** Simulate Beam-Deflection Time-of-Flight Mass Spectrometer ** peak shapes. *1: */ #define TRUE I1 #define FALSE 0 #define AND as #define OR || #define PI 3.14159265359 #define RperD (2.0 * PI / 360.0) #define KGAMU 1.6606EI27 #define COUELE 1.60219EI19 #define SPECSIZE 64 /* ** External declarations: */ double plate_xl, plate_x2, plate_y1, plate_y2: double plate_l: double slit_x, slit_y1, slit_y2; double def_volt; double mass: double def_vl, def_v2, del_v; double def_v_t1, rise_time, rise_end; double delta_t; double xx[5]; FILE *fp; main() I /* ** Variable declarations: */ double xmin, xmax, ymin, ymax, thetamax, uO, u_stdev: double x, y, theta, u; double ycen, yp, ktheta: double dev: float tstep, ustep: float tmin, tmax, leo, mLhi, time, step: float generic_l; int spect[SPECSIZE]; int nx, ny, nt, nu: int 1: char string[80]; /* ** Function declarations: */ int derivsI): /* ** */ /* *‘k */ double gasdev(); double test(); Input parameters: printf("Enter plate_x1, plate_x2: "); scanf("%lf, %lf", aplate_xl, &plate_x2); printf("Enter plate_y1, plate_y2: ")i scanf("%lf, %lf", aplate_yl, &plate_y2): plate_l = fabs(plate_y2 - plate_y1); printf("Enter slit_x, slit_y1, slit_y2: ")3 scanf("%lf, %lf, %lf", &slit _x, aslit_y1, sslit_y2); printf("Enter def _vl, def_ v2: "): scanf("%lf, %lf", &def_v1, &def_y2): del_ v = def_ v2 - def_ v1; printf("Enter def_ v_t1: "); scanf(" %lf", &def_ v_t1): printf("Enter rise time: "); scanf("%lf", &rise_time); rise_end - rise_time + def_y_t1; printf("Enter mass: "); scanf("%lf", &mass); printf("Enter delta_t: "); scanf("%lf", 8delta_t); printf("Enter grid xmin, xmax: ")3 scanf("%lf, %lf", £xmin, &xmax); printf("Enter nx: "); scanf("%d", anx): printf("Enter grid ymin, ymax: "): scanf("%lf, %lf", 8mmin, symax); printf("Enter ny: "); scanf("%d", &ny); printf("Enter maximum angle: "); scanf("%lf", &thetamax); printf("Enter 00 and standard deviation (eV): "); scanf("%lf, %lf", &u0, &u_stdev); if (n_stdev !- 0.0) { printf("Enter nu: "); scanf("%d", anu); } printf("Enter m _lo and m.hi to calculate\n"); printf("bounds of plot: "); scanf("%f, %f" , 8m _lo, 8m.hi); generic_ l - slit_ x - (xmin + (xmax - xmin) / 2. ); tmin - generic_ l / sqrt((2. *uO*COUELE)/(m.lo*KGAMU)); tmax - generic_l / sqrt((2. *u0*COUELE)/(m:hi*KGAMU)); gets(string): /* Clean up input buffer */ Initialize spectrum and random number generator for (i - 0; i < SPECSIZE; ++i) spect[i] - 0; srand(1); /* ** */ /* *‘k */ %1 Calculate spectrum ycen - (ymax + ymin) / 2.0; ktheta - thetamax / (ymax - ycen); for (x - xmin; x <- xmax; x +. (xmax - xmin)/(nx-l)) { for (yp - ymin; yp <- ymax; yp +- (ymax - ymin)/(ny-l)) { theta - ktheta * (yp - ycen); y - yp + (x - xmin) * tan(RperD * theta); if (u_stdev -- 0.0 OR nu <- l) { u = uO; if (test(x, y, theta, u) !- 0.0) { . tab(x, u, theta, tmin, tmax, spect, SPECSIZE); } } else { for (i - 1; i <- nu; ++i) { dev - gasdev(); u - n_stdev * dev + u0; if (test(x, y, theta, u) !- 0.0) { tab(x, u, theta, tmin, tmax, spect, SPECSIZE); } } /* u loop */ } l /* y loop */ } /* x loop */ Output spectrum and exit: printf("Enter output filename: "); fp = fopen(gets(string), "w"); step - (tmax - tmin) / (float) (SPECSIZE - 1); for (i - O; i < SPECSIZE; ++i) { time - (float) i * step + tmin; fprintf(fp, "%e, %d.\n", time, spect[i]); } fclose(fp); } /* ** rk4.c ** ** This is a Runge-Kutta routine based on that in "Numerical ** Recipies in C", p. 572. */ rk4(y, n, x, h, derivs) double y[], x, h; double (*derivs)(); int n; { /* ** Variable declarations: */ int i; double xh, hh, h6, *dyO, *dym, *dyt, *yt; /* ** Function declarations: */ double *vector(): int free_yector(); dyO - vector(0, n - 1); dym - vector(0, n - 1); dyt - vector(0, n - 1): yt - vector(0, n - 1); hh = h * 0.5: h6 - h / 6.0; xh = x + hh: (*derivs) (x, y, dyO); for (i = o; i < n; ++i) yt[i] - y[i] + hh * dyOIi]: (*derivs)(xh, yt, dyt); for (i - 0; i < n; ++i) ytm - y[i] + hh * dytm; (*derivs)(xh, yt, dym); for (i - 0; i < n; ++i) ( . ytli] ' Yli] + h * deIiJ: dymti] +- dytli]; } (*derivs) (x-I-h, yt, dyt); for (i - 0; i < n; ++i) y[i] +- he * (dy0[i] + dyt[i] + 2.0 * dymtil); free_yector(yt, 0, n - l); free_vector(dyt, 0, n - l): .free_yector(dym, 0, n - l); free_yector(dy0, 0, n - 1): return: /* ** derivs() */ derivs(t, x, dx) double t, x[], dxl]; { extern double plate_xl, plate_x2, plate_yl, plate_y2; extern double plate_l: extern double def_yolt: dx[O] = XII]; dx[l] = 0.0; if (x[0] < plate_xl || x[0] > plate_x2 ll x[2] < plate_y1 ll x[2] > plate_y2) { dXIZJ - 8(3): dx[3] - 0.0: } { dx[2] ' x[3]; dx[3] - COUELE * def_volt / (KGAMU * x[4] * plate_l); } dx[4] - 0.0; } else double test(x, y, theta, u) double x, y, theta, u: /* *‘k 0.0. */ /* ** */ /* ** */ /* ** */ See if ion passes through slit. Return 1.0 if so, else return { double vel; double time; extern double plate_xl, plate_32, plate_yl, plate_y2; extern double plate_l; extern double slit_x, slit_yl, slit_y2; extern double def_volt: extern double mass: extern double def_vl, def_v2, del_v; extern double def_v_tl, rise_time, rise_end: extern double delta_t; extern double xx[5]; vel - sqrt(2. * u * COUELE / (mass * KGAMU)); time - 0.0; def_volt - def_vl; xxlO] - x; xx[1] - vel * cos(RperD * theta); xx[2] - y; xx[3] - vel * sin(RperD * theta); xx[4] - mesa; First, move to the beginning of the plate region: time - (plate_xl - xx[0]) / xx[1]: /* t - dx / (dx/dt) */ xx[0] - plate_x1; /* x - edge of plates */ xx[2] +- time * xx[3]; /* y +' t * (dy/dt) */ Now, do Runge-Kutte integration through the plate region: do { time +- delta_t: if (time >- def_v_t1) { if (time < rise_end) def_volt - def_vl + del_v * (time-def_v_t1) / rise_time; else def_volt - def_v2; } rk4(xx, 5, time, delta_t, derivs): if ((xxlO] >- plate_xl && xxlO] <- plate_32) && (xx[2] <- plate_yl ll xx[2] >- plate_y2)) return(0.0); } while (xxlOJ < plate_x2); Finally, move to the detector: */ 265 time = (slit_x - plate_32) / xx[l]; /* time in FF region - l / vx xx[2] += (time * xx[3]); /* move t*vy in y direction */ if (xx[2] > slit_yl as xx[2] < slit_y2) return(1.0): else return(0.0); } /* ** should be void tab() */ int tab(x, u, theta, tmin, tmax, spect, size) double x, u, theta; float tmin, tmax; int size, spect[J; { float vel, time, range; int index; extern double plate_x2, slit_x, mass; vel = sqrt(2. * u * COUELE / (mass * KGAMU)); vel *- cos(RperD * theta); time - (slit_x - x) / vel; range = tmax - tmdn; index = (int) ((time - tmin) * (float) size / range) + 1; if (index >- 0 AND index < size) spect[index] +- 1; } double gasdev() /* ** Return gaussian deviate ** ** See Numerical Recipies, p. 203. */ { double v1, v2, r, fac; static double gset; static int iset - 0; double ran(); if (iset -- 0) { do { v1 = 2. * ran() - 1., v2 - 2. * ran() - 1.; r - v1*vl + v2*v2; } while (r >- 1.); fac - sqrt(-2. * log(r)/r); gset - v1 * fac; iset - 1; return(v2 * fac); } else { iset - 0; return(gset); } %7 double ran() /* ** Return random number between 0.0 & l.Q ** ** Library routine rand() return an int between 0 and 2‘31 - 1. ** We divide this by 2‘31 to return a double >= 0. and < 1. */ { double temp; int rand(); temp -(double) rand() / 2147483647.; return(temp); } /* ** Here are the utility routines: */ nerror(error_text) char error_text[]; { fprintf(stderr, "Numerical Recipies run-time error...\n"); fprintf(stderr, "%s\n", error_text); exit(l); } double *vector(nl, nh) int nl, nh; { double *v; v - (double *) malloc((unsigned) (nh - nl + 1) * sizeof(double)); if (!v) nerror("allocation failure in vector()”); return(v - n1); } free_vector(v, nl, nh) double *v; int nl, nh; { free((char *) (v + nl)); } $8 Simulation Program for Transfer Matrix Calculations This is a listing of the program SIMTOF which simulates peak shapes using Damaschin Ioanoviciu’s transfer matrix for two-stage homo- geneous field mirror TOFMS instruments. PROGRAM SIMTOF ......................................................................... 29 simtof ..................................................................................... 271 gasdev .................................................................................... 276 ran ........................................................................................ 2'77 tab ......................................................................................... 277 ftime ...................................................................................... 278 SIMTOF This program is similar to that of the same name used in the DFF project. As in that SIMTOF program, the user supplies values for the ion mass, the mean and standard deviation of the initial velocity distribution, the mean and standard deviation of the initial spatial distribution, and step sizes related to the number of desired iterations through the two distributions. In this version, the user also supplies a value for the exit slit width and the standard deviations of the a and ,8 angle distributions. In addition, the user supplies the range of the desired histogram (usually in the form of mass values from which to calculate low and high time limits) and the desired name for the output file. Description of Routines: simtof The main program obtains the required input from the user and controls the iterations through the space, energy, angle, and position distributions. gasdev This routine, based on Press, Flannery, Teukolsky, and Vetterling, Numerical Recipes, p. 203, generates random numbers drawn from a normal distribution with zero mean and unit variance. ran This routine returns a random number between 0.0 and 1.0. The built-in library routine rand supplied by the VAX-11 C compiler generates integer random numbers from the range 0 to (231 - 1). These integers are converted to floating point and divided by (231 - 1) to yield the desired uniform deviates. tab In this routine, flight times are tabulated in a histogram. The flight times are mapped into bin numbers (array positions, that is); then the corresponding array value is incremented. ftime 270 This routine calculates the flight time for an ion having specified mass, charge, slit-exit position, angle 0:, angle ,8, initial position, and initial velocity. The velocity information is actually specified as a combination of kinetic energy (a scalar quantity, unlike velocity) and a direction. The integer variable direct, one of the arguments sent to this routine, is set by the calling program to be either +1 or —1 to indicate motion either towards or away from the detector, respectively. f t The actual matrix multiplication is done by this routine. /* ** *‘k ** ** ** ** */ #include simtof.c Monte-Carlo 271 simulation of time-of-flight peak shapes using Ioanoviciu's transfer matrix. #include #define SIZE #define NCDF */ #define KBOLT #define COUELE #define KGAMU George Yefchak 128 /* Spectrum array size */ 128 /* Cumulative distribution function array size 1.38007e-23 /* Boltzmann constant */ 1.60219e—19 /* electron charge */ 1.66057e-27 /* kg / amu */ main() { double tmin, tmax; /* Spectrum extrema */ double vdcf[NCDF], scdf[NCDF]; /* Cum. distrib. function arrays */ double vmin, vmax, smin, smax; /* Distrib. function extrema */ double uO, so, vsigma, ssigma; /* Means and standard deviations */ double v0, v, e, s, time; /* Velocity, , energy, location, time */ double width; /* For D. I.'s calculations */ double x, alpha, beta; /* For D. I.'s calculations */ double theta, A, B, C, L; /* For D. I.'s calculations */ double V_accel; /* Acceleration voltage */ double xinc, asigma, bsigma; /* Ditto... */ double temp; /* Temperature */ double dev; /* Deviation from.mean */ double range; /* Range of spectrum */ double mkg; /* Mass (kg) */ int spect[SIZE]; /* Histrogram.for spectrum.*/ int nviter, nsiter; /* # of velocty and space iterations */ /* int nxiter, naiter, nbiter; /* t of x, alpha, and beta iter's */ int iveloc, ispace, i; /* Loop variables */ int ix, ialpha, ibeta: /* Ditto */ int mass; /* Ion mass */ int minmass, maxmass; /* Spectrum extrema (Da) */ int dir; /* Direction (1 or -1) of motion */ int peak; /* Index for peak 1 or 2 */ char string[80]; FILE *fp; double gasdev(); /* Gassian deviate function */ double ftime(); /* Flight time function */ ** */ /* ** */ 272 Initialize spectrum to zeros for (i‘- 0; i < SIZE; ++i) spect[i] - 0; Input mass, distribution function parameters, etc. printf("Enter mass (Da)\n"); mass - atoi(gets(string)); mkg - (double) mass * KGAMU; printf("Enter acceleration voltage\n"); v_accel - atof(gets(string)); printf("Enter total field-free length\n"); L - atof(gets(string)); A-L; B - -2.0 * L; C - L / 3.0; printf("Enter theta\n"): theta - atof(gets(string)); printf("Enter temperature (K)\n"); temp - atof(gets(string)); if (temp - 0.0) { printf("Enter energy (eV) and direction (+/- 1)\n"); scanf("%f, %d", &u0, 5dir); gets(string); /* Clean up buffer from scanf() call */ vsigma - 0.0; l { uO - 0.0; vsigma - sqrt((KBOLT * temp) / mkg); } else printf("Enter mean for initial spatial distribution\n"); so - atof(gets(string)); printf("Enter standard deviation for spatial distribution\n"); ssigma - atof(gets(string)); printf("Enter slit half-width\n"); width - atof(gets(string)); printf("Enter standard deviation for alpha distribution\n"); asigma - atof(gets(string)); printf("Enter standard deviation for beta distribution\n"); bsigma - atof(gets(string)); if (vsigma !- 0.0) { /* *‘k */ 273 printf("Enter number of energy iterations\n"); nviter - atoi(gets(string)); } if (ssigma !- 0.0) { printf("Enter number of space iterations\n"); nsiter - atoi(gets(string)); } if (width !- 0.0) { printf("Enter number of x iterations\n"); nxiter - atoi(gets(string)); } else nxiter - 1; if (asigma !- 0.0) { printf("Enter number of alpha iterations\n"); naiter - atoi(gets(string)); } else naiter - 1; if (bsigma !- 0.0) { printf("Enter number of beta iterations\n"); nbiter - atoi(gets(string)); } else nbiter - 1; printf("Calculate min 8 max from what two masses?\n"); printf(" (Enter two equal numbers for manual input.)\n"); scanf("%d, %d", &minmass, &maxmass); gets(string); /* Clean up buffer from.scanf() call */ if (minmass -- maxmass) { printf("Enter tmin\n"); tmin - atof(gets(string)); printf("Enter tmax\n"); tmax - atof(gets(string)); } else { tmin - ftime(minmass, v_acce1, theta, 0.0, 0.0, 0.0, s0, s0, 0.0, 1, A, B, C, L); tmax - ftime(maxmass, Y_accel, theta, 0.0, 0.0, 0.0, s0, s0, 0.0, 1, A, B, C, L); } printf("Tmin - %e, Tmax - %e\n", tmin, tmax): srand(1); /* Initialize random number generator */ Now calculate spectrum for (peak - 1; peak <- 2; ++peak) /*** START or PEAK LOOP ***/ { ***/ 274 if (peak - 2) { mass - mass + l; mkg - (double) mass * KGAMU; } if (nxiter > 1) xinc - 2.0 * width / ((double) nxiter - 1.0); else xinc - 0.0; for (ix - 0; ix < nxiter; ++ix) /*** X LOOP ***/ { x - -width + xinc * (double) ix; for (ialpha - 0; ialpha < naiter; ++ia1pha) /*** ALPHA LOOP { if (naiter -- 1) alpha - 0.0; else { dev - gasdev(); alpha - asigma * dev; } for (ibeta - o; ibeta < nbiter; ++ibeta); /*** BETA LOOP ***/ { if (nbiter -- 1) beta - 0.0; else { dev - gasdev(): beta - bsigma * dev: } if (vsigma !- 0.0 && ssigma !- 0.0) /* REAL CASE... */ for (iveloc - 1; iveloc <- nviter; ++iveloc) { dev - gasdev(); v0 - vsigma * dev + sqrt((2. * COUELE * u0) / mkg); dir - (v0 > 0.0) ? 1 : -1; e = 0.5 * mkg * v0 * v0 / COUELE; for (ispace - 1; ispace <- nsiter; ++ispace) { v - v0: dev - gasdev(): s - ssigma * dev + s0; time - ftime(mass, v_accel, theta, alpha, beta, x, s, 30, e, dir, A, B, C, L); tab(time, spect, tmin, tmax, SIZE); } } else if (vsigma -- 0.0 as ssigma !- 0.0) /* MONO-ENERGETIC */ { v0 - sqrt((2. * COUELE * uO) / mkg); dir - (v0 > 0.0) ? 1 : -1; for (ispace - 1; ispace <- nsiter; ++ispace) { e - 0.5 * mkg * v0 * v0 / COUELE; dev - gasdev(); /* *‘k */ 275 s - ssigma * dev + 30; time - ftime(mass, V_accel, theta, alpha, beta, 1:, s, 30, e, dir, A, B, C, L); tab(time, spect, tmin, tmax, SIZE); 1 } else if (vsigma !- 0.0 && ssigma -- 0.0) /* PLANAR */ { for (iveloc - 1; iveloc <- nviter; ++iveloc) { dev - gasdev(); v - vsigma * dev + sqrt((2. * uO) / mkg); dir - (v > 0.0) ? 1 : -1: e - 0.5 * mkg * v * v / COUELE; time - ftime(mass, v_acce1, theta, alpha, beta, x, s0, s0, e, dir, A, B, C, L); tab(time, spect, tmin, tmax, SIZE); } A } else /* SINGLE ION */ { s - 30; v - sqrt((2. * COUELE * uO) / mkg); e - 0.5 * mkg * v * v / COUELE; time - ftime(mass, V_accel, theta, alpha, beta, x, s, 30, e, dir, A, B, C, L); tab(time, spect, tmin, tmax, SIZE); } . } , /*** END OF BETA LOOP ***/ } /*** END OF ALPfiA LOOP ***/ } /*** END or x LOOP ***/ 1 /*** END or PEAK LOOP ***/ Spectrum complete; now output to file printf("Enter output filename\n"); gets(string); if ((fp - fopen(string, "w”)) -- NULL) { printf("Error opening file\n"); exit(0); ) range - (tmax - tmin) / SIZE; for (i - 0; i < SIZE; ++i) { time - ((float) i - 0.5) * range + tmdn; fprintf(fp, ”%12.8e, %8d.0\n", time, spect[i]); } fclose(fp); 276 double gasdev() /* *‘k *‘k ** */ Return gaussian deviate See Numerical Recipies, p. 203. { double v1, v2, r, fac; static double gset; static int iset - 0; double ran(); if (iset -- 0) { do { v1 - 2. * ran() - 1.; v2 - 2. * ran() - 1.; r - vl*vl + v2*v2; } while (r >- 1.); fac - sqrt(-2. * log(r)/r): gset - v1 * fac; iset - 1; return(v2 * fac); } else { iset - 0; return(gset); } 277 double'ran() /* . ** Return random number between 0.0 & 1.0 ** ** Library routine rand() return an int between 0 and 2‘31 - 1. ** We divide this by 2‘31 to return a double >- 0. and < 1. */ { double temp; int rand(); temp -(double) rand() / 2147483647.; return(temp); } tab(time, spect, tmdn, tmax, spsize) double time, tmin, tmax; int spect[], spsize; /* ** Tabulate ion's time-of—flight in histogram */ { double range; int index: range - tmax - tmin: index - (int) ((time - tmin) * (double) spsize / range); if (index >- spsize ll index < 0) return; /* ...out of range */ if (index -- spsize) --index; spect[index] +- 1; } 278 #include #include #define KGAMU 1.66057E-27 #define COUELE 1.60219E-19 #define P1180 0.01745392 /* Pi / 180 */ /* ftime.c ** ** */ Flight time calculation from.Damaschin Ioanoviciu's transfer matrix. double ftime (m, K, theta, alpha, beta, x, s, so, no, dir, A, B, C, L) double K, theta, alpha, beta, x, s, so, no, A, B, C, L; int m, dir; /* ** ** */ /* ** ** *‘k *‘k */ */ /* *‘k ** */ { double row[14]; double d;ref1, V_refl; double t_ref, t_mat, t_source; double v_ref, v, delta_k; double alpha_s, beta_s; /* alpha and beta from Yefchak, et. al */ double ft(); First find t_source, the flight time out of the source and to the space-focus plane: alpha_s - s / s0; beta_s - uO / K; t_source - alpha_s * s0 * sqrt(2.0 * (double) m.* KGAMU); t_source /- (sqrt((alpha_s + beta_s) * K * COUELE) + (double)dir * sqrt(beta_s * K * COUELE)); t_source +- 30 * 2. * sqrt((double) m * KGAMU) / sqrt(2.0 * (alpha_s + beta_s) * K * COUELE); Now find t_ref, the flight time of the reference ion: Let d_refl - L * 0.1 m. (This is the length of the second, reflecting, stage of the mirror.) v_ref - sqrt(2.0 * K * COUELE / (m * KGAMU)); v - sqrt(2.0 * (alpha_s + beta_s) * K * COUELE / (m * KGAMU)); d_refl - L * 0.1: V_refl a 6.92820323 * d_refl * K / L; /* 6.928... - 4*sqrt(3) t_ref - 4.0 * d_refl * K / (v_refl * v_ref); t_ref *- 2.309401; /* 2.309... - 4/sqrt(3) */ Finally, use transfer matrix calculations to find tJmat, which is the flight time relative to that of the reference ion: theta *- PI180; delta_k - 0.5 * m * KGAMU * v * v / (K * COUELE): row[0] - x; 279 row[l] - alpha; row[2] - 0.0; /* delta_m - 0 */ row[3] - delta_k: row[4] - x * alpha; row[S] - 0.0; /* x * delta_m = 0 */ row[6] - x * delta_k; row[7] - alpha * alpha; row[8] - 0.0; /* alpha * delta_m - 0 */ row[9] - alpha * delta_k; row[lO] - 0.0; /* delta_m * delta_m.- 0 */ row[ll] - 0.0; /* delta_m * delta_k - 0 */ row[12] - delta_k * delta_k; row[l3] - beta * beta; t_mat - ft (m, K, theta, v_ref, A, B, C, L, row); return(t_source + t_ref + t_mat): } $0 double ft(m, K, theta, v, A, B, C, L, row) double K, theta, v, A, B, C, L, row[14]; int m; /* ** *‘k ** ** ** ** ** ** ** ** *‘k ** */ { double col[14]; double double int i; tn; t_mat; row[0] x 1 alpha 2 delta_m. 3 delta_K 4 x alpha 5 x delta_m 6 x delta_k 7 alpha alpha 8 alpha delta_m 9 alpha delta_k 10 deltaJm delta_m ll delta_m.delta_k 12 delta_k delta_k 13 beta beta tn = tan(theta); col[O] col[l] col[2] col[3] col[4] col[S] col[6] col[7] col[8] col[9] -tn; tn * (A - L): -tn / 2.0;, (A - L) / 2.0; tn * tn; -tn / 2.0: tn / 2.0; (L + B/2.0) * tn * tn + tn * (A - L) / 2.0; tn * (A + B + L) / 2.0; (L - A) / 2.0; col[lO] - -(C + L) / 8.0; col[ll] - (A — L) / 4.0; col[lZ] - (3.0 * L + B - A) / 8.0; col[13] - -col[3]; t_mat - 0.0; for (i - 0; i < 14; ++i) t_mat +- row[i] * col[i]; t_mat /- v; return (t_mat) ; }