close

Вход

Забыли?

вход по аккаунту

?

Analytical applications for Langmuir probes in microwave induced plasmas

код для вставкиСкачать
INFORMATION TO USERS
This manuscript has been reproduced from the microfilm master.
UMI
films the text directly from the original o r copy submitted. Thus, som e
thesis and dissertation copies are in typewriter face, while others m ay be
from any type o f computer printer.
T h e q u ality o f th is reproduction is d ep en d en t upon th e q u ality o f th e
copy su bm itted.
Broken or indistinct print, colored or poor quality
illustrations and photographs, print bleedthrough, substandard margins,
and improper alignment can adversely afreet reproduction.
In the unlikely event that the author did not send UMI a com plete
manuscript and there are missing pages, these will be noted.
A lso, if
unauthorized copyright material had to be removed, a note will indicate
the deletion.
Oversize materials (e.g., maps, drawings, charts) are reproduced by
sectioning the original, beginning at the upper left-hand com er and
continuing from left to right in equal sections with small overlaps. E ach
original is also photographed in one exposure and is included in reduced
form at the back o f the book.
Photographs included in the original manuscript have been reproduced
xerographically in this copy.
Higher quality 6 ” x 9” black and w hite
photographic prints are available for any photographs or illustrations
appearing in this copy for an additional charge. Contact UMI directly to
order.
UMI
A Bell & Howell Information Company
300 North Zeeb Road, Ann Arbor M I 48106-1346 USA
313/761-4700 800/521-0600
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
!
A N A L Y T IC A L A P P L IC A T IO N S FO R L A N G M U IR P R O B E S
IN M IC R O W A V E IND U CED PLA SM A S
by
W illiam Linwood C oker III
A thesis submitted to the Graduate Faculty o f North Carolina
State University in partial fulfillment o f the requirements for the
degree of
Doctor o f Philosophy
D epartm ent O f Chem istry
Raleigh
1997
A pproved by
Chair o f Advisory Committee
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
UM I N u m b e r :
9813766
fI
I
1
l
UMI M icroform 9813766
C opyright 1998, by UM I C om pany. All rights reserved.
This m icroform edition is protected against unauthorized
copying under Title 17, U nited States Code.
UMI
300 N orth Zeeb R oad
Ann A rbor, M I 48103
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
North Carolina State University
Abstract
ANALYTICAL APPLICATIONS FOR
LANGMUIR PROBES IN MICROWAVE
INDUCED PLASMAS
by William Linwood Coker HI
Chairperson o f the Supervisory Committee: Dr. Charles B. Boss
Department o f Chemistry
The design and evaluation o f com puter controlled Langmuir probes for
diagnostic uses in the atmospheric pressure microwave induced plasma is
discussed.
The different voltages to the Langmuir probes are computer
controlled through the computer printer port.
The relationship between the voltage applied between the probes and the
current that flows between the probes is discussed.
From this relationship
fundamental plasma parameters can be determined by processing the data
collected during the Langmuir probe experiments.
The data from the experiments is stored and processed remotely using a
combination o f simplex and Levenberg-Marquardt optimization. The theory
behind the two methods o f optimization is discussed. Simulated data is used
to compare the two methods individually.
It is shown that simplex
optimization provides a better fit but the Levenberg-Marquardt method
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
provides statistical information. The tw o methods are combined to keep the
enhanced fitting as well as provide statistical data during actual data analysis.
The electron temperature for the argon plasma was determined to be around
24,000 K.
This analysis process is applied to the argon plasma as an analyte from a gas
chromatograph enters the plasma. The carbon C(I) signal is measured as a
reference. In this way changes in the plasma’s fundamental parameters as an
analyte enters the plasma can be determined.
Changes in plasma size and
conductivity are discussed.
Computer programs designed or modified for this work are provided in
appendices along with commentary on them.
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
B IO G R A P H Y
William Linwood Coker HI was bom November 8 , 1968 and was raised in
the town o f Tarboro, N orth Carolina. He graduated high school at Tarboro
Edgecombe Academy in 1987.
He attended St. Andrews Presbyterian
College in Laurinburg, N orth Carolina and graduated with a BS in chemistry
in 1991. On December 28, 1991 he married Julia Norem. His graduate w ork
was done at North Carolina State University under the direction o f Dr.
Charles B. Boss.
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
ACKNOWLEDGMENTS
I wish to thank some o f the people who have helped me during this process.
Dr. Boss, my advisor, has provided patient help and guidance through this
entire process. My friends in the Chemistry Department, I hope that I have
been as helpful to you as you have been to me.
My parents, Colleen and
Mose, who have always encouraged me to give my best. My wife, Julia, who
has given me support and motivation during my graduate work.
iii
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
TABLE OF CONTENTS
Page
LIST O F T A B L E S ______________________________________________ v
LIST O F F IG U R E S
............................................................................vi
C H A PTE R 1 IN T R O D U C T IO N _________________________________ 1
Plasm as................................— ....— -------------- -— ....
... 2
G e n era l _________ _______________ ___________...........— ...--------- 2
M IP ...............................................................................................................4
Plasm a L oading......................................................................................... 7
R eferences........................................... .............................— .....----- ..9
C H A PTE R 2 LA N G M U IR PR O B E DATA C O L L E C T IO N W ITH
M IC RO W A V E INDUCED PL A SM A ................................................... 10
In tro d u ctio n
... 11
E xperim ental.................................................................................................15
M icrow ave Plasm a S y ste m ...................................................................15
L angm uir Probe S e tu p ..........................................................................19
Gas C hrom atography System .............................................................. 21
Spectroscopic M easurem ents............................................................... 22
Instrum ent C ontrol an d D ata C ollection
— 23
M a te ria ls...................................................................................................28
Results an d Discussion
---------------------- ....-----.....------ 31
Noise A nalysis......................................................................................... 31
P ro ce d u re -----------------------.....-----...
— 34
R eferences.....................................................................................................38
iv
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
C H A PT E R 3 NONLINEAR O PT IM IZ A T IO N FO R T H E
D ETER M IN A TIO N O F FU N D A M EN TA L PLASM A
PA R A M E T E R S_____________________________________________ 39
In tro d u c tio n .................................................................................................40
T h e o ry ................— .....................— ------------------------41
L angm uir P ro b e s ................................................................................... 41
C hi-S quared..
...------------------------------------------------------------ 46
Initial E stim ates......................................................................................46
Simplex O p tim izatio n ...................................
.............................47
L evenberg-M arquardt M eth o d .......................................................... 49
E xperim ental................................................................................................52
Results and D iscussion...............................................................................54
R eferences.— .................
67
C H A PTE R 4 CHANGES IN T H E FUNDAM ENTAL PA RA M ETERS
O F T H E M IC RO W A V E INDUCED PLASMA W IT H
IN TRO D U CTIO N O F AN A N A L Y T E................................................. 6 8
In tro d u ctio n .................................................................................................69
E xperim ental................................................................................................73
Results and Discussion...............................................................................80
R eferences.................................................................................................... 96
A PPEN D IC ES.......................................
97
A ppendix 1 Pascal Program for C o m p u te r Controlled
L angm uir Probe Studies in M icrow ave Induced Plasm as
97
A ppendix 2 Pascal Program for C om bined Simplex an d
L evenberg-M arquardt O ptim ization o f L angm uir Probe
D a ta .........................................................................................................114
R eferences..............................................................................................152
A ppendix 3 Pascal Program D eterm ining C hrom atographic
Peak A rea of O ptim ized L an g m u ir Probe D ata............................ 153
A ppendix 4 Pascal Program for G en eratin g Sim ulated
L angm uir Probe D a ta ......................................................................... 169
V
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
LIST OF TABLES
Page
Number
C h a p te r 2
U nique pin assignm ents for the p rin te r p o rt
controlled voltage supply
29
Table 1
C om parison o f th e actu al values fo r th e
fo u r experim ental p aram eters w ith th e estim ated
values from th e L ev en b erg -M arq u ard t m ethod
59
T able 2
C om parison o f th e absolute relative stan d a rd
deviations o f sim ulated d a ta w ith experim ental d a ta
66
Table 1
T he species p resen t in an A r M IP w hen a
hydrocarbon is introduced and th e ir ionization
potentials
71
Table 2
A nalytes fo r L a n g m u ir probe studies
75
Table 3
C h ro m ato g rap h ic results and statistical d ata for
th e L an g m u ir p ro b e param eters determ ined from the
argon M fP
95
Table 1
C h a p te r 3
C h ap ter 4
R eproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
LIST OF FIGURES
Number
Page
Chapter 2
Figure 1
Probe arrangement for Langmuir probe studies
of the atmospheric pressure argon MEP
17
Figure 2
Downstream probe for Langmuir probe studies
20
Figure 3
Overview of Experimental arrangements in
Langmuir probe studies
24
Figure 4
Computer printer port control of an analog signal
27
Figure 5
Current and voltage measurement during Langmuir
probe experiments
30
Figure 6
Current versus Time
32
Figure 7
FFT o f unfiltered Langmuir probe current signal
33
Figure 8
A typical current voltage characteristic
37
Figure 1
Simulated Langmuir Plot
43
Figure 2
Comparison of the two optimization methods
56
Chapter 3
vii
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
(
Number
Page
Figure 3
Percent relative error as a function o f ap p lied potential
57
Figure 4
F requency histogram for
61
Figure 5
Frequency histogram for
62
Figure
F requency histogram for C
63
Frequency histogram for T e
65
Figure 1
Typical L angm uir p ro b e I-V plot
76
Figure 2
L angm uir Plot w ith analyte present
81
Figure 3
C hanges in L angm uir p lo t w ith an analyte present
84
Figure 4
C arbon E m ission chrom atogram for cyclopentane
86
Figure 5
IMIX chrom atogam
88
Figure
C hrom atogram for 1 ^
89
Figure 7
C hrom atogram for C
90
Figure
C hrom atogram for T e
91
6
Figure 7
C h ap ter 4
6
8
viii
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Chapter 1
Introduction
i
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Plasmas
General
Plasmas are partially ionized gases. They have becom e so popular in chemical analysis
that undergraduate texts in analytical chemistry routinely devote a section to them . 1 This
popularity is due to plasmas being good sources for atom ization and excitation o f samples
in atomic spectroscopy. Plasmas can be placed into four categories depending on how
they are generated and sustained. One category is plasm as that are sustained by chemical
energy. These chemical plasmas are commonly know n as flames. Another category is
plasmas generated by nuclear energy. M ost matter in the known universe is this type o f
plasma. An example o f a nuclear plasma is a star. A third category is plasmas generated
by optical energy. Optical plasmas can be generated by lasers. A final category o f
plasma uses electrical energy to generate and sustain the plasma. An example o f this type
o f plasma would be a spark seen when plugging in an appliance. Chemical plasmas as
well as electrical plasmas are routinely used in chemical analysis.
Electrical plasmas (plasmas) have several advantages over chemical plasmas (flames).
An advantage is the reactivity o f the gas used. The gas used in flames will be reactive.
Flames will need at least two types o f gas (fuel and oxidant). In addition there are
probably breakdown products o f the fuel and oxidant. These species may react with the
sample and thus alter the analytes* signal. A flame will be a reactive environment.
2
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
I
Plasmas can be made from any type o f gas. It is possible to make reactive plasmas, for
example a nitrogen plasma, but there is also the option to make unreactive plasmas.
These unreactive plasmas are from noble gases, Argon in this work.
A second advantage is less chance o f spectral overlap. Having the excitation source
composed of Argon, Argon ions and electrons will reduce the chance o f spectral overlap
(a smaller number o f species will be present than in a flame). Flames will typically have
carbon in them. This would interfere with using carbon emission lines in these flames for
analysis purposes. Plasmas can be made without carbon allowing carbon lines to be used
for analysis.
A final advantage is that plasmas tend to be more energetic than flames (hotter if you
will). This will cause better atomization than flames. With fewer molecular species there
will be fewer molecular emission bands to interfere with analyte analysis. Plasmas have
also been widely used as ionization sources for mass spectroscopy. This is because they
are a nearly ideal source. Plasmas are able to vaporize, fragment and ionize most
samples. Again the plasma gas will be fairly unreactive. It will be these electrical
plasmas that are used in this work.
Plasmas can be generated either directly or remotely. Directly generated plasmas have
electrodes that actually make contact with the plasma and transfer the energy to the
plasma through these electrodes. These electrodes must be able to withstand a highly
3
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
energetic environment and may wear quickly. Axe and Spark plasmas use the sample as
one o f these electrodes. Another example would be the direct current plasma. Remotely
generated plasmas have the plasma surrounded by a cushion o f gas. There is no direct
connection made between the plasma and the power supply. Either the electrical or the
magnetic field is used to generate the plasma. If the magnetic field is used to generate the
plasma it is called an inductive plasma. An example is the inductively coupled plasma,
ICP. If the electrical field is used to generate the plasma it is called a capacitive plasma.
An example is the microwave induced plasma which is used in this work.
MIP
MIPs have attracted researchers for several reasons. One reason is that the popularity o f
microwave ovens has led to reduced costs for magnetrons capable o f supplying around
500 W. The magnetron is the microwave energy source in an MIP. This can reduce
initial setup costs. Several researchers have used these power supplies . 2 , 3 ’ 4 ' 5
A second reason is the energy going into the plasma. The power used by a plasma power
supply is not transferred with 100% efficiency to plasma generation. To sustain the
plasma, the MIP can have a much smaller energy requirement (<100 watts) than either a
direct current plasma (DCP) (800-1250 watts) or an inductively coupled plasma (ICP)
(750-2000 watts). These reduced energy requirements decrease the likelihood o f injury if
4
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
there is system failure. These differences translate into lower operating costs and also
safer operating conditions.
A third reason is sample size requirements. The MIP will have a smaller plasma than
either the ICP or the DCP. This smaller plasma size can translate into smaller sample
size requirements. This is because less analyte will be needed to fill the plasma. This
also means that the MIP is less energetic and is easier to overload with sample than is
either the ICP or the DCP.
A fourth reason is that the MIP requires much less plasma support gas (~l L/min) than
either the DCP (~15 L/min) or the ICP (-20 L/min). This allows for a longer running
time before having to change gas cylinders. This also contributes to the reduced
operating costs o f the MIP compared to the ICP and DCP. This smaller rate o f using
plasma support gas also makes the MIP more compatible with small sample quantities.
This is because there will be less dilution when the sample enters the MIP than when the
sample enters the ICP or the DCP.
A final reason is the introduction o f the Beenakker TMoio cavity. First introduced in
1976 the TMoio cavity has provided a relatively efficient way to transfer the microwave
energy into the plasm a . 6 The low startup costs, the lower energy requirements to sustain
the plasma and the reduced use o f supplies fueled interest in MIPs in the late 1970’s.
.Any system where the MIP can satisfactorily replace the DCP or the ICP should have
5
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
I
reduced startup costs as well as reduced operating expenses. Today’s cost cutting
mindset has continued interest in MIPs.
This interest has even resulted in commercial instruments. Several years ago HewlettPackard Co. began to manufacture the HP 5921A gas chromatography atomic emission
detector (GC-AED) which uses the MIP. More recently the HP G2350A has been
introduced as the second generation o f MEP based commercial instruments . 7 These
8
7
instruments have been used in pesticide residue analysis , petroleum analysis , and the
analysis o f halogenated compounds . 9
Winefordner et al . , 10 have evaluated a microwave induced air plasma torch as an
excitation source and have used it to analyze oyster tissue and low boron glass. Frame et
al . , 11 have used the MIP to analyze small solid particles. This was done by grinding the
sample and spreading the particles over a filter. Then portions o f the sample filter are
sprayed with a jet o f gas to aspirate only a few particles at a time. This technique was
used to analyze industrial diamonds and soils.
Ikeda et al . , 12 have used the MIP to synthesize fullerenes. They were able to form both
C6o and C 70 from a Nj-naphthalene plasma. The formation o f these species was verified
by HPLC and mass-spectrometric analyses.
6
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
i
The Boss group has been interested in improving the power transfer from the microwave
power supply to the TMoio cavity to achieve nearly 100 % efficiency13 in power transfer.
They have also provided a theoretical description of how this is accomplished.14 The
group has recently been interested in ways, other than atomic line emission, to use the
MIP as a detector for gas chromatography. These have included the measurement o f
changes in reflected pow er15 and plasma length16 as an analyte enters the plasma. It was
realized that the plasm a extending from the TMoio cavity is a surface wave launched
plasma17 and that the electrical field emanating from the plasma can be measured to
enhance elemental calibration o f optical measurements.
18
Plasma Loading
The plasma support gas is usually a single type o f gas for example Argon or N 2 . The ratio
o f ionized to neutral atoms can be expressed by
N = C *exp
kT
Equation 1
where nj is the number density o f ionized atoms, N is the total number o f atoms present, C
is a statistical weight, Ei is the ionization energy, K is Boltzmann’s constant and T is the
temperature o f the plasma. For an Argon plasma(Ej = 15.8 eV) the ratio in Equation 1 is
7 * 10'8, less than 1 Argon atom in 10,000,000 is ionized. Due to the way this
distribution works it would be expected that introduction o f a small amount o f a more
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
easily ionized gas could cause the plasma’s ionized population to change dramatically.
Consider the case o f adding 1 % O 2 (Hj = 12.1) to an Argon plasma. If the only change
ionization is caused by the difference in ionization energy, the O 2 would be over 5000
times more readily ionized than the Ar.
would make up over 98% of the ionized
population in the plasma.
Clearly introduction o f a small amount o f sample that is more readily ionized than the
plasma support gas could cause large changes in the plasm a’s ionized population.
Measuring changes in the plasma’s ionized population when an analyte is introduced
could provide interesting information about plasma-analyte interactions.
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
References
1 Skoog, D.A.; West, D.M.; Holler, F.J. Fundamentals o f Analytical Chemistry. Saunders College
Publishing, 7th edition, 632-635 (1996).
2 Goode, S.R.; Baughman, K.W.; Pipes, D.T.; Sandridge, M.R. A ddI. Spectrosc.. 35, 308 (1981).
3 Chilukuri, S.; Lichten, W.L. Rev. Sci. Instrum.. 50,256 (1979).
4 Mohamed, M.M.; Uchida, T.; Minami, S. A d d I. Spectrosc.. 43, 129 (1989).
5 Meiners, L.G.; Alford, D.B. Rev. Sci. Instrum.. 57, 164 (1986).
6 Beenakker, C.I.M. Spectrochim. Acta. 31B, 483 (1976).
7 Johnson, D.; Quimby, B.; Sullivan, J. Am. Lab.. 27 (15), 13-20 (1995).
8 Lee, S.M.; Wylie, P.L. J Aerie Food Chem. 39, 2192-2199 (1991).
9 Kovacic, N.; Ramus, T.L. J. Anal. Atom. Spectrosc.. 7,999-1005 (1992).
10 Winefordner, J.D.; Hanamura, S.; Zhang, Y.K. Appl. Spectrosc.. 39 (2), 226-230 (1985).
"Frame, E.M.S.; Takamatsu, Y.; Suzuki, T. Spectroscopy. 2 (1), 17-22 (1996).
12 Ikeda, T.; Kamo, T.; Danno, M. A d d I. Phvs. Lett.. 67 (7), 900-902 (1995).
13 Matus, L.G.; Boss C.B.; Riddle, A.N. Rev. Sci. Instrum.. 54, 1667-1673 (1983).
14 Bums, B.; Boss, C.B. J. Microwave Power. 26 (1), 52-59 (1991).
13 Bolainez, R.M.A.; Boss, C.B. Anal. Chem.. 63, 159 (1991).
16 Ruefly, S. M.S. Dissertation, North Carolina State University, (1995).
17 Webster, G.H.; Doggett, W.O.; Boss, C.B. Anal.Chim. Acta.. 257, 309-315 (1992).
18 Webster, G.H.; Ph.D. Dissertation, North Carolina State University. (1994).
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Chapter 2
Langmuir Probe Data Collection
with the Microwave Induced
Plasma
10
of the copyright owner. Further reproduction prohibited without permission.
Introduction
Microwave induced plasmas (MIP) have been studied for years as an excitation source for
atomic emission detection for gas chromatography (GC) peaks. This has recently led to
their introduction as commercial instruments for this purpose. Some work has been done
on the changes that take place in the plasma when an analyte is present but these are
remote techniques. This work directly examines the electrical properties o f the
atmospheric pressure MIP by the use o f Langmuir probes. Analysis is done to see if
Langmuir probe studies can be performed rapidly enough to sample the peak o f a GC
attached to the MIP.
MIPs have attracted researchers for several reasons. One reason is that the popularity of
microwave ovens has led to reduced costs for magnetrons capable o f supplying around
500 W. The magnetron is the microwave energy source in an MIP. This can reduce
initial setup costs. Several researchers have used these power supplies.1,2’3,4
A second reason is the energy going into the plasma. The power used by a plasma power
supply is not transferred with 100% efficiency to plasm a generation. To sustain the
plasma, the MIP can have a much smaller energy requirement (<100 watts) than either a
direct current plasma (DCP) (800-1250 watts) or an inductively coupled plasma (ICP)
(750-2000 watts). These reduced energy requirements decrease the likelihood o f injury if
11
with permission of the copyright owner. Further reproduction prohibited without permission.
there is system failure. These differences translate into lower operating costs and also
safer operating conditions.
A third reason is the plasma size. The MIP has a smaller plasma than either the ICP or
the DCP. This smaller plasma size translates into sm aller sample size requirements. This
is because less analyte will be needed to fill the plasma. This also means that the MIP is
less energetic and is easier to overload with sample than is either the ICP or the DCP.
A fourth reason is the amount o f plasma support gas required. The MIP requires much
less plasma support gas (~1 L/min) than either the DCP (-1 5 L/min) or the ICP (-20
L/min). This allows for a longer running time before having to change gas cylinders.
This also contributes to the reduced operating costs o f the MIP compared to the ICP and
DCP. This smaller rate o f using plasma support gas also makes the MIP more compatible
with small sample quantities. This is because there will be less dilution when the sample
enters the MIP than when the sample enters the ICP or the DCP.
A fifth reason was the introduction o f the Beenakker TMoio cavity. First reported in 1976
the Beenakker TMoio cavity has provided a relatively efficient way to transfer the
microwave energy into the plasma.5 The low startup costs, the lower energy requirements
to sustain the plasma and the reduced use o f supplies fueled interest in MIPs in the late
1970’s. Any system where the MIP can satisfactorily replace the DCP or the ICP should
12
permission of the copyright owner. Further reproduction prohibited without permission.
have reduced startup costs as well as reduced operating expenses. Today’s cost cutting
mindset has continued interest in MIPs.
This interest has even resulted in commercial instruments. Several years ago HewlettPackard Co. began to manufacture the HP 5921A gas chromatography atomic emission
detector (GC-AED) which uses the MIP. More recently the HP G2350A has been
introduced as the second generation o f MIP based commercial instruments . 6 These
instruments have been used in pesticide residue analysis7, petroleum analysis6, and the
analysis of halogenated compounds.
o
Winefordner et al . , 9 have evaluated a microwave induced air plasma torch as an
excitation source and used it to analyze oyster tissue and low boron glass. Frame et al . , 10
have used the MIP to analyze small solid particles. This was done by grinding the sample
and spreading the particles over a filter. Then portions o f the sample filter are sprayed
with a jet o f gas to aspirate only a few particles at a time. This technique was used to
analyze industrial diamonds and soils.
Ikeda et al . , 11 have used the MIP to synthesize fiillerenes. They were able to form both
C 6 o and C70 from a N 2 -naphthalene plasma. The formation o f these species was verified
by HPLC and mass-spectrometric analyses.
13
permission o f the copyright owner. Further reproduction prohibited without permission.
The Boss group has been interested in improving the power transfer from the microwave
power supply to the TMoio cavity to achieve nearly 100 % efficiency12 in power transfer.
They have also provided a theoretical description o f how this is accomplished.13 The
group has recently been interested in ways, other than atomic line emission, to use the
MIP as a detector for gas chromatography. These have included the measurement o f
changes in reflected pow er14 and plasma length15 as an analyte enters the plasma. It was
realized that the plasma extending from the TMoio cavity is a surface wave launched
plasm a16 and that the electrical field emanating from the plasm a can be measured to
enhance elemental calibration o f optical measurem ents.17
An extension o f this probing o f the plasma is to directly measure the electrical properties
o f the MIP. This is accomplished with the use o f the Langmuir probe technique. This
direct probing o f a plasma was first described by Langm uir18 in 1926 for low
pressure(<50 torr) plasmas. The theory describes the relationship o f the current flowing
between tw o probes in a plasma to the voltage applied to the probes. Langmuir probes
have become a standard technique for plasma diagnostics and can be used to determine
such properties as electron temperature, ion densities and the electron energy distribution
function.19' 20
In 1976 Smy21 further developed the theory to include high pressure
(atmospheric pressure) plasmas.
An example o f the use o f Langmuir probes to better understand an analytically useful
plasma is the works o f Marcus and Fang. 22' 23' 24 In these papers Langmuir probes are
14
of the copyright owner. Further reproduction prohibited without permission
used to study the fundamental plasma properties o f the glow discharge plasma and how
these properties differ with position in the plasma. From the electron energy distribution
function, it was found that the glow discharge, like the inductively coupled plasma has a
non-Maxwellian distribution o f electron energies. A big difference between the two is
that the glow discharge has an excess o f low energy electrons while the ICP has an excess
o f high energy electrons.
This chapter is concerned with the setup and use o f Langmuir probes to measure the
electrical properties o f the atmospheric pressure Argon MIP. This paper is also
concerned with making these measurements with sufficient rapidity to sufficiently sample
a gas chromatography peak entering the MIP system. In this way change in the plasma's
electrical properties between an argon plasma and a seeded Argon plasma can be studied.
This could lead to a better understanding o f how the plasma reacts to an analyte and be
used to enhance analytical determinations.
Experimental
M icrow ave Plasm a System
The microwave power to sustain the plasma was provided by a microwave generator
(KTVA MPG-4M-128, KJVA Instrument Co., Rockville, MD). The MIP is sustained by
microwave energy applied to the TM oio cavity (Figure 1) from the generator. The
15
permission o f the copyright owner. Further reproduction prohibited without permission.
microwave energy creates electrical and magnetic fields in the cavity. These fields are
complimentary. The electrical field is most intense in the middle o f the cavity and
becomes weaker as one moves away from the center, in fact the field has a value o f zero
at the cavity wall. The magnetic field is most intense near the edge o f the cavity and
decreases to zero at the center o f the cavity. These fields are affected by the position in
the cavity o f the probe carrying the microwave energy and also by the position o f three
quartz rods placed into the cavity (not shown).
Argon gas flows through a quartz tube (7mm id and 9mm od) that goes through the center
o f the cavity. The gas flow would be from left to right in Figure 1. The argon gas was
regulated by tin M M 4 flowmeter (Air Products and Chemicals INC. E29-R150 MM4).
The argon flow was 1.7 L/min. A Teflon threaded insert is used to establish a swirling
flow pattern o f the argon gas. The flow pattern generates a relatively stable region in the
argon near the center o f the tubing as the gas enters the TM oio cavity. Without this stable
region, the plasma tends to cling to the walls o f the quartz tubing and move about
erratically. This instability drastically reduces tubing lifetime and makes Langmuir probe
studies impractical. With the setup in Figure 1 the plasma remains in the relatively stable
area near the middle o f the quartz tubing and the inside walls o f the tubing are cooled by
the argon flow. This extends tubing lifetime to where the tubing will probably be broken
during cleaning long before the plasma etching affects its usefulness.
16
permission of the copyright owner. Further reproduction prohibited without permission.
Ii
ArFlow
Downstream
Probe
Upstream
- r Probe
MgO
Coating
Figure 1 Probe a rran g em en t fo r L an g m u ir probe studies o f the atm ospheric
pressure argon M IP. The TM oio cavity is used to generate a MIP in the quartz tubing.
Argon gas is used as the plasma support gas. The argon flows down a piece o f quartz
tubing and is given a flow pattern by a twirler before it enters the TM oio cavity. The
plasma is roughly shaped like a cigar. The upstream probe is stainless steel tubing. The
downstream probe has its conductive area fixed by an MgO coating.
17
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The plasma is ignited by quickly placing a conductive wire into the plasma. The wire
provides ‘seed’ electrons that are accelerated by the electric and magnetic fields to
generate the plasma. The end o f the wire held by the experimenter is insulated to prevent
the user being shocked.
A measure of the efficiency o f the plasma is the power reflected back to the microwave
generator. The plasma energy is related to the applied power minus the reflected power.
The plasma can operate with alm ost 100 % efficiency. The plasma conditions are
optimized by adjusting the position o f the microwave probe, by adjusting the three quartz
rods positioning and also by the flow rate o f the plasm a support gas.
The reflected power was measured by connecting a Fischer RecordAll Series 5000 strip
chart recorder across the reflected power meter o f the power supply. This was much
more sensitive to the changes in reflected power than the power supply meters dial (it
read 0 reflected power throughout all studies). The forward power was set to 8 watts.
The quartz tuning rods were adjusted until a minimum was seen on the most sensitive
scale for the RecordAll. The forward power was reset to 8 watts and the process
repeated. This was done until the forward power was 8 watts and the reflected power was
a minimum. The reflected power readings are relative. It was found that the direction o f
quartz rod movement affected the signal.
18
permission o f the copyright owner. Further reproduction prohibited without permission.
Langmuir Probe Setup
As shown in Figure 1 Langmuir probes are placed in both ends o f the quartz tubing. The
upstream probe goes through the middle o f the twirler and makes contact with the
plasma. It is difficult to alter this probes location without disassembling the Swagelock
fittings that connect the quartz tubing to the argon flow. This would mean turning o ff the
plasma to make adjustments. The plasma does not necessarily have the same location in
the tubing each time it is lit, especially if the quartz tubing has been moved for cleaning
which changes the positioning o f the twirler. This relocation o f the plasma upon different
ignitions prohibits having a small area for the upstream probe. The upstream probe is
stainless steel tubing. The upstream probe is held at a constant potential and it is the
potential o f the downstream probe that is varied. The upstream probe and Swagelock
fittings surrounding it are electrically insulated by Parafilm.
The downstream probe is a tungsten/iridium rod that is held inside a stainless steel rod
(Figure 2). The downstream probe is actually a DCP Anode. It was selected due to its
small size and being designed to be exposed to plasma conditions. The probe is
cylindrical in shape and slopes into a pointed tip at one end. The conductive area o f the
downstream probe is fixed by coating the probe tip for several centimeters with
Magnesium oxide (MgO). This is done by holding and rotating the probe over a piece of
burning Mg ribbon. Note: it is important to wear UV protecting shades when burning Mg
ribbon due to the
19
permission of the copyright owner. Further reproduction prohibited without permission.
fI
Figure 2 D ow nstream p ro b e for L angm uir p ro b e studies. The probe is a tungsten rod
with an MgO coating used to fix the probe’s conductive area. The tungsten rod is held in
a stainless steel rod. The stainless steel rod is held in a Teflon block. Three screws in
the Teflon block are used to hold the probe in place and to make electrical contact with
the probe.
20
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
intense light output. This coats a large portion o f the probe. Then sandpaper is used to
remove the MgO coating from the tip. Usually less than a m illim eter is removed. The
probe is then placed into the plasma until the entire exposed tip is bathed by plasma. This
nonconductive MgO coating ensures a fixed downstream probe area.
The stainless steel rod, that holds the downstream probe, is held in a Teflon block by
three screws. One o f the screws is used to make electrical contact with the probe. The
Teflon block is located on several translation stages so that the position o f the
downstream probe can readily be adjusted to ensure good electrical contact with the
plasma. The Teflon block is used to electrically insulate the probe from the metal
translation stages. The stainless steel rod is long enough to dissipate heat from the
plasma and therefore prevent the Teflon block from overheating. The stainless steel rod
also allows the tungsten rod to be placed far enough into the quartz tubing so that the rod
will make contact with the plasma.
The Langmuir probe theory allows the ratio o f the probe areas to be determined. In this
experiment the area o f one o f the probes is fixed. By determining the ratio o f the probe
areas and knowing that one probe has constant area, it can be determined if the
conductive area of the other probe changes. This will tell if the plasma is expanding or
shrinking.
21
permission of the copyright owner. Further reproduction prohibited without permission.
Gas Chromatography System
A GC Hi-Fi (Erograph, Model 600-C) gas chromatograph was used. The gas
chromatograph column was 1/8” x 5’ and was packed with 3% SE-30 on Gas ChromQ.
Argon was used as the carrier gas. The Argon carrier gas flow was regulated by a
Matheson (NO 610A, H988) flowmeter. The flow rate was set to 0.03 L/min.
Injections o f analytes onto the chromatography column were made using a Hamilton
syringe (#7001). The syringe can be adjusted to deliver between O.OOpI and 1.00 pi. This
allowed injections o f known, but varying, amounts o f analyte to be made.
The GC effluent is passed through a splitter that allows about 2 % to pass to the plasma.
This was done to prevent plasma extinguishing which takes place if the entire amount o f
analyte is allowed to enter the plasma.
It was possible for the analyte to condense while traveling from the GC to the plasma. To
prevent condensation o f the analyte, the transfer line from the GC to the plasma torch was
heated. This was done by wrapping heating tape around the copper tubing and using a
Variac to control heating rate. This prevented the effluent from condensing in the tubing.
22
permission of the copyright owner. Further reproduction prohibited without permission.
Spectroscopic Measurements
Optical emission from the plasma was measured perpendicular to the quartz tubing after
the plasma had passed through the TMoio cavity. The light was collected by a concave
mirror (20 cm focal length) positioned 28 cm from the quartz tubing. The light was then
focused onto the entrance slit o f the monochromator (EU 700 series, Heath Company,
Benton Harbor, Michigan).
The monochromator was set to the C(I) wavelength at 247.7nm. This is an emission
wavelength for carbon which is a plasma breakdown product o f the analytes studied. The
entrance slit w idth was set at 100 microns. The light signal was collected by a PM T with
700 Volts applied. The signal was attached to an input for the Keithley Metrabyte Das801 board that collected the signals. The C(I) signal was used to determine when the
analyte was present in the plasma.
Instrument Control and Data Collection
Data collection and instrument control were done using an IBM compatible PC. In order
to conduct Langmuir probe studies, it was necessary to apply a potential to the probes
across the plasma. At the same time the computer has to measure the voltage, current and
light signals. This was done under computer control (Figure 3).
23
of the copyright owner. Further reproduction prohibited without permission
/
*\
inir
2954
-6J
UJ
r-V
FP
A/D Converter
D/A Converter
Monochromator
Figure 3 O verview of Experim ental arrangem ents in L angm uir p ro b e studies. Once
started the data collection process is controlled by the computer. The computer’s printer
port and an amplifier are used to control the voltage applied across the plasma. The C(I)
light signal is collected by a monochromator. The measured light, voltage drop across the
plasma and current flowing through the plasma signals are collected by a Keithley
Metrabyte Das-801 board connected to the computer.
24
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
The computer’s printer port provides the input that is used to control the potential that is
applied across the plasma. The printer port is used to provide a digital signal to represent
the desired voltage. The digital signal is converted to an analog signal by an analog to
digital converter. This signal is then amplified before being applied across the plasma.
This potential is only approximately the requested potential.
The actual potential across the plasma is measured during the data collection process. A
resistor in series with the plasm a is used to measure the current that flows in the plasma.
The C(I) light signal is collected by a monochromator. The output from the
monochromator is then taken to the Keithley Metrabyte Das-801 board as a voltage
signal. These signals(light, voltage and current) are then measured by a Keithley
Metrabyte Das-801 board connected to the computer.
The computer is controlled during the data collection process by a turbo Pascal program
that can be found in Appendix 1. This program and others in this thesis have the program
text in Courier Font and the comment text in Times New Roman Font. This will make
understanding the flow o f the program easier. Some o f the functions used in the program
were provided with the Keithley Metrabyte D as-801 board.
The program sets the potential difference between the upstream and downstream probes
using the computer’s printer port. The computer’s printer port has several addresses for
25
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
I<
output. The address port[888] is used to control pins 2-9 on the computer' printer port
giving 8 bit resolution. These pins give digital output 0 to 7 (DO to D7). DO comes from
pin 2. The 7533 digital to analog converter (DAC) uses 10 bit resolution.
To take full advantage o f the resolution o f the DAC some trickery was used to expand the
8 bit resolution to 10 bit resolution. This was done using the setup shown in Figure 4.
The chips labeled 74363 are octal D-type latches. Latch # 1 is used to provide the eight
most significant bits to the DAC and uses pins 2-9 (DO to D7) o f the printer port. Latch
# 2 is used to provide the two least significant bits to the DAC and uses pins 8 and 9 (D6
and D7) o f the printer port.
Since D6 and D7 are used by both chips, the chips are told by the printer port when
relevant input is being provided. First, the printer port sends the information for latch # 1
to both chips. The computer uses the ‘port[890] :=! command and a 74155 decoder
demultiplier to tell latch # 1 that the input is for it. Then the printer port does the same
for latch 74363 # 2. The octal D-type latches do not change output to match input until
they are told to do so by the 74155 decoder demultiplier that is controlled by the printer
port.
In the computer software, the Port[890] address controls the value o f A l to A4 (with A l
being the most significant). A l to A4 are used by the 74155 decoder demultiplier to tell
the latches w hen to accept input. The signal 6 (an output from the 74155) is used to
26
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure 4 C o m p u te r p rin ter p o rt control of an analog signal. The printer port
provides 8 bit resolution and the circuit improves this to 10 bit by using two 74363 octal
d type latches. 74363 # 1 takes the 8 most significant bits and 74363 #2 takes the 2 least
significant bits. Each latch is informed when to take input by the 74155 decoder
demultiplier. The latches' output provides the digital input for the 7533 DAC. Data
collection is begun after both latches have been set.
27
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
trigger latch I and 7 is used to trigger latch 2. After the latches are triggered the digital
to analog converter outputs the appropriate voltage that it has been given by input. All
the pin assignments for the printer port power supply are listed in Table 1.
The actual potential across the plasma as well as the current flowing through the plasma
is measured during the data collection process. The setup is shown in Figure 5. The
voltage drop across the plasma can be measured directly. The voltage amplifier is used to
measure the voltage drop across the plasma and to carry this signal to inputs o f the
Keithley Metrabyte Das-801 board. The current flowing through the plasma has to be
determined indirectly. A 11OQ resistor is placed in series with the plasma in the circuit
that applied the voltage. The voltage drop across the resistor is measured by the current
amplifier and carried to the Keithley Metrabyte Das-801 board. Knowing V and R and
using Ohm’s law it is then easy to determine the current that is flowing through the
resistor (I = V / R). Since the resistor is in series with the plasma, the current flowing
through the resistor is the same as that flowing through the plasma.
Materials
The plasma gas and GC carrier gas were commercial grade argon.
28
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
Printer Port
I
14
16
17
2
3
4
5
6
7
8
9
A4
A3
A2
Al
DO
D1
D2
D3
D4
D5
D6
D7
74155
2
1
3
13
74363 # 1
74363 #2
18
17
14
13
8
7
4
3
4
3
7533
A4
A3
A2
Al
DO
D1
D2
D3
D4
D5
D6
D7
D6
D7
1
6*
7*
1 I
2
5
6
9
12
15
16
19
D7
D6
D5
D4
D3
D2
DI
DO
2
5
D7
D6
4
5
6
7
8
9
10
11
12
13
D7
D6
D5
D4
D3
D2
DI
DO
D7
D6
T able 1 U nique pin assignm ents for th e p rin te r p o rt controlled voltage supply. The
pins to power the chips are not listed. The 74155 chip is a decoder demultiplier and is
used to trigger the latches. The 74363 chips are octal d type latches and are used to
provide 10 bit resolution to the digital to analog converter. The 7533 chip is a digital to
analog converter and is used to provide the output voltage. *Pins 6 and 7 o f the 74155
chip are connected to the latches through a 7404 hex inverter.
29
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
m
Figure 5 Current and voltage measurement during Langmuir probe experiments.
The voltage drop across the plasm a is measured by the voltage amplifier. The Current
flowing through the plasma is measured by determining the voltage drop across the 110 Q
resistor and using Ohm’s Law (V= I x R).
30
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Results and Discussion
Noise Analysis
Initial experiments were performed to test the setup and to determine the noise in the
system. In these experiments the applied potential was kept constant and the current was
measured over time. A sample run is shown in Figure 6. Since there is a constant applied
voltage there should be a constant current. The measured current appears to have a
periodic component to the signal. A fast Fourier transform (FFT) was done to determine
the frequency o f the noise. The FFT is shown in Figure 7. The noise is at 60 Hz and it’s
harmonics.
To help reduce noise that the microwave generator might add to the measurement system,
the system was moved further away from the generator and shielded. The connections
from the measurement system to the plasma were made with shielded cables. The noise
was still present. The plasma was turned off and replaced with a resistor and this noise
disappears. If the plasma was lit and not connected to the measuring circuit, the noise is
not present. Only if the lit plasma was part o f the measuring circuit is this noise seen. It
was determined that the noise was coming from oscillations in the plasma caused
31
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
T
■■
■
c
I
I 1
_ JL_
I
I
(D
Lm m
L.
13
o
Time
Figure 6 C u rre n t versus Time. Measured current at a constant applied voltage as a
function o f time for Langmuir probe experiments in an atmospheric pressure argon MIP
32
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
CD
5
O
Q.
CD
CO
o
z
0
40
80
120 160 200
Frequency (Hz)
Figure 7 F F T o f unfiltered L angm uir p ro b e c u rre n t signal. Noise power spectrum o f
the unfiltered current signal in an atmospheric pressure argon MIP Langmuir probe
experiment.
33
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
specifically by variations in the output o f the power supply that generates the plasma.
The noise was passed to the measurement system by the plasm a itself. The plasma was
oscillating as a result o f changes in the power supply. To reduce this effect data was
collected at one voltage over 1/60 th o f a second (16.7 ms) and averaged. This removed
the 60 Hz noise and it’s harmonics.
P rocedure
After the forward and reflected power had been set as described above, the reflected
power was increased from the minimum, usually to 20 ( this corresponds to 1.8 x 10'10 W
o f reflected p o w er). This means that quartz rod was moved into the cavity until the
reflected power measured 20 on the strip chart recorder. The direction o f movement o f
the quartz rods to alter reflected power will affect the plasm a response to an analyte. The
split ratio for the GC effluent and the delay time after injection before starting data
collection were experimentally determined for each compound. This was done to ensure
that the plasma did not destabilize when the analyte was present. This delay time was
entered into the data collection program to make sure that data was collected at the
appropriate times. Once set for a compound, this procedure need not be repeated unless
another analyte is examined.
Next, pure compounds were injected into the GC. The volumes injected ranged from 1.0
|i f . to 0.05 nL. The order o f injection was randomized.
34
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
Then the computer was told to begin its process o f data collection. This began with the
experimentally determined delay time. The reason for the delay time was to reduce the
size o f the data files to make data collection possible. The computer would divide the
user supplied voltage range into 21 voltages. It would apply the most negative o f those
and then collect light, voltage and current readings at that voltage for 16.7 ms. These
readings would be averaged to reduce 60 Hz noise. The system then moves to the next
highest voltage and repeats the data collection process. It was found that the plasma
responded to the changes in applied potential at a rate faster than could be measured.
Therefore data collection can begin when the potential is applied (actually there is a small
delay as control o f the computer is passed from the software to the Keithley Metrabyte
Das-801 board). This process is repeated until all 21 voltages are measured. This process
takes place in about 0.7 seconds to cycle through all 21 voltages. There are 251 o f these
cycles in a chromatogram. Due to the effects o f the splitter a typical GC peak on this
system takes about 90 seconds to entirely pass through the plasma. There will be about
130 different current-voltage cycles collected during a GC peak. This will be a sufficient
sampling rate for peak identification.
The program informs the user when data collection is complete. The user then can save
the file or discard it. The user is allowed to collect multiple files with one running o f the
program.
35
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
A typical Langmuir plot o f the resulting data is shown in Figure 8. To show the stability
o f the measurements, the graph in Figure 8 is actually the result o f five voltage cycles.
These were collected by starting at the most negative potential and moving to the most
positive. After an entire cycle is collected the data collection is continued by repeating
the process for the next voltage cycle. Although it appears that there are 21 data points,
there are actually 105 (five at each voltage). In this data set, the largest errors are in the
highest and lowest voltage settings. The average standard deviation o f the 5 highest
voltage applications and 5 lowest voltage applications (50 data points total) is 0.07 pA.
It is possible to use Langmuir probes to study the electrical properties o f the atmospheric
pressure MIP. It takes about 0.7 seconds to collect a current-voltage curve in these
Langmuir probe experiments. A GC peak attached to the MIP takes about 90 seconds to
pass through the plasma, this is an effect o f the splitter. Langmuir probe studies can be
performed rapidly enough to obtain about 130 complete current-voltage curves as a
analyte passes through the plasma. This will be fast enough to directly measure changes
in the electrical properties o f the MIP as an analyte passes through the plasma.
36
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
6
4
2
<
0
4
6
■I 1
8
-15
-10
-5
0
V
5
10
15
Figure 8 A typical c u rre n t voltage ch aracteristic. Measured current versus applied
voltage for Langmuir probes in the atmospheric pressure Argon MIP.
37
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
References
1Goode, S.R.; Baughman, K.W.; Pipes, D.T.; Sandridge, M.R. Appl. Spectrosc.. 35, 308 (1981).
2 Chilukuri, S.; Lichten, W.L. Rev. Sci. Instrum.. 50, 256 (1979).
3 Mohamed, M.M.; Uchida, T.; Minami, S. A p p I. Spectrosc.. 43, 129 (1989).
4 Meiners, L.G.; Alford, D.B. Rev. Sci. Instrum.. 57, 164 (1986).
5 Beenakker, C.I.M. Spectrochim. Acta. 31B, 483 (1976).
6 Johnson, D.; Quimby, B.; Sullivan, J. Am. Lab.. 27 (15), 13-20 (1995).
7 Lee, S.M.; Wylie, P.L. J Agric Food Chem. 39,2192-2199 (1991).
8 Kovacic, N.; Ramus, T.L. J. Anal. Atom. Spectrosc.. 7, 999-1005 (1992).
9 Winefordner, J.D.; Hanamura, S.; Zhang, Y.K. A p p I. Spectrosc.. 39 (2), 226-230 (1985).
10,0 Frame, E.M.S.; Takamatsu, Y.; Suzuki, T. Spectroscopy. 2 (1), 17-22 (1996).
11 Ikeda, T.; Kamo, T.; Danno, M. A p p I. Phvs. Lett.. 67 (7), 900-902 (1995).
12 Matus, L.G.; Boss C.B.; Riddle, A.N. Rev. Sci. Instrum.. 54, 1667-1673 (1983).
13 Burns, B.; Boss, C.B. J. Microwave Power. 26 (1), 52-59 (1991).
14 Bolainez, R.M.A.; Boss, C.B. Anal. Chem.. 63, 159 (1991).
15 Ruefly, S. M.S. Dissertation, North Carolina State University, (1995).
16 Webster, G.H.; Doggett, W.O.: Boss, C.B. Anal.Chim. Acta.. 257, 309-315 (1992).
17 Webster, G.H.; Ph.D. Dissertation, North Carolina State University, (1994).
18 Langmuir, I.: Mott-Smith, M. Phvs. Rev. 28, 727 (1926).
19 Chen, F.F. Plasma Diagnostic Techniques. New York: Academic Press, (1965).
20 Swift, J.D.; Schwar, M.J.R; Electric Probes for Plasma Diagnostics. New York: American Elsevier, 1970.
21 Smy, P.R. Adv. Phvs. 25, 517 (1976).
22 Fang, D.; Marcus, R.K. Spectrochim. Acta. 45B, 1053-1074 (1990).
23 Fang, D.; Marcus, R.K. J. Anal. At. Spectrom.. 5, 569 (1990).
24 Fang, D.; Marcus, R.K. Spectrochim. Acta. 46B, 983 (1991).
38
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Chapter 3
Nonlinear Optimization for the
Determination of Fundamental
Plasma Parameters
39
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Introduction
Chapter 2 shows how Langmuir probe experiments o f the electrical properties o f the
atmospheric pressure argon microwave induced plasma were performed. It concludes
that these measurements can be made rapidly enough to sample a peak from a gas
chromatograph attached to the plasma. The amount o f current that will flow at any
particular voltage is dependent on the properties o f the plasma. Once these current and
voltage measurements have been made it is desirable to relate the measurements to these
fundamental plasma properties to gain insight into how the plasm a is operating. This way
what is actually happening in the plasma can be studied. This chapter discusses the
relationship between the current and voltage measurements and the fundamental
parameters o f the plasma. The process by which the Langmuir probe data is analyzed
using both simplex optimization and the Levenberg-Marquardt method is discussed. The
chapter also reports how this process performs on a created set o f data where the actual
parameters are known.
For the analysis o f simple linear relationships linear regression can be used to determine
the value o f the unmeasured parameters. This process can be done with a spreadsheet and
need not require much computer time. This process has the added benefit o f providing
statistical information that can be used in determining the closeness o f fit as well as
confidence limits. If the relationship is not well understood multiple linear regression can
be used in an attempt to gain understanding o f the relationship.1 If the relationship
40
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
between data points is nonlinear the data can be rearranged (for example using
absorbance rather than transmittance) to make a linear fit. If a relationship is difficult to
linearize then it has to be analyzed using more com puter intensive techniques.
This chapter compares two o f these more intensive techniques. One o f these is simplex
optimization.2 This method does not provide statistical information that could be useful
in determining confidence intervals that linear regression provides. It would be useful to
have an analysis procedure for nonlinear relationships that also provides statistical
information for confidence intervals. The second technique, the Levenberg-Marquardt
method2 , provides this statistical information. The Levenberg-Marquardt method has
been implemented in many programming languages. A Pascal version has been
published as a collection o f procedures and functions2 and is modified for use in the
present work.
This chapter shows a derivation o f the relationship between the measured current and
voltage with the fundamental parameters o f the plasma. The process by which the
Langmuir probe data is analyzed using both sim plex optimization and the LevenbergMarquardt method is discussed. The paper also reports the performance o f this process
on a set o f created data where the actual parameters are known.
Theory
L angm uir Probes
41
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure 1 is a simulated Langmuir plot. V is the potential difference between the two
probes [upstream(u) and downstream(d)] with a positive potential having the downstream
probe more positive and a negative potential having the potential o f the downstream
probe being more negative. The solid line (I) is the net current which shows the typical
sigmoid shape o f a Langmuir response. I is made up o f the charged species, electrons and
cations, that flow to each probe. The dashed line
(Im ax)
is the cation current limit to the
upstream probe. Icu is the electron current to the upstream probe. At large positive
voltages the net current is limited by Imax, the ability o f cations to reach the upstream
probe. The dashed line (Imjn) is the cation current limit to the downstream probe. Ld is
the electron current to the downstream probe. At large negative voltages the net current
in limited by Imm. At intermediate voltages the net current shows effects o f both Imax and
Imm. For this discussion the subscripts “d“ and “min” refer to the downstream probe and
the subscripts “u” and “max” refer to the upstream probe. To maintain the charge o f the
plasma the net influx o f charge at one probe will be offset by an identical net outflow o f
charge at the opposing probe. This is shown in Figure 1 by the net current being a
combination o f the ion and electron currents.
Equation 1expresses mathematically the relationship between the ion limited current and
the electron current.
^
^ed
^min
^max
^eu
Equation 1
42
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
max
$s
-12
-6
0
6
12
V
Figure 1 Sim ulated L angm uir Plot. V is the potential difference between the probes.
The solid line (I) is the net current which shows the typical sigmoid shape o f a Langmuir
response. The dashed line ( I max) is the cation current limit to the upstream probe. Ieu is
the electron current to the upstream probe. The dashed line (Imm) is the cation current
limit to the downstream probe. Ied is the electron current to the downstream probe.
43
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
It is easier to determine Imax and Imin than it is to determine 1^ and Ie<j. To relate
measured current to applied voltage it would be easier if these terms could be eliminated.
Equation 2 rearranges Equation 1 to place Ieu and led alone on one side o f the equation.
I«1 _ Imax
Imm
,
Ieu " I - " I
Equation 2
Ieu and led can be substituted with terms that include the applied potential and
fundamental plasma parameters. If the electron velocity distribution is Maxwellian, the
electron current to the upstream probe is given by Equation 3
1^ = A^exp
eV /
kT,
Equation 3
where Ad is a collection o f constants and the area o f the downstream probe, e is the
electron charge, K is the Boltzmann constant, Vd is the applied voltage to the downstream
probe and Te is the electron temperature. A similar equation applies for Icu and the
downstream probe, when only the probe area and probe voltage are changed.
Substitution o f Equation 3 and the corresponding equation for Ieu into Equation 2 for
both the upstream and downstream probes gives
A„
— exp
A..
e ( V „ - V ,) '
kT.
I max
max “
Im ax
I min
j
I
Equation 4
44
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Since (Vd - V„) is just the potential difference between the two probes this term can be
expressed as V. Also (Ad/Au) can be considered a constant and substituted as C.
Substituting V and rearranging Equation 4 gives
^max ^min ,
— -----— - l = Cexp
*max
eV
kT.
Equation 5
Equation 5 can be rearranged to solve for I giving
t
*
r
max + 1,min
/
f ev
C exp
+1
max
v
K l eJ
Equation 6
Imeas: the measured current (pA)
Imax : the maximum current the curve would obtain (unknown)
Imin :
the minimum current the curve would obtain (unknown)
C:
constants and Ad/Au where Ad is the area o f the downstream probe and
does not change and Au is the area o f the upstream probe and is variable
(unknown)
Te :
the electron temperature in Kelvin (unknown)
Vmea s: the measured voltage (V)
This is now in a form where measured current is related to the applied voltage. When
plotted as I versus V the plot will have a curved form due to the exponential. This is the
form o f the equation that was used in these experiments.
45
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Chi-Squared
It is necessary to determine how well a set o f model parameters fit the measured data.
This will be done using the Chi-Squared statistic. The relationship for Chi-Squared is
shown in Equation 7.
n
r
1=1
v
x1
Y, - y ( x , ; a , . . a 1
‘j
Equation 7
X'
Chi-squared
i
each individual point in the curve
N
The number o f data points in the curve (21)
Y.
each individual current reading
y ( X r a i " a m)
:
this is the estimate o f each current reading using the present
estimates o f the parameters and equation
1
where x is the
voltage and the symbol a represents the four parameters
the standard deviation o f a data point
Initial Estimates
The nonlinear optimization procedures used in this paper will need initial estimates o f the
unknown parameters in Equation 6 . The initial estimates are determined in the following
manner.
Imax
is set as the largest current reading.
Imj„
is set as the lowest current reading.
46
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Linear regression o f the middle region is used to get the slope and intercept of this
relatively linear region. C is estimated as the exponential o f the intercept. Te is estimated
by (e/k) divided by the estimated slope.
Simplex optimization on four parameters will need five different sets o f initial estimates
o f these parameters. The first set o f estimates is determined using the procedure
described in the previous paragraph. Each o f the other four sets are determined by
multiplying one o f the parameters in the first set by a constant.
Simplex Optimization
The simplex method used in this work was first described by Nelder and Mead .3 This
procedure has been converted to programming language and published as a general form .2
This form was modified for use in the current work.
There are four unknowns in Equation
6
that will need to be determined. In simplex
optimization there will need to be 5 (number o f unknowns + 1) complete sets o f initial
estimates o f these four unknown parameters. Individually these initial sets o f estimates
are used with the appropriate voltages in Equation
6
to solve for an estimated current for
each measured current. Estimated currents for each voltage are determined.
47
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The Chi-Squared statistic is used to determine the closeness o f fit for each o f the five
initial sets o f estimates and to rank these sets from best (lowest Chi-Squared), Bi, to
worst (highest Chi-Squared), W. These could be thought o f as 5 points on a graph. The
best four points(Bi, B2 , B 3 , B4 ) will usually be kept for the next simplex. The W will be
discarded. The procedure starts by reflecting W through the remaining four points
producing a new point R. There are three possibilities for how R compares w ith the
starting simplex in closeness o f fit.
The first possibility is that R is better than Bi using the Chi-Squared statistic. If this is
the case the reflection is doubled to create 2R. The better o f R and 2R will be used with
the best four points to form a new simplex.
The second possibility is that R is worse than W. In this case R is partially reflected
through the four best points to obtain -0.5R. This could also be thought o f as a
contraction from W to the remaining points in one dimension. This point is used in the
next simplex.
For all other options a contraction C is done toward Bi along all dimensions. For
example contraction along Bi and B2 to form C 12 . This will produce four new points for
the next simplex. Only Bi will be kept from this simplex for use in the next.
48
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
In this manner simplex optimization improves results by avoiding areas that give bad
results. The sim plex optimization process is repeated using the new parameters until
there is insignificant change in the Chi-Squared statistic (<0.00001) or 5000 evaluations
have been performed.
How are the five initial sets o f estimates for the four parameters determined? The first set
o f estimates is determined using the procedure described in the previous section. Each of
the other four sets are determined by multiplying one o f the parameters in the first set o f
estimates by a constant (0.7). This gives the five initial sets to allow simplex
optimization.
Simplex optimization can get trapped in a local minimum. To improve the chances o f
finding a global minimum it is recommended to use several different sets o f initial
estimates before stopping the optimization. The different sets o f initial estimates are
generated by increasing the constant by 0.1 before starting a new optimization. This
process o f increasing the constant in repeated until the constant is 1.3. The best results of
the different initial simplex values are compared using the Chi-Squared statistic and the
best is used as the initial estimate for Levenberg-Marquardt method.
Levenberg-Marquardt Method
49
permission o f the copyright owner. Further reproduction prohibited without permission.
The simplex optimization method assumes no knowledge o f how the parameters interact.
It simply avoids regions giving relatively poor responses and systematically explores
regions away from the poor responses. We have more knowledge o f the relationship than
the simplex optimization requires and would like to take advantage o f this knowledge to
get more information out o f the optimization procedure. Since the equation relating the
parameters and it’s partial derivative with respect to each parameter is known, the
Levenberg-Marquardt method for solving nonlinear equations can be used to finish the
optimization. This method is used because it takes full advantage o f our knowledge o f
the system being studied and because it will provide us with not only estimates o f the
parameters but also their standard errors. This information can not be determined using
simplex optimization alone.
An obvious question is why bother with combining simplex optimization with the
Levenberg-Marquardt method when the latter will do everything desired in an
optimization? The reason for this is explained in the results and discussion section.
As mentioned above, the best parameters from the simplex optimization are used as the
initial parameters for the Levenberg-Marquardt method to finish the optimization. This is
a nonlinear method that iteratively proceeds to minimization. The process is described
below and is an adaptation o f the discussion by Press et a l 2.
50
permission of the copyright owner. Further reproduction prohibited without permission.
Near the minimum the
function can be approximated by a quadratic equation
2/ x
1
X \a) « / - d -a + —a - D a
E quation
X2 (a)
d
D
If equation
8
:
:
8
is the chi squared function for parameter (a)
is an M-vector
is an M x M matrix (second derivative or Hessian Matrix with
respect to the four paramaters).
is an appropriate approximation o f the x 2 function then the minimized
parameters can be determined using the information built up in the Hessian matrix
(second derivative matrix) D' 1 o f the chi squared merit function see Equation 7.
a mi„ = a cur
+ D - ‘ - [ - V ^ 2(acur)]
E quation 9
a mm
acur
Vz 2 (acur)
: the optimized parameters
: the current parameters
: direction o f the local downhill gradient (vector o f the first partial
derivatives)
If equation 9 is not close then a step is added to improve our approximation. This step
will also give us information about the Hessian matrix that will be used in Equation
9once an appropriate estimation is achieved. The steepest descent method is used to
obtain information about the Hessian matrix. The strategy is to start at point
from point
Pj
to
P,+i
by minimizing along the line from
Pj
P 0.
Move
in the direction o f the local
51
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
downhill gradient {-Vy2 (acur)}. The method is summarized Equation 10. As can be seen
by the equation the partial derivative o f the present settings are used to estimate a new set
o f parameters.
a „ext = a cur - constant x V *2( a ^ )
Equation 10
a„ext
acur
V X2(acur)
^ next set o f parameters
the current parameters
direction o f the local downhill gradient (vector o f the first
partial derivatives)
The Levenberg-Marquardt Method can be summarized as a seven step process.
1.)
Use initial estimates o f the parameters (a) to compute y 2 (a).
2 .)
Pick a value for the constant in Equation 10 say 0.001.
3.)
Solve Equation 10 as a series of linear equations and evaluate a new
X2(ancxt)
4.)
If y 2 (anext) is larger than y 2 (a) increase the constant by a factor o f 10 and
go to step 3.
5.)
If x 2 (anext) is smaller than y 2 (a) decrease the constant by a factor o f 10,
update the estimates o f the parameters and go to step 3.
6 .)
Test to see if the conditions for stopping have been met. Repeat this
process until the improvement in y 2 is less than 1 * 10'8. This cutoff point
is selected because changes in the parameters that change y 2 by
not statistically significant.
52
permission of the copyright owner. Further reproduction prohibited without permission.
« 1
are
Set the constant to 0 and perform one final run. This gives the standard
7.)
errors in the optimized parameters (a).
Experimental
The data analysis was conducted using a Pentium® computer(I33M Hz, 16MRAM). It is
possible to use the combined procedure described here to analyze 251 current-voltage
curves,
21
points each, in less than four minutes.
The relationship between current and voltage in Langmuir probe studies is a complex but
understood one. The process by which these computer controlled studies are carried out
is discussed in Chapter 2. The data collection computer program is in Appendix 1.
Simulated curves used in this paper were created with the program in Appendix 4. With
this program it is possible to create simulated curves where the unknowns in Equation
are ‘known’ and
I meas
6
is determined. The values o f the unknown parameters were set to
approximate experimental values. These simulated curves can also be made with noise
added to them.
If noise is desired the computer estimates noise for each current reading individually. To
do this the computer generates 1000 random numbers each between 0 and 1. These
numbers are summed. The result o f the summation (if repeated numerous times) will be a
53
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
normal distribution about 500. An individual run’s summation could be above or below
500 and the amount it differs would vary randomly. 500 is subtracted from the
summation to center it around 0. This process will be used to determine the noise to be
added to the current. The term
S D w an t/S D got
sets the scale for the noise and assures that
the standard deviation o f the noise is a reasonable approximation o f a actual experiment.
The process is summarized in Equation 11.
1000
S D ^ ,*
I‘notse = Icalc
iV4W + ■
£ r # (0
1=1
SD got
-5 0 0
Equation 11
I,noise
Icalc
SDwant
i
R#
SDgot
the simulated current with noise added
calculated current from equation 1
the desired standard deviation o f I n0ise
used as a counter
computer generated random number (value between 0 and 1 )
the standard deviation obtained when the sum of 1 0 0 0 random
numbers (value between 0 and 1 ) were centered around 0 .
In this way the computer generates 251 complete current-voltage curves with unique
noise added to each current value.
The simulated curves are analyzed using the combined Simplex optimization method and
the Levenberg-Marquardt method. The program that does this is shown in Appendix 2.
To determine if only one method should be used or if both combined provide a better fit,
the program was modified to skip first one and then the other method.
54
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Results and Discussion
First an exploration o f how well the two procedures fit simulated data with noise. Figure
2 shows a comparison o f the two optimization procedures (Simplex and LevenbergMarquardt) when they are used separately on the same 21 point current voltage curve.
Both procedures use the same initial estimates for the four unknown parameters. The
solid line represents the curve sent to the optimization procedures. The simplex results
are drawn as circles The simplex results fall upon the line in all cases. The measured
Chi-Squared for the simplex optimization is 1.6. The Levenberg-Marquardt results are
shown as rectangles. The measured Chi-Squared for the Levenberg-Marquardt
optimization is 24. For 251 different current voltage curves the simplex optimization
gave the best fit in every case.
Figure 3 shows the error for the two optimization methods. The circular points are from
the Levenberg-Marquardt optimization. This method gave errors approaching 30 percent
on some data points. The rectangular points are from the simplex optimization. It
provides a much better fit. The line is the result o f combining the two during analysis.
This combination results in similar error to that obtained from the simplex optimization
alone. The combination results in better fit than Levenberg-Marquardt alone and
provides standard errors for the parameters.
55
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
• ■■ ■
<o
L_
o
-55
-75
J
-95
-12
-8
0
8
12
V
Figure 2 C om parison of the tw o optim ization m ethods. The solid line is the data sent
to the optimization procedures. The circular points are the results o f the Simplex
optimization. The square points are the result o f the Levenberg-Marquardt optimization.
56
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
4E-06
• •
2E-06 -
1__
o1_
LLi
-2E-06 -
-4E-06 -
-6E-06
-15
-10
5
0
5
10
15
V
F igure 3 E rro r as a function of applied potential. The circular points are from the
Levenberg-Marquardt optimization. The rectangular points are from the simplex
optimization. The line is the result o f combining the two during analysis.
57
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Simplex optimization greatly improves the optimization over the Levenberg-Marquardt
method alone. These methods are combined to give improved fit (Simplex) and
statistical information (Levenberg-Marquardt). Next it was decided to use a set o f
simulated current and voltage data with no noise to see how well the parameter values are
determined. The simulated data was analyzed using the combined procedures described
above. The results are listed in Table 1. The Levenberg-Marquadrt method gives exact
matches to the “actual” numbers when there is no noise present. Keep in mind that the
data were prepared with known parameters. It is reassuring that there is an exact match
with the analysis method. The standard errors for the parameters are due to the known
standard deviation of a current reading ( 2 * 10-6 amps) while conducting a Langmuir
probe experiment. The Levenberg-Marquadrt method uses this number in the analysis.
Also affecting the standard error is how that uncertainty propagates in Equation 6 to each
o f the parameters.
Next the Levenberg-Marquadrt method was tested with a set o f data to which noise was
added to each current (i) reading to simulate an actual experiment. This noise was
designed to have a Gaussian shape with a standard deviation o f 2 * 1CT6 amps. The noise
would be added to the current value by using Equation 11. A set o f 251 o f these current
voltage curves was generated. There were 251 values determined for each parameter. To
show the shape o f the distribution in the calculated values frequency histograms have
been constructed for all four parameters.
58
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Given
Determined
Standard
Value
Value
Error
Im ax
3.2 * 10'5
3.2 * 10'5
7.2 * 10'7
T .
Am in
-9.5 * 10'5
-9.5 * 10‘5
1.9 * 10‘6
c
5
5
9.5 * 10'5
T
1 e
2.4 * 104
2.4 * 104
7.1 * 102
Parameter
Table 1 Com parison of the actual values for the four experimental param eters with
the estimated values from the Levenberg-M arquadrt method. The standard error is
given by the Levenberg-Marquadrt method.
59
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The frequency histogram o f Imax is shown in Figure 4. Rem ember that Imax is the cation
current limit to the downstream probe. The average is 32.5 pA. The maximum is 36.9
pA and the minimum is 26.9 pA. There is a standard deviation o f 1.86 pA and a relative
standard deviation o f 5.72 %.
The frequency histogram o f Imm is shown in Figure 5.
Imjn
is the cation current limit to the
upstream probe. The average is -95.0 pA. The maximum is -87.4 pA and the minimum
is -103.0 pA. There is a standard deviation o f 2.82 pA and an absolute relative standard
deviation o f 2.97 %.
The frequency histogram o f C is shown in Figure 6. C is the ratio o f the probe areas. The
average is 5.06. The maximum is 8.03 and the minimum is 3.58. There is a standard
deviation o f 0.612 and a relative standard deviation o f 12.1%
The frequency histogram o f Te is shown in Figure 7. Te is the electron temperature
measured in Kelvin. The average value o f the data set is 24,000 K. The maximum is
29,600 K and the minimum is 18,600 K. There is a standard deviation o f 1,490 K and a
relative standard deviation o f 6.21%.
As can be seen in Figures 4 through 7 the Levenberg-Marquadrt method overall provides
a good estimate o f the original parameters. This data has noise that simulates an actual
experiment. If the noise remains at the estimated level in an actual experiment the result
60
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
30
25 -
28
30
32
34
Imax (microAmp)
Figure 4 Frequency histogram fo r Im„ . There were 251 values for Imax calculated for
different current voltage curves. The average is 32.5 jxA. with a range o f 10 pA and a
standard deviation o f 1.86 pA.
61
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
35
30
25
10
5
0
■1.03
-0.99
-0.95
-0.91
-0.87
Imin (microAmp)
Figure 5 Frequency histogram for Imin. There were 251 values for Imin calculated for
different current voltage curves. The average is -95.0 fiA. with a range o f 15.6 pA and a
standard deviation o f 2.82 pA.
62
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
50
40
30
o'
c
0
3
cr
0U .
U-
20
Figure 6 F requency histogram fo r C. There were 251 values for C calculated for
different current voltage curves. The average is 5.06 with a range o f 4.45 and a standard
deviation o f 0.612.
63
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
will be small signal to noise ratios. Judging by the relative standard deviations the terms
C and Te will have the most uncertainty in an actual experiment. This is shown in a
comparison o f the uncertainty in the simulated data with that o f an actual experiment in
Table 2. The experimental data is from 251 current voltage curves collected during a
Langmuir probe argon MIP experiment. The simulated data correctly predicts how the
terms will fall in order o f uncertainty.
64
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
50
40 -
>*
o
c
0
13
30
O’
0
LL
1.8
2.1
2.5
Te (x 10.000K)
2.8
Figure 7 Frequency histogram fo r Te. There were 251 values for Te calculated for
different current voltage curves. The average is 24000 K with a range o f 11000 K and a
standard deviation o f 1490 K.
65
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
A verage
S tan d ard
D eviation
A b solu te
R SD
Imax
32.5 (pA)
1.86 (pA)
5.72
Imin
-95.0 (pA)
2.82 (pA)
2.97
c
5.06
0.612
12.1
Te
24000 (K)
1490 (K)
6.21
Imax
60.0 (pA)
0.699 (pA)
1.17
Imin
-64.0 (pA)
0.603 (pA)
0.937
c
0.800
0.0132
1.65
Te
24500 (K)
393 (K)
1.60
Simulated
Experimental
Table 2 Comparison of the absolute relative standard deviations of simulated data
with experimental data. The simulated data correctly predicts the order of uncertainty
in the four parameters when an experimental run is performed.
66
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
References
1Brown, S.W.; Lynch, P.F.; Obremski, R.J.; Lavery, D.S. Anal. Chem.. 54, 1472-79 (1982)
2 Press, W.H.; Flannery, B.P.; Teukolsky, S.A.; Vetterling, W.T. Numerical Recipes in Pascal: The Art o f
Scientific Computing. Cambridge University Press, Ch 10 & 14, (1989).
3 Nedler. J.A.; Mead, R. Computer Journal. 7, 308 (1965).
67
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Chapter 4
Changes in the Fundamental
Parameters of the Microwave
Induced Plasma with Introduction
on an Analyte
68
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Introduction
This chapter is concerned with the use o f Langmuir probes to analyze the electrical
properties o f the atmospheric pressure argon microwave induced plasma (MIP) and to
report the changes in these properties as an analyte is added to the MIP. Langmuir1 in
1926 developed the theoretical description for the current-voltage relationship o f probes
in a low pressure plasma(<50 torr) in regards to the plasmas fundamental parameters.
The theory was further developed by Smy2, in 1976, to include high pressure
(atmospheric pressure) plasmas. Langmuir probes have become a standard technique for
plasma diagnostics and have been used to determine such properties as electron
temperature, ion densities and the electron energy distribution function.3-4 Most uses o f
Langmuir probes are in plasmas whose fundamental makeup is not changing. This will
be a novel use o f these probes to have them measuring a plasm a’s parameters while the
makeup of the plasma is changing.
What changes would be expected in the microwave induced plasm a’s electrical properties
when an analyte passes through the plasma? Consider the case for a hydrocarbon
introduced into the Argon plasma. The spectroscopically observed plasma breakdown
species for a hydrocarbon,5 their ionization potentials6 and that the plasma support gas,
argon, are shown in Table 1. All o f the hydrocarbon breakdown species are more easily
ionized than is argon. The hydrocarbon breakdown species with the highest ionization
potential, atomic hydrogen, is 2.2 eV lower than Ar. If the difference in ionization
potentials dominates the amount o f ionization atomic hydrogen entering the plasma will
69
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
be 160 times more likely to ionize than is Ar. CH would be about 55,000 times more
likely to ionize than is Ar. It is clear that these breakdown species would be preferentially
ionized over argon.
Is enough analyte breakdown species present in the plasma at any one time to
significantly alter the plasma’s ionized population? The electron density in an
atmospheric pressure MIP has been reported by G oode7 to be 5 * 1014 /cm3. At
atmospheric pressure, the density o f A r atoms is 7 * 10
18
1
/cm . The plasm a is 0.007 %
ionized. How does the electron density compare to the density o f analyte during a typical
GC peak? For an example consider the injection o f 1.0 pL o f cyclopentane (density
0.785 g/mL) into a GC. To prevent plasma instability a splitter allows only about 2 % of
the cyclopentane to enter the plasma chamber. This makes 0.22 pmol o f cyclopentane
that will enter the plasma chamber. The GC peak comes o ff over about 1.7 minutes and
the argon flow rate into the plasma is 0.5 L/min. This will give an average density o f
cyclopentane in the plasma o f 0.26 pmol/ cm3 during an injection o f analyte. If all o f the
cyclopentane (C 2 H 10) entering the plasma is broken down into C and H atoms, the density
o f these species present in the plasma is 2.4 * 10l5/cm 3. If the breakdown is less
complete and CH, C 2 , and H species are found in the plasma there would still be a density
o f breakdown species o f 2.0 * 1015 /cm 3. This means that during an injection there are
analyte breakdown species in the plasma about five times more abundant than the Ar+
initially present. Since these species are significantly more easily ionized, it is reasonable
70
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Species
Ionization Potential
£eV}
CH
11.1
C
11.3
c
12.0
H
13.6
Ar
15.8
2
Table 1 The species present in an Ar MIP when a hydrocarbon is introduced and
their ionization potentials
71
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
to expect that there would be significant changes in the plasm a's ionized population when
an analyte is introduced.
How would Langmuir probe measurements be affected by the expected changes in the
plasma’s ionized population? The difference in ionization potential could lead to more
ions being present in the plasma when an analyte passes through. Since the plasma is
electrically neutral, increasing the number o f cations will also increase the number o f
electrons. Additionally those ions due to their decreased mass over argon should be more
mobile than an argon cation. It would therefore be expected that the plasm a will become
more conductive as there would be a higher number o f ions and/or the ions are more
mobile. This would lead to higher currents flowing through the plasm a at a particular
applied voltage with an analyte present than would flow if there were no analyte present.
With more ions present, the plasma could either become larger, as these ions repel each
other, the ion density could increase and the plasma remain about the same size, or
shrink. The general effect on the current would be the same in each case. If the plasma
expands this would increase the exposed upstream probe area. An increase in probe area
would cause the probe to collect more ionized species and the current would then
increase. If the ion density increases one would also expect the collected current to
increase because more ions would be near the probe.
72
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
There will be a competing mechanism tending to cause the current to decrease. The
experimental setup, the tuned and matched microwave cavity, is optim ized for an argon
plasma. When an analyte is introduced into the plasma the setup is no longer at it’s
optimal operating condition. The transfer o f energy to the plasma w ill therefore become
less efficient. This would lead to a less energetic plasma that would cause less current to
pass.
The range o f possibilities for the plasma/analyte interaction is clearly diverse. There
could even be combinations o f several o f these to determine how the plasm a responds
Will the plasma become more conductive or less conductive? If it becomes more
conductive, is this due to the plasma enlarging or some other factor?
Langmuir probes will be used to measure the electrical properties o f the argon MIP.
These measurements will be made as the plasma becomes seeded w ith an analyte. An
optimization procedure will relate the current-voltage relationship to the fundamental
parameters o f the plasma. Changes in these fundamental parameters will be determined
as an analyte passes through the plasma. These fundamental changes in the properties o f
the plasma as an analyte enters will provide a better understanding o f the plasma-analyte
interaction.
Experimental
73
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The general experimental setup was described in chapter 2. The process o f data analysis
was described in chapter 3. The analytes used for these studies are listed in Table 2.
A typical Langmuir probe current-voltage characteristic is shown in Figure 1. The X axis
is the measured potential o f the downstream probe (Probe 1) compared to the upstream
probe (Probe2), which is used as a reference. The Y axis is the current that flows through
the plasma at the applied potential. To show the stability o f the measurements, the graph
in Figure 1 is actually the result o f five voltage cycles. There are actually 105 (five at
each voltage) data points. In this data set, the largest errors are in the highest and lowest
voltage settings. The average standard deviation o f the 5 highest voltage applications and
5 lowest voltage applications (50 data points total) is 0.07 pA.
There are three regions on the graph. The first, located on the far left in Figure 1 is when
the current is only weakly dependent on the applied voltage. A negative voltage on the
graph refers to the downstream probe being more negative than the upstream probe and a
negative current refers to a net flow o f positive charge to the downstream probe. In this
region applying a more negative potential to the downstream attracts very few additional
cations, thus the current does not significantly change. This is because the voltage on the
downstream probe is so negative that only cations are collected at the downstream probe
and only electrons at the upstream probe. In this situation, the potential o f the
74
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Compound
Supplier
Gradefif listed)
Toluene
Fischer
HPLC
Acetone
Fischer
NF/FCC
2-Propanol
Fischer
NA
Cyclopentane
Aldrich
HPLC
Heptane
Mallinckrodt
NA
Table 2 Analytes for Langmuir probe studies
75
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
<
=s_
l- H
-4 -
-15
-10
-5
0
V
5
10
15
F igure 1 Typical L a n g m u ir probe I-V plot. This plot is o f five 21 point voltage
swings. There are three distinct regions on the graph. Regions 1 and 3 are at the two
ends o f the curve and are the cation saturation regions for the downstream and upstream
probes respectively. Region 2 is the middle area o f the graph. In this region both
electrons and cations are able to reach the surfaces o f both probes. This is know n as the
transition region.
76
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
downstream probe is so negative that the electrons do not have sufficient energy to
overcome the repulsive force o f the charged electrode. The entire current flow at the
downstream probe is therefore caused by cations contacting the probe. In this situation,
the current is limited by the ability o f the cations to reach the downstream probe and the
conductive area o f the downstream probe exposed to the plasma.
The next region is the positive potential region where the curve levels o ff (far right o f
Figure 1). In this region the downstream probe is so positive that no cations have
sufficient energy to overcome the repulsion o f the probe’s charge. The current at the
downstream probe is solely due to electrons reaching the probe. In this region, the current
is limited by the ability o f cations to reach the upstream probe and the upstream probe
area exposed to the plasma. It should be noted that the exposed area o f the upstream
probe is more than that o f the downstream probe (which is fixed). This being the case
one would expect that the cation limiting current to the upstream probe would be more
than that o f the cation limiting current to the downstream probe. As can be seen is Figure
1, the opposite is true. The reason that the limiting current to the downstream probe is
more than that o f the upstream probe is due to the flow o f the plasma support gas. Once
an ion (cation or electron) is formed, it is being moved by the plasma support gas toward
the downstream probe. Even if the upstream probe is attracting the cation, the cation
would have to “sw im ” upstream to reach the probe. If the downstream probe is attracting
the cation this would enhance the cation’s movement in the downstream direction. This
mobility difference in the upstream and downstream direction reduces the ability o f the
77
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
!
upstream probe to attract cations and offsets the larger area o f this probe. The electrons
attracted to the opposite probe will have such larger mobilities due to their smaller size
and higher kinetic energy than the cations. Thus the currents will be limited by the
cations. Therefore a positive voltage refers to the downstream probe being more positive
than the upstream probe and a positive current refers to a net flow o f negative charge to
the downstream probe.
The middle region in Figure 1 is the transition region where both cations and electrons
reach the downstream probe. When the potential is negative the downstream probe
attracts cations. However there are electrons that have sufficient energy to overcome the
repulsive force o f the probe. W hen the potential is positive the downstream probe attracts
electrons. In this case some cations have sufficient energy to overcome the repulsive
force o f the probe. Thus the current at either probe is due to the net flow o f charge
(electrons compared to cations) to the probe. In order for an electron to overcome the
repulsive force o f a probe and make contact with the probe it must have sufficient kinetic
energy to cancel the coulombic repulsion. Thus, the net current is due in part to the
kinetic energy o f the electrons. Since the kinetic energy o f the electrons is related to the
temperature o f the electrons this region can be used to determine the electron
temperature. The reason that the curve does not pass through the origin is due to the
unequal areas o f the two probes and the difference in ion mobilities.
78
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The numerical relationship between the measured current ( Imeas) and the applied
potential ( Vmeas) is shown in Equation 1. This relationship was derived in chapter 2
There are four adjustable parameters in Equation 1. Imax is the limiting current in the
positive voltage region. Imin is the limiting current in the negative voltage region. The
middle region o f the curve in Figure 1 is controlled by C and Te in Equation 1. T e is the
electron temperature in Kelvin. C is the ratio o f the area o f the downstream probe to that
o f the upstream probe. The conductive area o f the downstream probe is fixed by an
insulative coating. The area o f the upstream probe is allowed to vary. The number
11604.43 is a combination o f the Boltzman constant and electron charge. It is therefore
assumed that the electrons have a Boltzman distribution in their kinetic energies. The
o
Levenberg-Marquardt method o f solving nonlinear equations was used to determine the
values o f the four parameters for each current-voltage curve.
ax =
Im ax -
Lnm)
p~l604.43 * VmcasV
1 +c *
Te
J
Equation 1
Imeas •' the measured current (pA )
Imax :
the maximum current the curve would obtain (unknown)
Imjn:
the minimum current the curve would obtain (unknown)
C:
constants and A 1/A 2 where Ai is the area o f the downstream probe and does not
change and A 2 is the area o f the upstream probe and is variable (unknown)
79
with permission of the copyright owner. Further reproduction prohibited without permission.
Te :
the electron temperature (k) (unknown)
Vmeas • the measured voltage (V)
Results and Discussion
What happens to the Langmuir plot when an analyte is present? Figure 2 gives an
example. Both Figure 1 and Figure 2 were taken from the same chromatogram and were
collected about a minute apart. Cyclopentane was injected into the gas chromatograph.
The data for Figure 1 was obtained at the beginning o f the chromatogram before
cyclopentane had entered the plasma. The data for Figure 2 was taken at the maximum
cyclopentane presence in the plasma. For Figure 2 there was a hydrocarbon breakdown
density o f about 2.0 * 1015 /cm 3. This provided a significant population o f readily ionized
species in the plasma. These are compared to see what changes take place w hen an
analyte enters the plasma.
As shown by comparing Figure I and Figure 2, the plasma’s electrical properties change
only slightly as an analyte enters. Perhaps the most noticeable difference is that there is
more noise in the highest and lowest voltages when the cyclopentane is present compared
to when the analyte is not present in Figure 1. The average standard deviation o f the 5
highest voltage applications and 5 lowest voltage applications (50 data points total) is 0.1
pA. There are two reasons for this increased noise. The first is that the cyclopentane
entered the plasma from a Gas chromatograph and therefore is varying in concentration
80
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
4
-15 -10
-5
0
10
15
V
Figure 2 L angm uir Plot w ith analyte present. This plot is similar to Figure 1 except it
is taken as a cyclopentane gc peak is going through the plasma. Note the increased noise
in the first region.
81
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
over the five voltage cycles. The second reason is the plasma's reaction to having
“foreign” substances enter it. This is discussed below.
The system in optimized for argon flowing through the glass tubing and forming the
plasma. When an analyte is introduced, the system is no longer operating under these
conditions. If enough analyte is introduced, the plasma will visually change. This change
is from its stable cigar shape and the result may be that it either fully destabilizes, loosing
contact with one or both probes or it forms plasma “fingers” flowing from the plasma to
the quartz tubing. These conditions will cause the current-voltage curves to change
considerably.
It should be noted that if the plasma totally destabilizes, the resulting current-voltage plot
is not recognizable as a Langmuir plot and it is not used in data processing. Care was
taken to insure that the plasma did not destabilize. The amount o f analyte injected into the
plasma was kept small enough to prevent the plasma from becoming visibly unstable.
Adjustments were made to the flow rates and the splitter on the GC until the plasma
appeared stable when the analyte passed through the plasma. However, smaller or
quicker changes are possible that would add noise to the system and not be visually
noticed. These changes could cause the noise seen in Figure 2.
It will be easier to tell some o f the more subtle differences in current response o f the
plasma with and without an analyte if they are plotted on the same graph. This is done in
82
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure3. The Argon plasm a with no analyte is the curve made by the spherical symbols.
The plasma with cyclopentane present is shown as the squares. Both curves are five
voltage cycles. In Figure 3 the region where the most change is evident is on the far right
where the current is controlled by the ability o f the cations to reach the downstream
probe. The current increases in this region. There is also a slight increase in absolute
current in the first region on the far left o f the graph. This region is controlled by the
ability o f the cations to reach the upstream probe. It is expected that the increase in
absolute current would be less pronounced in the upstream probe due to ions having to
move against the flow o f the plasma support gas to reach that probe. This means that the
conductivity o f the plasma increases when an analyte is present. This increase in absolute
current is expected if the decrease in efficiency o f transfer o f microwave energy to the
plasma remains very small.
The experiment starts w ith an analyte being injected into the gas chromatograph. Then
the data collection program runs through any delay before it begins to apply voltages and
take data readings. The program will apply a voltage and take light, voltage and current
readings (21 o f each) at that voltage. These 21 raw points collected in 1/60 second will
later be averaged into one data point to reduce noise. Then the program will move on to
the next voltage and collect data and so on until it has covered the desired voltage range.
The program will repeat the process until 251 o f these current-voltage cycles are
83
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
6
-8 -I— i— I— i— I— i— I— i— I— i— I— i—
-15
-10
-5
0
V
5
10
15
o backgr □ peak
Figure 3 C hanges in L angm u ir plot w ith an an aly te present. This is a combination
o f the first two graphs to allow differences to be more easily seen. The Ar plasma
response is represented by the circles and the response with cyclopentane present is
represented by the squares. Notice the increase in current in the ion saturation regions
when cyclopentane is present.
84
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
complete. This will take about three minutes and result in 251 data points in a final
chromatogram. Each o f these 251 data points is the average o f 21 raw data points. These
21 points are the current and voltage readings that the analysis program will later use to
determine one point each o f the four unknown parameters shown in Equation 1. In the
next few pages, how these four parameters change when an analyte is introduced into the
plasma will be discussed. First to be discussed is how to determine, independently o f the
Langmuir probe results, when the analyte is in the plasma.
The Figure 4 is a chromatogram o f the carbon emission signal as an analyte passes
through the plasma. The light signal was used by the analysis program to determine when
the anlayte is in the plasma. It is included so that the reader can see where to look for
changes in the other graphs. The shaded area up to 25 seconds is considered background.
The tailing o f the peak is due to the effect o f the splitter. The top o f the peak will be
around data point 50. There will follow graphs o f the four parameters mentioned in
Equation 1 as a function o f time. In this case each parameter is serving as a
chromatographic signal. Perhaps their responses will shed some light on why the current
is increasing.
Figure 4 will serve as a reference for when the analyte is present. It is the same
experiment as Figures 5-8 that show the chromatographic results for each o f the four
parameters. The difference is the signal being plotted.
85
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
II
i
0
50
100
(S )
150
200
Figure 4 C arb o n Em ission chrom atogram fo r cyclopentane. This is a chromatogram
showing the carbon emission signal collected during the run where Figures 1-3 were
collected. The shaded region is background. This figure was used to determine when
analyte is present in the next four figures.
86
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure 5 is a chromatogram o f Imax as cyclopentane passes through the plasma. The data
to determine all four o f the parameters was collected at the same time as was the light
signal. An increase in Imax can be seen on the chromatogram when the cyclopentane is
present in the plasma. Imax increases if more ions are reaching the upstream probe.
Figure 6 shows a similar plot for Imjn.
Imin
becomes more negative when analyte is
present. This means that more ions are reaching the downstream probe. Since the
downstream probe has a fixed area the density o f the ions must increase for
Imj„
to
become more negative. These signals are limited by the ability o f the cations to reach
either the upstream (Figure 6) or the downstream (Figure 5) probe. As can be seen by
these graphs, these signals are noisy. The current increases in absolute value when the
analyte is present. This increase in plasma conductivity with introduction o f an analyte
expected. The average standard error determined by the Levenberg-Marquardt method
for Imax is 1.56 x 10-6 which is about a factor o f ten times smaller than the signal. The
average standard error for
Imjn
is 1.10 x 10-6 which is also about a factor o f ten times
smaller than the signal.
Figure 7 shows the chromatogram for C which happens to give the most change when the
analyte is present. C increases as the analyte enters the plasma. Remember from
Equation 1 that C (Aj/A2) is the ratio o f the conductive areas o f the downstream to the
upstream probes. Since the downstream probes conductive area is held constant by an
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
5.3
5.2 -
<3
■■
■■
X
<3
E
■ ^*«
4.9
Hi
4.8 4.7
0
50
100
(S)
150
200
Figure 5 In,,, chrom atogam . The data that led to Figure 5 was collected at the same
time as the data leading to Figure 4. Imax is the extrapolation o f the ion saturation current
o f the upstream probe (region 3 in Figure 1) to the zero current point. Note the increase
in this parameter as the analyte goes through the plasma.
88
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
-
6.6
-6.7
<3
C
■■■■
I
-
6.8
-6.9
-7
-7.1
-7.2
0
50
100
(S)
150 200
Figure 6 C hrom atogram fo r Imin. The data that led to Figure 6 was collected at the
same time as the data leading to Figure 4. I2 is the extrapolation o f the ion saturation
current o f the downstream probe (region 1 in Figure 1) to the zero current point. Note the
increase in this parameter as the analyte goes through the plasma.
89
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
1.1
1.05
1
0.95
O 0.9
0.85
0.8
0.75
0.7
0
50
100
(S)
150
200
Figure 7 C hrom atogram fo r C. The increase in C means that the plasma is shrinking
as the cyclopentane is passing through the plasma. The data for this figure was collected
at the same time as that for Figure 4.
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
25000
24500
«
24000
■*
.■
.
. . . *
o
h-
! ■
,
•
■■
*
1
*■.■
■
-
I
' I
.
m
#
\
"■
:■
.
■ H■
I
1 *,
*
""
"
I
■ \m
1 ■■ ■,
■
1
*i
■
1
*
23000
1
' ■HX ■
•.
,' ■ ■
23500
■
■
I
■
1
■a
i
I
I
.1
22500
-I—
0
50
h
100 150 200
(S)
Figure 8 C h ro m a to g ra m fo r Te. The electron temperature for the MIP is about 23500
K. This demonstrates the lack o f thermal equilibrium since the overall plasma
temperature is less than 1400 K. The data for this figure was collected at the same time
as that for Figure 4. The cyclopentane begins to enter the plasma around point 50 on the
chromatogram.
91
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
MgO coating, the only way for C to increase is for the conductive area o f the upstream
probe to decrease. The only way for this to happen is for the plasma to shrink. This
shrinking o f the plasma is visually observed. This means that the increase in current
could not come from an increase in plasma size since the plasma size is decreasing. The
increase in plasm a conductivity is therefore due to an increase in ion density or mobility.
Figure 8 is a chromatogram for the electron temperature (Te) in Kelvin as the analyte
passes through the plasma. The overall plasma is not energetic enough to melt a copper
wire. The melting point o f copper is about 1360 K and the overall plasma temperature
must be less than that. It is known that MIP is not in thermal equilibrium. This means
that the cations, electrons and neutral species all have different kinetic energies and
therefore different temperatures. This is evidenced in the electron temperature being
about 23500 K and knowing that the overall plasma temperature is about 20 times lower
than this. The differences in the temperatures o f the different species are rather large. At
first glance there appears to be no difference in the electron temperature when the analyte
is present and when it is not present in the plasma. All four parameters will be examined
to determine if they significantly change when the analyte is present.
This examination into the changes in the four parameters was done using a modification
o f the area calculation program. The program uses the Savitsky-Golay 5 point smoothed
first derivative o f the light signal to determine when an analyte is present in the plasma.
The first derivative is a standard test for determining peak start and peak top locations.
The peak start is signaled by four consecutive points with increasing positive first
92
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
derivatives when compared to the previous point. After the start o f a peak is identified
the top is determined. This is determined by three consecutive points with decreasing
first derivative when compared to the previous point. All three points must be less than 0.
Since the light signal is collected at the same time as the data for the parameters, the
points on the light chromatogram that have analyte are the same as the points for the
parameters that have analyte. The background corrected analyte peak area is determined.
The modification allowed points in the tail o f the peak to be counted as background. It
should be pointed out that this would increase the likelihood o f the background being
considered the same as the peak and so is a tougher test than if the background were just
background. The background corrected peak area as well as its confidence interval was
determined. If the confidence interval includes 0 then the parameter is not statistically
changed when the analyte is present. The reason for this is that w hen subtracting the
background from each peak point, the result would be a distribution centered around 0.
This would hold if there were no differences between analyte and background signal.
Cyclopentane injections o f 1.00 (iL were made at various reflected powers (these
experiments will be discussed more fully elsewhere). Those run between +0.2 and +0.9
pW o f reflected power were used to determine the confidence interval. These were
chosen because they gave the highest light signal. There were a total o f 27 points for
each parameter with 26 degrees o f freedom. All o f the parameters are significantly
different from 0 meaning that their confidence interval doesn’t include 0. All o f the
parameters change when the analyte passes through the plasma.
93
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
There are significant changes in the Langmuir probe parameters when an analyte is
introduced into the plasma. All o f the confidence intervals are significantly different
from zero and therefore there is net signal change as an analyte enters the plasma. Due to
the robustness o f the plasm a these changes are subtle and offer little information about
the analyte. Measuring a constant signal C has the most noise o f the parameters.
However, C is the parameter that provides the most information when an analyte is
present as shown by its small relative standard deviation.
Similar changes in the plasm a’s parameters are seen when the other analytes listed in
Table 2 are examined. The plasma’s parameters, especially electron temperature, exhibit
a robust behavior to changes in plasma makeup.
Langmuir probe studies o f the atmospheric pressure argon MIP show the plasma to be
robust in its properties when encountering appreciable amounts o f readily ionized analyte.
There is some interesting information about how the plasma reacts to an analyte. The
plasma becomes smaller when the analyte is present due to the decreased efficiency in
coupling between the power supply and the plasma. At the same time the plasma is more
conductive since it can pass a larger current. Since the plasma is smaller, the only way to
account for this increase in conductivity is for there to be effectively more ions in the
plasma. This means that there is a net increase in effective ion density as the analyte
passes through the plasma.
94
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Area
Area Std.Dev.
RSD
I max
0.000424
0.000269
0.636
I mil,
-0.000587
0.000473
0.806
C
26.5
5.22
0.197
Te
60100
123000
2.06
Table 3 Chromatographic results and statistical data for the Langmuir probe
parameters determined from the argon MIP.
95
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
References
1 Langmuir, I.; Mott-Smith, M. Phvs. Rev. 28. 727 (1926).
2 Smy, P.R. Adv. Phvs. 25, 517 (1976).
3 Chen, F.F. Plasma Diagnostic Techniques. New York: Academic Press, (1965).
4 Swift, J.D.; Schwar, M.J.R; Electric Probes for Plasma Diagnostics. New York: American Elsevier, 1970.
5 Dziewatkoski, M.P. Ph.D. Dissertation, North Carolina State University, (1993).
6 Lide; K.R. Editor-in-Chief, CRC Handbook o f Chemistry and Physics. CRC Press, 71st edition, (1990).
7 Goode, S.R., Deavor, J.P. Spectrochimica Acta. 39B, 813-818 (1984).
* Press, W.H.; Flannery, B.P.; Teukolsky, S.A.; Vetterling, W.T. Numerical Recipes in Pascal: The Art of
Scientific Computing. Cambridge University Press, 547-598 (1989).
96
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Appendix 1
Pascal Program for Computer
Controlled Langmuir Probe Studies
in the Microwave Induced Plasma
97
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
{The program Testl5.pas is used to allow computer control o f the langmuir probes potentials during
experiments. It is also used to collect the light, current and voltage signals generated during the Langmuir
Probe experiments.
To control the voltage across the two langmuir probes the computers printer port is used. The printer port is
used to generate a digital signal that serves as input for a digital to analog converter(DAC). The DAC is
used to apply a potential difference between the two probes that are across the plasma. Operational
amplifiers are used to boost and steady the output o f the DAC.
A measuring circuit is used to measure the light signal, the actual voltage applied and the current flow. Due
to 60 Hz noise (and it’s harmonics) in the measured signals, the applied voltage is held constant and 48 raw
data points are collected over 1/60 o f a second. This represents 16 points for each o f the three signals:
light, voltage, and current. When the corresponding points at one voltage are averaged the average will
filter the 60 Hz noise.
The data files are quite large. Due to the large size o f the data files, the data is converted from it’s original
integer(2 bytes) format to Iongint(4 bytes) and only converted to the appropriate light, voltage or current
reading as it is being written to the disk. The converted data is o f type doub!e(8 bytes) and is stored directly
to the disk. The question should be asked why not just process the data as it is collected. The answers are
memory and time. Since the type double takes up four times more space than type integer not processing
the data immediately frees up a large amount o f memory. In addition, the computer doesn’t have enough
memory to store the processed data in RAM.
98
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
A way around this memory problem is to save the data to disk after being processed. A current-voltage
curve is supposed to represent the plasma under relatively constant conditions. It takes so much time to
store the data during a run that the plasma would significantly change between processed data points thus
making the current-voltage curves useless. Therefore, all data for a run is collected in it’s raw form and
only at the end when it is being saved to disk is it converted to type double.
A Keithley Metrabyte DAS-801 input and output (I/O) board is installed in the computer to perform data
acquisition. During data acquisition control o f the computer is passed from the program to the DAS-801
I/O board.
The user can control the gain code for the board. The gain code controls the input voltage range. The user
can also control the delay time after the collection o f a raw data point before the collection o f the next raw
data point (due to the 60 Hz noise, this was kept at 347psec which over 48 points amounts to 1/60 sec).
Also the user can set a delay before the collection process starts. This delay is built in because o f the large
size o f the data collection files. The data collection is set to start so that a good baseline is seen before the
analyte enters the plasma. This delay time saves roughly 2 minutes o f data collection compared to starting
when the analyte is injected into the gas chromatograph. This also keeps enough memory free so that the
computer will not crash during data collection. The delay time also saves about 193Kbytes in the size of
each stored chromatograph.
The user is able to take multiple chromatograms without having to exit the program. The user has the
option to change the range o f the applied voltages before each chromatogram if multiple chromatograms are
to be collected. For collecting multiple chromatograms, if the user wishes to change the data collection rate
or the delay time before the start o f data collection, they must exit and reenter the program.
99
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
It should be noted that to be executed this program has to be saved as an .exe file. This is due to the way
that the Keithley Metrabyte function call drivers work. This means that to run the program the user has to
exit the pascal program and run the .exe file from DOS. Once the program is functioning properly, this is
only a minor concern. The problem is with troubleshooting the program. All o f the internal
troubleshooting tools available in Pascal are worthless because the user is no longer in pascal and the
program will not run in pascal. This makes troubleshooting and ensuring that the program is working
properly a most interesting challenge.
}
{
★★★
T e s t 1 5.PAS
DAS-801
Turbo Pascal V 6.0 Anal o g Input (A/D) S Y N C H R O N O U S MODE
using external Auialog T r i g g e r Example
The following is an pro g r a m that uses the S Y N C H R O N O U S M O D E capabilities
OF THE DAS-801 board to p e r f o r m A n a l o g Input in the foreground.
Make sure the board and the c o n f i g u r a t i o n
setting.
file have the sam e
IRQ
Refer to EXAMPLES.TXT for detail on the s u p p o r t e d Turbo Pascal
languages.
)
P rogram Testl5;
{$ N + )
{This allows the user access to the real type o f double. It also will force the 80X87 numeric coprocessor to
perform all of the real-type calculations.}
{ spec i f y the D800TP6.tpu using the uses cla u s e
uses Crt, Drivers, D800TP6, printer, dos;
)
{ The Crt command gives the program control over several PC as well as monitor features. D800TP6 is a
.tpu file where the Keithley Metrabyte provided pascal units are stored. Having them listed in the uses
section makes any unit contained in the file available just by using it’s name. This is similar to a procedure
and/or function library. The printer command allows use o f the printer port by the program. The Dos
command allows the program to access DOS features.}
100
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Const
numloops = 250;
{ A c t u a l l y a d d 1 to this number}
{The program will run through 251 cycles for each data file.}
Type
{Create new type of p o i n t e r to integer array}
IntArray = Array[0..1] of integer;
holdstuff = array [0..n u m l o o p s , 0..20] of longint;
Databuffertype
= Array[0..47] of longint;
hold_data = "holdstuff;
Var
Integer;
NumberOfBoards
Integer;
BoardNumber
Holds Status during INT }
Word;
Status
E r r o r flag }
Longint;
Ertn
Holds INT transfer count }
Longint;
Count
Device Handle }
Longint;
hDev800
A / D Frame Handle }
Longint;
hAD
String;
S t r i n g to hold name of c o n f i g u r a t i o n
ConfigFile
file }
Integer;
I, J, II, countbuff, VPTNCJM
ch
: Char;
{ S t r i n g to hold Hex e rror n u mber }
HexErr
: String;
{ S t r i n g to hold Hex results }
HexAnswer
: String;
{ s h i f t e d A / D data }
result
: longint;
rawbuf
: A r r a y [0. 100] of integer;
pAcqBuf
: A r r a y [0. 9] of "IntArray; {array of poi n t e r s to Ac q
buffers}
hMem
: Array[0..9] of Word;
{Memory handle to A c q buffers]
ADvalue, nchannel
: Integer;
word;
GAINCODE, gaincodereadl, g a i n c o d e r e a d 2
channelstart, channelstop
: word;
gain, vgain
: real;
clkticks,SecDelay
: longint;
numbuff, curvenum, delayc o u n t
: integer;
LIGHTPT, VPT, CURRPT : REAL;
samples
:longint;
range
: real;
volts
: real;
DELTAV, VHI, VLO, REQVPT
:R E A L ;
filename, filenamel
: string;
outfile, INFILE
: text;
char;
answer, defans, doublecheck
gainlpcnt
: integer;
another, ANOTHERSAME
: char;
DTOAARRAY : ARRAY [0..20] O F INTEGER;
VREQ : array[0..20] of real;
hourl, hour2, mini, min2, seel, sec2, hundl, hund2 : word;
hour, min, sec, hund, V D I G M A I N : integer;
time,temp : double;
Databuffer : Array [0..20] of d atabuffertype;
CURRENTOFFSET, V O F F S E T : REAL;
tempconst, itempconst : double;
rawlightbuf, rawibuff, r a w v b u f f : hold_data;
(* Beginning of procedure a nd
fun c t i o n section*)
procedure heilo_message;
101
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
begin
{-------------
ClrScr;
writeln(
writein(
writeln(
Trigger' )
writeln(
writeln(
writeln(
writeln(
writeln(
writeln;
writeln(
writeln(
writeln(
writeln(
writeln(
writeln(
writeln;
^ 4I
f
end;
{hello_message}
T e s t l 5 .PAS DAS-801');
Turbo Pascal V 6.0 ')j
Ana l o g Input (A/D) on synchronous m o d e w i t h an i n t e r n a l
voltage input range
5
+/+ /+/+ /-
gain
g a i ncode
1
10
0
1')
0.5
0.5
0.05
10
2
100
3
')
{h
e ^l ^l o _ m eWsWsWa g e J}
I **W
{This procedure introduces the user to the program and informs them o f the options for the voltage input
range and how this corresponds to the gain and the gaincode.}
PROCEDURE GET_GAI N C O D E _ G A I N (VAR SecDelay: Longint;
Var G A I N C O D E : WORD; V A R G AIN
clkticks: longint);
: REAL;
Var
(* This procedure gets the gaincode and d e l a y time b e t w e e n data
points
from the user and us i n g that sets the g ain and clkticks
r e s p e c t i v e l y . *)
BEGIN
Repeat
{OF G E T _ G A I N C O D E _ G A I N }
(This repeat loop is used to ensure that the user answers with a “Y” or “N” .}
W r i t e l n ('Default values');
W r i t e L n ('Delay (in Sec) Before Starting
(microsec)');
w r i t e l n ('
110
347
') ;
write('Are these OK? Y/N : '};
Gaincode
Delay time
3
{The user is informed o f the default settings o f delay before data collection starts, gaincode, and delay time
between data points. The user is asked if these are OK.}
readln(Defans);
{The computer reads the user’s answer.}
Defans
:= upcase (Defans);
{The user’s answer is converted into the upper case.}
102
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
case Defans of
{A Case statement is used to evaluate the user’s answer. If the user answers *Y’ then the default settings
apply. If the user answers ‘N ’ then the user is asked to enter the desired settings. If the user gives another
answer, then the else statement executes and the user is asked for a valid response.}
'Y'
: beg i n
S ecD e l a y := 110;
g aincode := 3;
gain
:= 100;
clkticks := 347;
end;
'N' : begin
W r i te('enter wait time (in Sec) ');
Readln(SecDelay);
w r i te('enter the gainc o d e : ');
readln(gaincode) ;
repeat
case gaincode of
C :gain
:= 1;
1 :gain
:= 0.5;
2 :gain
:= 10;
3 :gain
:= 100;
else
w r i t e l n ('p l e a s e e n t e r a va l i d gaincode');
end;
(of cas e statement)
until (gaincode >= 0) a n d (gaincode <= 3);
clrscr;
{
repeat
' EACH TICK IS 1 M I C R O S E C O N D , A L L O W A B L E RATES ARE
25 TO 65536 TICKS O R 25 M I C R O S E C TO 65.536 mS
}
w r i t e l n ('
The r a n g e of a l l o w a b l e delay times');
w r i t e l n ('
b e t w e e n r e a d i n g s is 25 to 65536 microseconds'!
/
writeln;
write ('Please enter the d e l a y t i m e ' );
readln(clkticks) ;
if clkticks < 25 then
w r i t e l n ('Delay time m u s t be at least 25 microseconds');
if clkticks > 65536 t h e n
w r i t e l n ('De l a y t ime m u s t be b e l o w 65536 m i c r o s e c o n d s ' ) ;
until (clkticks >= 25) a n d (clkticks <= 65536);
end;
Else writeln('PLEA S E A N S W E R W I T H "Y" O R "N"');
end;
Until (Defans = 'Y ') or (Defans = 'N ' ) ;
{This ends the Repeat statement and ensures that the user answers the question with an appropriate
response.}
clrscr;
{This clears the screen.}
END;
(OF G E T _ G A I N C O D E _ G A I N }
103
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{This procedure informs the user o f the default setting for the data collection and allows the user to change
them if such is necessary. The settings for data collection are then passed to the program.}
PROCEDURE ERROR _ M S G ( E R R O R _ V A L U E : LONGINT; LOCATION : STRING);
(* THIS PROCEDURE N O T I F I E S T H E USER OF ERRORS R E L A T I N G TO
THE DAS-801 BOA R D
*)
BEGIN
F O R M A T S T R (HEXERR, '% X ’, E R R O R _ V A L U E );
W R I T E L N C E R R O R \ HEXERR, LOCATION);
H A L T (1) ;
END;
{Should there be an error relating to the D A S 8 0 1 I/O boards relationship to the program or to the Keithley
Metrabyte function call drivers, the error number and it’s location are reported as the program stops
execution. This assists in troubleshooting since the user now has a general location for the problem and by
comparing the error number to the Keithley Metrabyte manual the user may have some idea o f the nature o f
the problem. }
procedure stepl;
{
STEP 1: This step is mandatory; it init i a l i z e s the internal data tables
according to the information c o n t a i n e d in the configuration file
D A S 8 0 0 .C F G .
)
begin
C onfi g F i l e := ’DAS800.CFG' + #0;
{ null terminated string is
req. )
Ertn := D A S 8 0 0 _ D e v O p e n ( C o n f i g F i l e [1], NumberOfBoards );
{4-
6}
if Ertn <> 0 then E R R O R _ M S G ( E R T N , ' O N DEVICE O P E N ’);
end;
{This procedure uses the file DAS800.CFG to initialize the internal data tables.}
procedure step2;
I -------------------------------------------------------------------------------------------------------------------STEP 2: This step is mandatory; it e s t a b l i s h e s communication with the
driver
through the Device Handle for b o a r d 0.
}
Begin
Board N u m b e r := 0;
Ertn := D A S 8 00_GetD e v H a n d l e ( B o a r d N u m b e r , h D e v 8 0 0 ) ;
{4-11}
if Ertn <> 0 then E R R O R _ M S G ( E R T N , ' G E T T I N G DEVICE HANDLE');
End;
104
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{This procedure is used to establish communication with the driver through the address for the data
collection board. This is referred to as boardnumber 0. More than one board could be connected to the
computer.}
Procedure S TEP3(var h a d : l o n g i n t ) ;
{
STEP 3: To p e r f o r m an y A / D operations, you must first get a Han dl e to
an
A/D Frame (Data tables inside the d r i v e r p e rtaining to A / D o p e r a t i o n s ) .
)
Begin
Ertn := K _ G e t A D F r a m e ( hDev800, h A D ) ;
{p4 — 40}
if Ertn <> 0 t h e n ERROR_MSG(ERTN, ' G E TTING A / D FRAME HANDLE');
End;
{This procedure gets the address to data tables inside the driver relating to analog to digital operations.}
Procedure step5(had
word);
: longint;
channelstart,channelstop, g a i n c o d e
:
{
STEP 5: Sets the chan n e l s to be a c q u i r e d
and the gain value.
(in this case 1,2,a n d 3)
}
{ALLOWS FOR A + /- 10 V RANGE (SEE P 2-4 OF M A N U A L ) }
begin
Ertn := K_SetStartStopG(hAD, channelstart, channelstop, gaincode);
{4-117}
if Ertn <> 0 then E R R O R _ M S G ( E R T N , ' O C C U R E D DURING K _ S E T S T A R T S T O P
C A L L ');
end;
{This procedure sets the channels to be acquired and the gaincode. The channels will be sampled in order
from first to last. The sampling will continue in this manner until the required number o f readings have
been taken.}
Procedure step6(had,
clkticks
: longint);
{
STEP 6: Specify the
a 1 KHz rate.
internal clock rate:
1000 tics at 1 MHz
/ tic is
)
Begin
Ertn := K_SetClkRate(hAD, clkticks);
{4-105}
if Ertn <> 0 th e n ERROR_MSG(ERTN, ' OC C U R E D DURING K _ S E T C L K R A T E
C A L L ');
End;
105
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{This procedure sets the internal clock rate meaning the delay time between the collection of individual data
points. The clock operates at one megahertz so one tic is one psec. With a delay o f 1000 tics between data
points there is a collection rate o f 1000 points per second. }
Procedure s t e p 7 ( h a d
: longint);
{
STEP 7: S p e c i f y use of internal triggering.
}
begin
Ertn := K_SetTrig(hAD, 0);
{4-120}
if Ertn <> 0 then E R R O R _ M S G (E R T N , ' O C C U R R E D DUR I N G K_SETTRIG C A L L ’);
end;
{This procedure specifies the trigger source as intemal(setting 0) or extemal(setting 1). The program was
used with an internal software trigger.}
Procedure S t e p 9 ( h a d
: longint);
{
STEP 9: Start synchron o u s data acquisition.
Make s ure the board and
the
co n f i g u r a t i o n file have the same IRQ setting.
)
Begin
Ertn := K _ s y n c S t a r t ( h A D ) ;
(4-124)
if Ertn <> 0 then E R R O R _ M S G ( E R T N , ' O C C U R R E D DURING K_syncStart
C A L L ');
(*
clrscr;
g o t o x y (1,17);
w r i t e l n ('
Please wait
writeln;
w r i t e l n (’A n a l o g input in progress
End;
') ;
');
*)
{Procedure step 9 initiates data collection in synchronous mode. The board acquires data in the foreground,
meaning that the user must wait until data collection is completed to perform further operation. The
interrupt mode allows other programs to run at the same time. Synchronous mode was used due to it’s
ability to acquire data at a much faster rate.}
procedure startup;
begin
hello_message;
gainlpcnt := 0;
range := 10;
106
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
c h annelstart := 1; {channel to start A/D conversions} c h a nnelstop := 3;
{channel to
scan to
}
Samples := 48; numbuff := 1; n c h a n n e l := channelstop - channelstart
1;
GET_GAINCODE_GAIN(SecDelay,GAINCODE,GAIN,CLKTICKS);
end;
{PROCEDURE STARTUP}
{This procedure is used to call some other procedures used to establish the initial conditions for data
collection.}
FUNCTION a d d u p ( V P T N U M , I i n : INTEGER): longint;
VA R
S UM : longint;
BEGIN
SUM := 0;
I := Iin;
WHILE I < SAMP L E S DO
BEGIN
SUM := SU M + DATABUFFER[VPTNUM, I] ;
I := I + 3;
END;
addup := SUM;
END;
{This procedure is used to sum all 16 data points for each of the three channels, which are collected while
the applied voltage is held constant. This is done to remove noise and reduce the size of the data file.
Remember that the 16 numbers summed is still a longint. longint will take up less computer memory than a
real or double number even ifthe double number is approximately 16 times smaller in value. These
numbers will later be averaged, this is done due to the larger amount of time required to perform
multiplication and division compared to addition and subtraction. W e want to get on with more data
collection as quickly as possible. }
procedure s e t b o a r d s t u f f ;
begin
stepl;
step2;
step3(had);
(
STEP 4: A s s i g n the data a r r a y d e c l a r e d abo v e to the Frame Handle
}
Ertn := K_SetBuf(hAD, @rawbuf[0], Samples);
if Ertn <> 0 then
begin
FormatStr(HexErr, ' %x ', E r t n ) ;
w r i t e l n ( AG, 'Error # ', HexErr, ' O c c urred du r i n g K_SetBuf
c a l l 1);
Halt (1);
107
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
end;
step5 (had, channelstart, channelstop, gaincode) ;
step6(had,clkticks);
step7(had);
end;
{This procedure calls several other procedures and prepares the Das80l board for data collection.}
PROCEDURE C O L LECTDATA ;
BEGIN
step9(had);
for I := 0 to 47 do
begin
result := l o n g i n t ( (rawbuf[I]
shr 4) and S O f f f );
{The raw data point is read in and any extra information is removed from the number.}
(* if (result and $0800) > 0 then
begin
result := result + SfOOO;
end;
*)
d a t a b u f f e r [ V p t n u m , I ] := result;
{The semiraw data point is stored for further processing.}
end;
END;
(OF COLLECTDATA}
{This procedure collects 48 data points (16 each for the 3 channels being collected.}
procedure f r e e b o a r d s t u f f ;
begin
1---------------------------------------------------------------------------------------------------STEP 13:
Reset the b u f f e r list.
}
Ertn := K_BufListReset(hAD) ;
if E r t n <> 0 then
b eg i n
FormatStr(HexErr, ' %x ', Ertn) ;
writeln(^G, 'Error # ',HexErr, 1 O c c u r r e d du r i n g
K_BufListReset call');
H a l t (1);
end;
i -------------------------------------------------------------------------------------------------------STEP 14:
Free the frame for use by another A / D operation.
}
Ertn := K_FreeFrame(hAD) ;{4— 39}
if E r t n <> 0 then error_msg(ertn, 'Oc c u r e d during K_Fr e e F r a m e
c a l l ') ;
end;
{This procedure resets the computer so that another A/D operation or another procedure may be used.
Memory allocated to arrays are freed to be accessed by other components.}
PROCEDURE D T O A ( V P T N U M
: INTEGER);
(SETS THE R E Q U E S T E D VOLTAGE}
108
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
var
Vdig,
Dhi,
Begin
V D I G :=
Vdi g :=
Dhi :=
Dio :=
Dio:
integer;
DTOAARRAY[VPTNUM];
512 - (Vdig a n d $3f f ) ;
(Vdig a nd $3fc) shr 2;
(Vdig a nd $3) shl 6;
p o r t [888]:=
dhi;
p o r t [890]:= 17;
p o r t [890]:= 27;
p o r t [888]:= dlo;
p o r t [8 90]:= 25;
p o r t [890]:=27;
end;
{OF DTOA]
{This procedure uses the printer port to send a signal to a digital to analog converter which will set the
voltage to be applied between the probes. The requested voltage is broken down into high and low(more
significant and less significant) components. The high and low components go to different DACs using the
port[888] command. The port[890] commands are used to provide a ttl signal to inform which DAC to
accept the signal.}
(* END OF PROCEDURE A N D FUNCTION SECTION*)
begin
startup;
(main program]
{This calls the startup procedure.}
clrscr;
{This clears the screen.}
a s s i g n ( i n f i l e , 'c : \das 8 0 0 \ a s o d o s \ p a s c a l \ o f f s e t .p r n 1) ;
reset(infile);
readln(infile,VOFFSET);
R E A D L N (INFILE,CURRENTOFFSET) ;
CLOSE(INFILE) ;
{The above lines are used to obtain offset values for the measurement system. The program OFFSET
generates the values. }
REPEAT
W R I T E ( ' E N T E R TH E HIGHEST VO L T A G E ');
READLN(VHI);
W R I T E ('ENTER THE LOW E S T VOLTAGE ');
READLN(VLO);
DELTAV := (VHI - VLO)/20;
109
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{The above lines obtain the voltage range and determine the amount that the voltage will be incremented to
generate the I-V curve data.}
Repeat
For d e l a y c o u n t
delay(lOOO);
:= 1 to SecDelay do
{Before data collection begins any delay is taken.}
setboardstuff;
{Procedure setboardstuff is called.}
FOR VPT N U M := 0 TO 20 DO
BEGIN
REQVPT := V L O + DELTAV * VPTNUM;
vreq[VPTNUM] := REQVPT;
V digM A I N := r o u n d (R E Q V P T / - 0 .045) ;
DTOAARRAY[VPTNUM] := VDIGMAIN;
END;
{The requested voltages are stored in an array so that they can be accessed by the program. The lowest
requested voltage is incremented by the term DELTAV multiplied by a point number . This will cause the
voltage to be incremented in a systematic manner going from the lowest voltage to highest.}
r a wlightbuf := nil;
rawvbuff := nil;
rawibuff := nil;
{The nil in the above lines ensure that the pointers don’t yet point to anything.}
new(rawlightbuf);
new(rawvbuff);
new(rawibuff);
{The above lines create three dynamic variables and sets pointer variables to point to them.}
g e t t i m e (h o u r 1,m i n i , s e e l , h u n d l ) ;
{The time from the start to the end o f the data collection will be determined for the 251 cycles.}
for c u r v e n u m
:= 0 to numloops do
{This for loop will cause there to be 251 cycles o f data collection o f the inner for loop.}
begin
FOR V P T N U M
:= 0 TO 20 DO
{This inner for loop will collect 21 data points that will make up an entire I-V curve.}
BEGIN
DTOA(VPTNUM);
{The DTOA procedure sets the applied voltage.}
COLLECTDATA
rawlightbuf~[curv e n u m , v p t n u m ] := a d d u p ( v p t n u m , 0);
rawvbuff~[curvenu m , v p t n u m ] := a d d u p ( v p t n u m , 1);
rawibuff~[curvenu m , v p t n u m ] := a d d u p ( v p t n u m , 2);
110
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{The procedure COLLECTDATA is used to collect the data and then the semi-processed data is stored
temporarily for further processing later.}
END;
{This ends the inner for loop.}
end;
{This ends the collection if the 251 I-V curves.}
g e ttim e ( h o u r 2 ,m in 2 ,s e c 2 ,h u n d 2 ) ;
h o u r := h o u r 2 - h o u r l ;
m in := m in 2 - m i n i ;
s e c := s e c 2 - s e e l ;
h u n d := h u n d 2 - h u n d l ;
t i m e := (3 6 0 0 * h o u r ) + (6 0 * m in ) + s e c + ( 0 . 0 1 * h u n d ) ;
{The time required for data collection is calculated.}
freeboardstuff ;
{Procedure freeboardstuff is called to clear up some memory and so that it will be possible to run multiple
data collection runs without having to reenter the program.}
clrscr;
Repeat
{This repeat is used to make sure the user answers the save question as they wish to.}
w r i t e ( 's a v e f i l e ? y/n: ') ;
readln(answ er);
an sw e r := u p c a s e ( a n s w e r ) ;
{The user is asked if the file should be saved. A case statement is used to handle the reply.}
case answer of
' Y' : B e g i n
{If the file is to be saved then this part o f the case statement executes.}
w r i t e l n ( ' E nter F ile n am e');
w r i t e l n ( ' D e fa u lt Path A : ') ;
w r i t e ( ’ D e f a u l t E x t e n s i o n .PRN: ' ) ;
r e a d l n (Filenam e1 );
{A filename is requested and read. The program uses a default path and extension.}
f i l e n a m e := f i l e n a m e l ;
I f P o s ( ' : ' , Filenam e) = 0 th en
F i l e n a m e := ' A : ' + F i l e n a m e ;
I f P o s ( ' . ' , Filenam e) = 0 th e n
F i l e n a m e : = F ile n a m e + ' . p r n ' ;
{However if the user uses a path or extension, then the user’s preference will be used}
A s s ig n ( O u tf ile , Filenam e);
R ew rite(O utfile);
{The file to save the data is created.}
W riteln (O u tfile,
F ile n a m e l,'" ');
w riteln (o u tfile);
w r i t e l n ( o u t f i l e , ' time re q u ire d f o r o p e r a t i o n
s e c ');
w riteln (o u tfile);
WRITE(OUTFILE, 'LIGHT INT
'
);
111
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
' , tim e:? :2 ,'
WRITE(OUTFILE,'VOLTAGE
W R I T E L N ( O U T F I L E , ’CURRENT
');
') ;
{Some preliminary information is saved in the file.}
vgain := 570.9;
tempconst := ( r a nge/4096.0)/gain;
itempconst := tempconst * (1/61.2568);
for curv e n u m := 0 to numloops do
begin
FOR vptnum := 0 TO 20 DO
begin
WRITE(OUTFILE, ( ( ( (rawlightbuf"[curvenum, v p t n u m ] )/16) —
204 8 . 0 ) * t e m p c o n s t ):13:7,'
' );
WRITE(OUTFILE,-1*((((((rawvbuff"[curvenum,vptnum])/16)—
2 0 4 8 . 0 ) *tempconst) * vgain) - V O F F S E T ) :13:5,'
');
WRITELN(OUTFILE,-1*((((((rawibuff"[curvenum,vptnum])/16)—
20 4 8 . 0 ) * i t e m p c o n s t ) )-CURRENTOFFSET):13:10, '
') ;
end;
end;
{The data is processed and written to the file.}
WriteLn(OutFile);
close(outfile);
{The file to save the data is closed. Note very bad things can happen if opened files are not closed}
'N'
end;
: Begin
{If the user doesn’t wish to save the data file, then this part o f the case statement executes.}
wr iteln('the file will not be saved');
write('Are you sure that you w i s h to d i s c a r d the file? Y/N:
') ;
readln(doublecheck);
d o u b l e c h e c k := u p c a s e ( d o u b l e c h e c k ) ;
{The user is reminded that the data will not be saved and asked if they really wish to trash it.}
else
End;
begin
{If the user had trouble finding the correct keys, this part o f the case statement executes.}
w r i t e l n (’ple a s e answer with "Y" or " N " ');
end;
end;
until
(answer = 'Y ') or
((answer =
'N')
and
(doublecheck = ’Y ')) ;
{Once the conditions are met then the repeat-until statement will stop. If the user doesn’t answer with a N
or Y then they are asked the question again.}
writ e l n ('Analog input process done.
repeat until keypressed;
ch := readkey;
dispose(rawlightbuf);
dispose(rawvbuff) ;
dispose(rawibuff) ;
Press any key to continue.');
{The memory and pointers are emptied...}
rawli g h t b u f := nil;
rawvbuff := nil;
112
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
rawibuff
:= nil;
{and the memory freed.}
write('Do a n o t h e r with the s a m e settings Y/N:
readln(anothersame);
anothersame := u p c a s e ( a n o t h e r s a m e ) ;
until anothersame = 'N';
');
{The user has the option to do another with the same settings.}
CLRSCR;
WRIT E ( ' D O A N O T H E R WI T H DIFFERENT SETTINGS Y/N:
readln(another);
another := u p c a s e ( a n o t h e r ) ;
until another = 'N';
’);
{The user may alter the voltage settings and do another.}
clrscr;
end.
{This ends the program.}
113
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Appendix 2
Pascal Program for Combined
Simplex and Levenberg-Marquardt
Optimization of Langmuir Probe
Data
114
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Program combo;
{This program will analyze data collected during the Microwave Induced Plasma Langmuir probe
experiments. The user first enters the rootname for the files that will be analyzed. The program finds the
files with the rootname. The files are listed and the user is asked if any changes are to be made to the list.
The user may delete one file at a time until all unnecessary files have been removed from the list. The
program then analyzes the files and saves the results to an output file. To avoid errors and to save time the
output files are automatically named by adding “A” to the beginning o f the input file’s filename. This
enables many files to be analyzed without the user having to enter filenames manually. The output files are
automatically saved and their name identifies them as output files as well as readily allowing the user to
know how they correspond to the input files. This reduces analysis time and cuts down on errors.
The data files are arranged in three columns, representing in order light, voltage, and current readings. The
files are read one current-voltage curve at a time(21 raw data points each). The 21 light values are averaged
and the corresponding voltage and current values are matched with the following equation
Imeas = Imax - (imax * Imin)
/ [ l + C * Exp(l 1604.43 * V meas / T e ) j
Equation 1
Imeai: the measured current
Imax : the maximum current the curve would obtain (unknown)
Imm : the minimum current the curve would obtain (unknown)
C : a constant made up of several terms (unknown)
Te : the electron temperature (k) (unknown)
115
with permission o f the copyright owner. Further reproduction prohibited without permission
Vmeas: the measured voltage
Initial estimates o f the four unknown parameters are made and then two different optimization routines are
used to improve the fit o f the estimates to the actual data. The optimization procedures are taken from
Numerical Recipes in Pascal1. For simplicity the equations describing the procedures are the same as those
in the reference.
To determine how well an optimization step has performed a comparison is made between the predicted
values from the optimization and the actual values using the chi-square statistic
Equation 2
X~ : Chi-squared
i : each individual point in the curve
N : The number o f data points in the curve (21)
Y j: each individual current reading
y ( x , : a , . . a m) : this is equation 1 where x is the voltage and a represents the four parameters
£T, : the standard deviation o f a data point
First, simplex optimization is used to improve the estimates. The initial estimates for the parameters are
systematically multiplied by constants going from 0.7 to 1.3 and increasing by 0.1. This means that there
will be seven different simplex optimizations for each current-voltage curve. Each simplex optimization
continues until the chi squared changes by less than 0.00001 or there have been 5000 optimizations
116
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
performed. The best fit parameters are saved. The constant is increased and the optimization repeated.
The results are compared and the parameters giving the minimum chi-square are kept. This process is
repeated until the constant is equal to 1.3.
The simplex optimization method assumes no knowledge o f how the parameters interact. It simply avoids
regions giving relatively poor responses and systematically explores regions away from the poor responses.
We have more knowledge o f the relationship than the simplex optimization requires and would like to take
advantage o f this knowledge to get more information out o f the optimization procedure. Since the equation
relating the parameters and it’s partial derivative with respect to each parameter is known, the LevenbergMarquardt method for solving nonlinear equations can be used to finish the optimization. This method is
used because it takes full advantage o f our knowledge o f the system being studied and because it will
provide us with not only estimates o f the parameters but also their standard errors. This information can not
be determined using simplex optimization alone.
An obvious question is why bother with combining the two when the simplex optimization appears
unnecessary. When comparing the methods separately, using the same initial estimates, the simplex method
would give lower y j and therefore a better fit to the experimental data. It was decided to combine the
methods and use the simplex optimization to get the lowest x2 and use those values to start the LevenbergMarquardt method. This allows a better fit to be made and standard errors to be estimated.
As mentioned above, the best parameters from the simplex optimization are used as the initial parameters
for the Levenberg-Marquardt method to finish the optimization. This is a nonlinear method that iteratively
proceeds to minimization. The process is described below.
Near the minimum the x2function can be approximated by a quadratic equation
117
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
/}f2(a) ss y - d - a + —a - D a
Equation 3
where %z ( a ) : is the chi squared function for parameter (a)
d : is an M-vector
D : is an M x M matrix (second derivative or Hessian Matrix).
If equation 3 is an appropriate approximation o f the x2function then the minimized parameters can be
determined using the information built up in the Hessian matrix (second derivative matrix) D '1 o f the chi
squared merit function see Equation 4.
a n ,i„ =
a CUr + D
‘ l • [ - V
^ 2 ( a a lr)]
Equation 4
a mn i the optimized parameters
a ^ r : the current parameters
Vx2(acor) : direction o f the local downhill gradient (vector o f the first partial derivatives)
If equation 3 is not close then we add a step to improve our approximation. This step will also give us
information about the Hessian matrix that will be used in Equation 4 once an appropriate estimation is
achieved. The steepest descent method is used to obtain this information. The strategy is to start at point
P0. Move from point P, to P,*i by minimizing along the line from P, in the direction o f the local downhill
gradient {-Vx2(acur)}. The method is summarized in Equation 5. As can be seen by the equation the partial
derivative o f the present settings are used to estimate a new set o f parameters.
a next = a cur - constant x V * 2(
)
Equation 5
118
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
The Levenberg-Marquardt Method can be summarized as a seven step process.
1.) Use initial estimates o f the parameters (a) to compute x2(a).
2.) Pick a value for the constant in equation 5 say 0.001.
3.) Solve equation 5 as a series o f linear equations and evaluate a new y 2(a^ , )
4.) If
is larger than x2(a) increase the constant by a factor o f 10 and go to step 3.
5.) If x2(aoe*t) is smaller than x2(a) decrease the constant by a factor o f 10, update the estimates of the
parameters and go to step 3.
6.) Test to see if the conditions for stopping have been met. Repeat this process until the improvement in
X2 is less than 1 * lO-8. This cutoff point is selected because changes in the parameters that change x :
by « 1 are not statistically significant.
7.) Set the constant to 0 and perform one final run. This gives the standard errors in the optimized
parameters (a).
As a significant portion o f this program comes from Numerical Recipes in Pascal, comments will only be
added to the areas unique to this application.}
Uses CRT,
Dos;
CONST
np = 4;
{np >= ndiml
mp = 5;
{mp >= n dim + 1}
ndatap = 3 0 0 ;
map = 4;
TYPE
RealArrayMPbyNP = A R R A Y
RealArrayMP = A R R A Y
[ 1 . .mp,1..np] O F real;
[l..mp]
O F real;
119
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
RealArrayNP = ARR A Y
[l..npj
R e a l A r r a y N D A T A = ARRAY
RealA r r a y M A = ARRAY
OF real;
[l..ndatap]
[l..map]
I ntegerA r r a y M F I T = ARRAY
RealArr a y M A b y l = ARRAY
O F double;
OF double;
[l..map]
O F integer;
[1..map,1..1]
R e a l A r r a y M A b y M A = Array
O F double;
[1..map,1 . -map]
of double;
R e a l A r r a y N P b y N P = RealArrayMAbyMA;
R e a l A r r a y N P b y M P = RealArrayMAbyl;
I n t egerArrayNP = IntegerArrayMFIT;
VAR
MrqminOchisq,
MrqminBeta,
test,
a:
sig
Volts,
Current,
dy,
B e s t _ s i mp _ c h i s q : double;
: RealArrayNData;
NoDataPoints,
icount,
F i tParamName
lightpt
sig2i,
RealArrayMA;
sigma,
ndata,
xx,
Light,ICalc,
NoParamFit,
numloops
(std dev of each current value}
IE r r o r
NoParam,
: RealArrayNData;
I, J : Integer;
: integer;
: Array[l..map]
of string;
: double;
FitParam,
InitParam : RealArrayMA;
P a r a m A d j : IntegerArrayMFIT;
covar,
alpha:
chisq,
alamda,
dchi
RealArrayMAbyMA;
ChiSqLast,
SD,
ymod,
mult_factor
: double;
: real;
counter,
T estP a r a m
Another,
lin_test
: integer;
: RealArrayNP;
Ch
: Char;
start_simplex,
Processed_Simplex,
Best_Simplex
:RealArrayMPbyNP;
120
Reproduced with permission of the copyright o w n er Further reproduction prohibited without permission.
chisqarray,
InFile,
BarPos
Start_chisqarray,
outfile
: RealArrayMP;
: text;
: Integer;
Dirlnfo:
SearchRec;
InFileName,
OutFileName
filecounter2,
RootName
OK,
Processed_chisqarray
{ For Windows,
: A r r a y [0..100]
fiiecounter,
strct,
use T S e a r c h R e c
}
of S t r i n g [15];
delnum,
whichfilecount
: Integer
: String;
filetrbl,
again : Char;
function func(VAR a: RealArrayNP):
real;
(function whose min is to be found)
Begin
chisq
:= 0.0;
ndata
:= NoDataPoints;
FOR icount
:= 1 TO ndata DO BEGIN
{Summation loop over all
data)
ymod
:= 0;
ymod
:=
a [1] -
(a[1] - a [2])
/
(1 + a [3]
* Exp( 1 1 6 0 4 . 4 3
v o l t s [ i c o u n t ] / a [4]));
{YMOD is equation 1.}
ICalc[Icount]
I E r r o r [Icount]
sig2i
dy
:= ymod;
:= Current[Icount]
- ICalc[Icount] ;
:= 1 . 0 / (sigma[icount]’s i g m a [ i c o u n t ] );
:= current[icount]-ymod;
c hisq
:= chisq+ d y * d y * s i g 2 i ;
(find X*2)
end;
func
:= chisq;
end;
121
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
*
PROCEDURE a moeba(VAR p:
RealArrayMPbyNP;
VAR y: RealArrayMP;
ndim:
integer;
ftol:
real;
VAR nfunc:
integer);
LABEL 99;
CONST
nfun c m a x = 5000;
{Maximum # of evaluations)
alpha = 1.0;
{Parameters d e f ining the e x p a n s i o n s
& contractions)
beta = 0.5;
gamma = 2.0;
VA R
m p t s , j ,i n h i , i l o , i h i , i : integer;
y t r y , y s a v e , s u m , r t o l : real;
psum:
"RealArrayNP;
FUNCTION a m otry(VAR p:
RealArrayMPbyNP;
V A R y: RealArrayMP;
VAR sum:
RealArrayNP;
ndim,ihi:
integer;
VAR nfunc:
integer;
fac:
r e a l ) : real;
{Extrapolates by a factor fac through the face of the
simplex across
from the high point,
tries it and replaces
the high point if the new point is better)
VAR
122
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
j: integer;
facl,fac2,ytry;
ptry:
real;
ARealArrayNP;
BEGIN
new(ptry);
facl
:=
fac2
:= facl-fac;
FOR j
(1.O-fac)/ndim;
:= 1 TO ndi m DO
pt r y A [j]
:= s u m [ j ]* f a c l - p [ i h i , j ] *fac2;
ytry := f u n c ( p t r y A );
{Evaluates the function at the trial
point}
nfunc
:= nfunc+1;
IF ytry < y [i h i ] THEN BEGIN
yfihi]
:= ytry;
{If it's better than the highest,
{replace the highest)
FOR j ;= 1 TO ndi m DO BEGIN
s u m [j ] := s u m [ j ]+ p t r y A [j ]- p [ i h i , j ];
P [ i h i , j ] := p t r y A [j ]
END
END;
amotry
:= ytry;
dispose(ptry)
END;
BEGIN
new(psum);
mpts
nfunc
:= ndim+1;
:= 0;
FOR j := 1 TO ndim DO BEGIN
sum
;= 0.0;
123
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
then)
FOR i := 1 TO mpts DO
sum
:= sum+p[i,j];
p s u m /'[j]
:= sum
END;
WHILE true DO BEGIN
ilo
:= 1;
IF y[l]
{First we must determine w h i c h point is the)
> y[2]
THEN BEGIN
{h i g h e s t ( w o r s t ), nex thighest,
and
lowest(best)}
ihi
:= I ;
inhi
:= 2
END
ELSE BEGIN
ihi
:= 2;
inhi
:= 1
END;
FOR i := 1 TO mpts DO BEGIN
(by looping over the poi n t s
simplex)
IF y[i]
< y[ilo]
THEN ilo
IF y[i]
> y[ihi]
THEN BEGI N
inhi
ihi
:= i;
:= ihi;
:= i
END
ELSE IF y[i]
> y[inhi]
THEN
IF i <> ihi THEN inhi
;= i
END;
(Compute the fractional range from highest to lowest)
rtol
:= 2 . O * a b s ( y [ i h i ] - y [ i l o ] ) / (abs(y[ihi])+ a b s ( y f i l o ] ));
IF rtol < ftol THEN GOTO 99;
IF nfunc >= nfuncmax THEN BEGIN
124
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
in the
w r i t e l n ('pa use
in A MOEBA - coo many iterations');
r eadl n
END;
{Begin a new iteration.
First,
ex trapolate b y a factor alpha
th ro ugh the face of the simplex across from the hig h point,
i.e.,
ytry
reflect the simplex from the high point}
:= amotr y(p,y,psum",ndim,ihi,nfunc , - a l p h a ) ;
IF y t r y <= y[ilo]
THEN
{Gives a result b e t t e r than the best point,
so t r y an additional
ex t r a p o l a t i o n b y a factor gamma}
ytry
:= amotry(p,y,psum*,ndim, ihi, nfunc,gamma)
ELSE IF
yt ry >= y[inhi] THEN BEGIN
{The r e f l e c t e d poi nt is worse than the
an i n t e r m e d i a t e
ysave
ytry
lower point,
i.e.,
second-highest, so look
for
do a o n e - d i m e n s i o n a l contraction}
:= y[ihi];
:= a m o t r y ( p , y , p s u m " , n d i m , i h i , n f u n c , b e t a ) ;
IF y t r y >= ysave TH EN BEGIN
FOR i
IF
{Can't seem to get rid of that high}
:= 1TO mpts DO
{point.
Better c o n t r a c t around the}
i <> ilo THE N BEGIN
{l o w e s t ( b e s t ) point}
FOR j := 1 TO ndim DO BEGIN
p s u m /'[j]
p[i,j]
:= 0 . 5* (p[i, j ]+p [ilo, j ] ) ;
:= p s u m ~ [j ]
END;
y[i]
:= f u n c t p s u m 1')
END;
nfunc
:= nfunc+ndim;
FOR j := 1 TO ndim DO BEGIN
sum
{Keep track of function evaluations}
{Recompute psum}
:= 0.0;
FOR i := 1 TO mpts DO
125
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
sum
:= sum+p[i,jj;
p s u m ~ [j ] := sum
END
END
END
END;
{Go back to the test for donene ss a n d the next
iteration}
99:
dispose(psum)
END;
{procedure amoeba}
P ROC EDURE g a u s s j ( V A R a:
RealArrayNPbyNP;
n:
integer;
VAR b:
RealArrayNPbyMP;
m:
integer);
(*Linear e q u a t i o n s o l u t i o n by Gaus s - j o r d a n elimination,
e q u a t i o n (2.1.1)
above.
The input m a t r i x afl..n,l..nj
has n by n elements.
b[i..n,l..,]
is an
input
ma t r i x o f size n by m constraining the m r i g h t - h a n d vectors.
output,
On
a is
rep la c e d b y its m atrix inverse,
and b is r e p l a c e d b y the corresponding
set
of s o l u t i o n vectors.
Section 2.1*)
VAR
b ig, du m , p i v i n v :
double;
i, icol, i r o w , j ,k,1,11:
indxc, indxr, ipiv:
integer;
/'IntegerArrayNP;
(*The i n t e g e r arrays i p i v 7'[1. .n], i n d x r A [1..n ] , and i n d s c A [1..n] are
used
126
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
for book ke e p i n g o n the pivoting*)
3EGIN
new(indxc);
new(indxr);
new(ipiv);
FOR j
:= 1 TO n D O
i p i v A [j]
FOR i
:= 1 TO n DO
BEGIN
:= 0;
(*This is the m a i n loop o v e r the col umns
to*)
big
:= 0.0;
(*be reduced*)
FOR j := 1 TO n DO
(*This is the outer loop of the s e a r c h for
*)
IF i p i v A [j] <>
1 THE N
(*a pivot point*)
FOR k := 1 TO n DO
IF ip ivA [k] = 0 THEN
IF a b s ( a [j , k ] ) >= big THEN BEGIN
big
:= a b s ( a [j ,k ] );
irow
:=
j;
icol
:=
k
END
ELSE IF i p i v A [k]
> 1 THEN BEGIN
w r i t e l n {'pause 1 in GAUSSJ - singular matrix');
readln
END;
i p i v A [icol]
:= i p i v A [i c o l ]+1 ;
(*We n o w have the pivot element,
so we interchange rows,
if needed,
put
the p ivo t element on the diagonal.
The columns are not p h y s i c a l l y
interchanged.
127
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
to
o nly relabeled:
indxc'ti],
the co lumn of the ith pivot element,
is the
ith
col u m n that is reduced,
whil e indx~[i]
is the row in which that pivot
element
was originally located.
If i n d x r * [ i ] o i n d x c " [ i ]
there is an implied
column
interchange.
With this form of bookkeeping,
the solution b's will end
up in
the correct order,
and the inver se matrix will be scrambled by columns'
IF irow <> icol THEN BEGIN
FOR 1 := 1 TO n DO BEGIN
d um
:= a [ i r o w , 1];
a[irow,l]
:= a[icol,l];
a [ic ol,1]
:= dum
END;
FOR 1 := 1 TO m DO BEGIN
dum := b [ i r o w , 1];
b[irow,l]
:= b[icol,l];
b[icol,l]
:= dum
END
END;
indxr~[i]
:= irow;
(*Divide the pivot row by the pivot
:= icol;
(*at irow and icol*)
element*)
indxc~[i]
IF a[icol,icol]
= 0.0 THEN BEGIN
w r i t e l n ('pause 2 in GAUS S J - singular matrix');
readln
END;
128
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
pivinv
:= 1 . 0 / a [ i c o l , i c o l ] ;
a[icoi,icoij
:= 1.0;
FOR 1 := 1 T O n DO
a[icol, 1]
:= a [ i c o l , 1 ] *pivinv;
FOR 1 := 1 T O m DO
b[icol, 1]
FOR 11
:= b [ i c o l , 1 ] ’pivinv;
:= 1 T O n DO
IF 11 <> icol THE N BEGIN
dum
[Reduce the pivot rows,
except
fori
[the pivot one!
:= a [11,icol];
a [11,icol]
:= 0.0;
FOR 1 := 1 TO n DO
a[ll,l]
:= a [11,1]-a[i c o l , 1] *dum;
FOR 1 := 1 TO m DO
b [11,1]
:= b [11,1]- b [icol ,1]*dum
END
END;
(*This is the end of the main loop over columns of the reduction.
It
only
remains to u n s c r a m b l e the solution in view of the column interchanges.
This is done by inter changing pairs of columns in the reverse order
that
the p e r m u t a t i o n was built u p . ’ )
FOR 1 := n DOWNTO
IF i n d x r " [1]
1 DO
<> i n d x c A [l] THEN
FOR k := 1 TO n DO BEGIN
dum
:= a [ k , i n d x r A [1]];
a [ k , i n b x r A [1]]
:= a [ k , i n d x c A [1]] ;
a [ k , i n d x c A [1]]
:= dum
END;
129
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
dispose(ipiv);
dispose(indxr);
dispose(indxc)
END;
PROCEDURE c o v s r t ( V A R c o v a r : RealArrayMAbyMA;
ma:
V A R lista:
mfit:
integer;
IntegerArrayMFIT;
{l is t a = P a r a m A d j }
integer);
{ma = n o p a r a m
: # of p a r a m e t e r s (4) }
(*Given the c ovar iance mat ric covar[l..ma, 1 . .ma]
total parameters,
of a fit
for mfit of ma
and their o r d e r i n g l i s t a [1..ma], r e p a c k the c o v a r i a n c e
mat rix to the true order of the parameters.
fixed p a r a m e t e r s will be 0
Elements a s s o c i a t e d with
Sec t i o n 14.3 *)
VAR
j,i:
integer;
swap:
double;
BEGIN
FOR j := 1 TO ma-1
DO
{Zero all elements b e l o w diagonal]
FOR i := j+1 TO ma DO covar[i,j]
FOR i := 1 TO mfit -1 DO BEGI N
:= 0.0;
{Repack o f f - d i a g o n a l
elemen ts of
into ]
FOR j := i+1 TO mfit DO
{correct locations b e l o w diagonal]
IF l i s t a [j ] > l i s t a [ i ] THE N
c o v a r [ l i s t a [ j ],list a [ i ] ] := covar[i,j]
ELSE
c o v a r [ l i s t a [ i ] ,l i s t a [ j ]]
:= covar[i,j]
END;
130
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
fit
swap
:= c o v a r [1,1];
elements
{Temporarily store original diago nal
in}
FOR j := 1 T O ma DO BEGIN
{top row,
covar[l,j]
:= covar[j, j ] ;
covar[j,j]
:= 0.0
and zero the diagonal}
END;
c o v a r [ l i s t a [1],l i s t a [1]]
:= swap;
FOR j := 2 T O mfit DO
{Now sort elements
into pro per o r d e r on
dianonal}
c o v a r [ l i s t a [ j ],l i s t a [ j ]]
FOR j := 2 T O ma DO
:= covar[l,j];
{Fill in above d i a g o n a l by symmetry}
FOR i := 1 T O j-1 DO
c o v a r [i ,j ] := covar[j,i]
END;
PROCEDURE funcs(xx:
double;
{xx = x[i]
: voltage}
V A R a: RealArrayMA;
{a =
fitparam
Var
{yfit = ymod
: which p a r a m e t e r is
being fit}
yfit:
double;
: fitting function
(estimated y v a l u e ) }
VAR dyda:
ma:
RealArrayMA;
integer);
{dydy
= dydy'' : partial derivative}
{ma = noparam
: # of p a r a m e t e r s (4) }
{funcs Evaluates the fitting function yfit and its derivatives}
{dyda with respect to the parameters a at point xx
Section
14.4}
{The term dyda refers to the partial derivative. The numbers 1, 2, 3 and 4 refer to
lmui, C and T c
respectively.}
Begin
yfit
:=
a [1]
-
(a [1]
— a [2])
/ (1 + a [ 3 ]
* E x p (11604.43
* xx / a[4]));
131
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
d y d a [1]
:= 1 - 1 /
d y d a [2]
:= 1 /
d y d a [3]
:=
(1 + a[3]
* Exp(11604.43
* xx / a [4]));
(1 + a[3]
* Exp(11604.43
* xx / a [4]));
(a[1] - a [2])
* Exp(11604.43
* xx / a [4])
/ sqr(l + a[3]
*
E x p (-11604.43 * xx / a [4])) ;
:= (a[1] - a[2])
d y d a [4]
* a[3]
* 11604.43 * xx * Exp (11604.43
* xx /
a [4 ])
/ s q r ( a [4]
*
(1 + a [3]
* Exp(11604.43
* xx / a [4])));
End;
PROCEDURE m r q m i n ( V A R x,y,sig:
RealArrayNDATA;
ndata:
integer;
{ndata = N o D a t a P o i n t s }
VA R a:
RealArrayMA;
{a = FitParam}
integer;
{ma = no param
ma:
: # of
p a r a m e t e r s (4)}
V A R lista:
mfit:
V A R covar,alpha:
VAR chisq,alamda,
test:
IntegerArrayMFIT;
integer;
{lista = P a r a m A d j )
{mfit = NoParamFit}
RealArrayMAbyMA;
double);
{x : Voltage)
{y : Current)
{sig = simg a
(*
: std dev of the I values)
Leve n b e r g - M a r q u a r d t method,
attempting to reduce the value X~2
of a fit
bet ween a set of points x [ l . .ndata], y [1..ndata]
with individual
standard
deviations s i g [ 1 . .ndata ], and a n o nlinea r function dependent of
coefficients
a[i..ma].
The a r r a y lista[l..ma]
numbers the param eters a such that
the first
132
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
mfit elements c o rr espond to values actually b e i n g adjusted;
the
remaining
ma-mfit paramet ers are h el d
fixed at their input value.
The pro gram
returns
current best-fit values for the ma fit parametersa,
and X~2 = chisq.
During
most interations the
[1.. m f i t , 1 . .mfit]
elements of the array
c o v a r [1..m a ,1..m a ]
and the array a l p h a [1..ma,1 . .ma]
are used as work ing space.
The
program must
be supplied wit h a routine
funcs(s,a,yfit, dyda,ma)
that evaluates
the fitting
function yfit,
and its d e r i v a t i v e s dyda[l..ma]
wit h respect to the
fitting
parameters a at x.
On the first call provide an initial guess
for
the
parametersa,
and set alamda < 0.0 for initia lizati on(wh ich then sets
alamda
= 0.001).
If a step succee ds chisq becomes smaller and alamda
decreased by a
factor of 10.
If a step fails alamda grows by a factor of 10.
You
must
call this routine r e p e a t e d l y until convergence is achieved.
Then,
make one
final call with alamda = 0 . 0 ,
so that covar returns the covariance
matrix,
and alpha the curvature matrix.
Section 14.4*)
LABEL 99;
VAR
133
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
k,kk,j,init:
atry,da:
oneda:
integer;
"RealArrayMA;
''RealArrayMAbyl;
PROCEDURE m r q c o f ( V A R x,y,sig:
RealArr ayNDAT A;
{a = FitParam}
V A R a : RealArrayMA;
VAR lista:
Int egerA rrayMFIT;
VAR alpha:
Re alArr ayMAby MA;
{lista = P a r a m A d j }
V AR b e t a : RealArrayMA;
VAR chisq:
double);
{x : Voltage}
{y : C u r r e n t }
{sig = simga
: std de v of the
(* used by mrqmin to e v a l u a t e
I values}
the l i n e a r i z e d fi tt i n g matri x
a l p h a [1 . .mfit , 1 . . m f i t ], and vector b e a t [ 1 . .mfit]
as in
(14.4.8)
{section 14.4}
VAR
k,j,i:
integer;
ymod,wt,sig2i,dy:
dyda:
double;
"RealArrayMA;
BEGIN
new(dyda);
{Initialize
FOR j := 1 T O mfit DO BEGI N
(symmetric)
beta}
FOR k := 1 TO j DO alpha[j,k]
beta[j]
:= 0 . 0 ;
:= 0.0
END;
chisq := 0.0;
134
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
alpha,
FOR i := 1 TO ndata DO BEGIN
ymod
{Summation loop over all data}
:= 0;
f u n c s ( x [ i ],a , y m o d , d y d a A , m a ) ;
ICalc[I]
:= ymod;
IError[I]
sig2i
:= Current[I]
- ICalc[I];
:= 1 . 0 / (sig[i] *sig[ i]);
dy := y[i]-ymod;
FOR j := 1 TO mfit DO BEGIN
wt
:= d y d a A [lista[j]]*sig2i;
FOR k := 1 TO j DO
alpha[j,kj
beta[j]
;= alphafj, k ] + w t * d y d a A [listafk] ] ;
:= b e t a [j ]+dy*wt
END;
chisq
:= c hisq+d y*dy*sig2i
{find X A2}
END;
FOR j
:= 2 TO mfit DO
{fill in the symm e t r i c side}
FOR k := 1 TO j-1 DO alpha[k,j]
:= a l p h a [j , k ] ;
dispose(dyda)
END;
BEGIN
n e w (d a );
new(oneda);
{oneda is a matrix with 1 column,
the vector
da}
new(atry);
{It is u s e d by gaussj below}
IF alamda < 0.0 THEN BEGIN
{Initialization step}
kk := mfit+1;
FOR j := 1 TO ma DO BEGIN
ihit
:= 0;
{Does lista contain a pro per permutation}
{of th e coefficients}
135
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
FOR k := 1 TO mfit DO
IF lista[k]
= j THE N ihit
:= ihit+1;
IF ihit = 0 THEN BEGIN
lista[kk]
:= j;
kk := kk+1
END
ELSE IF ihit > 1 THEN BEGIN
wri teln('pause 1 in routine MRQMIN');
w r i t e l n ('Improper p e rm utatio n in LISTA');
readln
END
END;
IF kk <> ma+ 1 THEN
Begin
w r i t e l n ('pause 2 in ro utine MRQMIN');
w r i t e l n ( ’Improper permut ation in L I S T A ’);
readln
END;
alamda
:= 0.001;
mrqcof(x, y,sig,a, lista,alpha, M r q m i n B e t a , c h i s q ) ;
Mr q mi nOchi sq
{
:= chisq{+100);
Graphicalpresentation;
repeat until
keypressed;
ch := readkey;
FOR j := 1 TO ma DO atry^fj]
}
:= a[j]
END;
FOR j := 1 TO mfit DO BEGIN
{alter linearized
fit t i n g }
FOR k := 1 TO mfit DO covar[j,k]
:= alpha[j,kl;
{matrix by
augmenting)
136
Reproduced with
permission of the copyright owner. Further reproduction prohibited without permission.
c o v a r [j , j i := a l p h a [j ,j ]*(1. 0 * a l a m d a );
o n e d a " [j , 1]
{diagonal e l e m e n t s }
:= M r q m i n B e t a [j ]
END;
gauss j (covar, m f i t ,oneda'', 1) ;
FOR j
:= 1 TO m f i t
d a /'[j]
{Matrix solution}
DO
:= o n e d a 7'[j , 1] ;
IF alamda = 0 . 0
TH E N BEGIN
{Once conve r g e d evalua te
covariance}
c o v s r t ( c o v a r , m a , l i s t a , m f i t );
{matrix with alamda = 0}
GOTO 99
END;
FOR j := 1 TO m f i t DO
a t r y 7'[lista [j ] ] := a [ l i s t a [j ]]+ d a ~ [j ];
mrqcof(x,y, s i g , a t r y ~ , l i s t a , c o v a r , d a ~ , c h i s q ) ;
test
:= chisq;
IF chisq < M r q m i n O c h i s q THEN BEGIN
alamda
:= 0.1*alamda;
MrqminOchisq
{Did the trial succeed?}
{Success,
accept the new solution}
:= chisq;
FOR j := 1 TO mfit DO BEGIN
FOR k ;= 1 TO mfit DO alpha[j,k]
:= covar[j,k];
M r q m i n B e t a [j ] := da~[j];
a[lista [j ]]
:= a t r y ^ [ l i s t a [ j ]]
END
END
ELSE BEGIN
{Failure,
increase alamda and
return}
alamda
chisq
:= 10.0*alamda;
:= M r q m i n O c h i s q
END;
137
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
99:
dispose(aery);
dispose(oneda);
dispose(da)
END;
Procedure getfilename;
{This procedure is used to obtain all the filenames with a common root and then allow the user to select
those to be analyzed. This allows the user to analyze numerous files at one time without having the tedious
task o f entering each name.}
Begin
W i n d o w (1,1,80,25);
Textbackground(LightGray);
Textcolor(White);
clrscr;
G o t o x y (20,5) ;
W r i t e ( ' E n t e r Root Name
(EXIT to quit):
');
{First a window is placed on the monitor and the rootname is requested. If exit is entered the program is
terminated.}
Repeat
{This repeat has the computer searching for all o f the files in the directory C:\lintemp\ that have the given
rootname.}
ReadLn(RootName);
clrscr;
for strct
:= 1 to Leng t h ( r o o t n a m e )
rootname[strct]
Fil ecounter
do
:= U p C a s e (r o o t n a m e [ s t r c t ]);
:= 0;
F i n d F i r s t (1C :\ l i n t e m p \ '+ R o o t N a m e + '*.P r n ', AnyFile,
DIR *.PAS
D i r l n f o ) ; { Same as
}
138
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{The rootname is modified so that only one directory will be read and the Findfirst procedure is used to
execute a search for the first match. After the first call the FindNext procedure will be used. These are
pascals equivalent to the DOS command Dir *.pm}
while D o s E r r o r = 0 do
beg in
Inc(filecounter);
g o t o x y ( 2 5 * ( f i l e c o u n t e r div 20)
+1, (filecounter m o d 20)
+ 1);
’, f i l e c o u n t e r :3, '---',D i r l n f o . N a m e ) ;
W r i t e (’
I n F i l e N a m e [F i l e c o u n t e r ] := Dirlnfo.Name;
O u t F i l e N a m e [F i l e c o u n t e r ] := ('A'
+ I n F i l e N a m e [ F i l e c o u n t e r ] );
FindNext(Dirlnfo);
end;
{The first filename is read and the FindNext procedure is used to find the next file in the directory.}
If
(Filecounter = 0)
Then
Begin
If not
(Rootname =
'EXIT')
Then
Begin
ClrScr;
G o t o x y (10,26);
Writeln('No
Files
Found With This R o o t n a m e
',rootname);
W r i t e ('Ple a s e e n t e r another Rootname O r Type
"EXIT" to Exit:
end;
end;
{If no files are found an error message is given}
If F i l e c o u n t e r > 0 Then
Begin
g o t o x y (10,22);
Wr i t e l n t ' T h i s
Is The List Of All Files W i t h This R ootnam e
139
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
');
');
Writeln('
Are These Ok? Y/N:
');
{The user is asked if the listed files are ok to analyze.If they are ok then they are analyzed and if they are
not the user is allowed to start over or delete unwanted files.}
repeat
OK
:= upcase(readkey) ;
unt il
(OK = 'Y')
If O K =
or
(OK = 'N');
'N' Then
Beg in
W r i t e l n ( ' T o DELETE a File from analysis list E nter "D" or
to S T A R T O V E R
Enter " S "
');
{The user is allowed to delete files or to start over.}
repeat
filetrbl
Until
:= u p c a s e (r e a d k e y );
(Filetrbl =
If filetrbl =
’D ') or
(Filetrbl =
’S ’);
'S' then
Begin
again
:=
'Y';
ClrScr;
W r i t e ( ' E n t e r Root Name
(EXIT to quit):
');
end;
If Filetrbl =
'D '
then
Begin
aga in
:= 'N ' ;
Repeat
writeln;
w r ite ('Ent er number of the File NOT to be analy zed or 0 for
fin ished
');
{The user is allowed to enter a number corresponding to a file not to be analyzed. The number 0 is reserved
to determine when the user is finished deleting files.}
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Readln(delnum);
clrscr;
If Not
(DelNum = 0)
then
Begin
For I := DELNUM to F i l e c o u n t e r - 1 do
Begin
I n F i l e N a m e [I ] := I n F i l e N a m e [1+1];
O u t F i l e N a m e [I ] := O u t F i l e N a m e [1+1];
end;
InFileName[Filecounter]
Out FileNa me[Filecounter]
:=
'';
:=
'';
D e c (f i l e c o u n t e r );
For Filecounter2
;= 1 to F i l e c o u n t e r do
Begin
g o t o x y (25*(filecounter2 d i v 20)
+ 1 , ( filecounter2 m o d 20)
W r i t e (f i l e c o u n t e r 2 :3, '--- ',i n f i l e n a m e [f i l e c o u n t e r 2 ] );
end;
end;
Until D el Num = 0;
end;
End;
end;
Until
((again = 'N ') a n d ( F i l e c o u n t e r
(Rootname = 'EXIT')
Or
(OK =
>0))
Or
'Y');
W r i t e l n ('Press any key to C ontinue');
Repeat Until Keypressed;
Ch := Readkey;
{The program is paused before the analysis begins.}
end;
141
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
+ 1);
Pro cedure readlcurve;
{This procedure reads one 21 point data set to be analyzed. There are 251 such sets in each file that is
analyzed.}
Var
I, n
: integer;
IMax,
IMin
sumX,
SumY,
: Double;
SumXY,
SumX2,
Y, m,
b,
addlight
: Double;
Begin
I := 0;
addlight
:= 0;
Repeat
{This repeat statement is executed 21 times to read in the data set.}
Begin
Inc(I);
ReadLn(Infile,
l i g h t [ i j ,volts [I], Currentfl]);
{A line from the file infile is read in and the values are stored in the appropriate array. The light signal
read first and stored in light[I] and so on for the voltage and current signals }
add light
:= addlight
+ light[i];
{The light signal is summed.}
sigma[I]
:= 2e-6;
{Sigma[I] is the standard deviation o f a current reading.}
If I = 1 then
Begin
IMax
:= C u r r e n t [1];
IMin
:= C u r r e n t [1];
End
142
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Else
Begin
If Current[I]
> IMax then IMax
:= C u r r e n t [ I ] ;
If Current[I]
< IMin then IMin
:= Current[I];
End;
{The above lines are used to estimate the parameters IMAX and IMIN.}
End;
until I = 21;
lightpt
:= addlight/21;
{The light signal is averaged.}
NoD ataPoints
:= I;
FitParamNamefl]
FitParamfl]
:= '1+';
:= 1.0*IMax;
{FitParam[l] is Imax from equation 1.}
InitParamfl]
:= Fitparam [1 ]•;
F i t P a r a m N a m e [ 2]
FitParam{2]
:= 'I-';
:= 1.0*IMin;
{FitParam[2] is Imin from equation I.}
InitParam[2]
sumX
:= 0;
SumY
;= 0;
SumXY
:= 0;
SumX2
:= 0;
:= Fitparam[2];
n := 0;
For I := 1 to NoDataPoints do
If
(Current[I]
AND
>
(IMin + 0 . 1 * ( I M a x - I M i n ) ))
(Current[I]
<
(IMax - 0.1
* (IMax-IMin)))
Begin
143
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Then
Y
:=
(IMin - C u r r e n t [I ] ) / ( c u r r e n t [I ] - I M a x ) ;
Y
:= I n ( y ) ;
SumX
:= SumX +
volts[I];
SumY
:= SumY + Y;
SumXY
:= SumXY + y * volts[I];
SumX2
:= SumX2 + s q r ( v o l t s [ I ] );
Inc(n);
End;
m
:=
b :=
(SumXY - SumX * SumY / n)/(sumx2 - Su m X * SumX / n ) ;
(sumY - m * SumX)/n;
{Linear regression is performed on the linear region in the middle o f the I-V curve. This is used to
estimate C” and Te.}
FitParamName [3]
FitParam[3]
:= 'C'";
:= 1.0*exp(b);
{FitParam[3] is C in equation 1.}
InitParam[3]
:= F i t p a r a m [ 3 ] ;
F i t P a r a m N a m e [4]
FitParam[4]
:= 'Te';
:= 0 . 9 5 * ( 1 1 6 0 4 . 4 3 / m ) ;
{FitParam[4] is the electron temperature in equation 1.}
InitParam[4]
:= Fitparam[4];
End;
Begin
dchi
{Main Program)
:= 0.00001;
W i n d o w (1,1,80,25);
Te x t b a c k g r o u n d ( L i g h t G r a y ) ;
Textcolor(White);
Repeat
144
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Getfilename;
{The above procedure gets all filenames with a common root and allows the user to select which ones to
anlayze.}
If Not
(Rootname = 'EXIT')
then
Begin
For w h i c h f i l e c o u n t
:= 1 to filecounter do
begin
Assign
(Infile,
' C:\lintemp\'+ i n f i l e n a m e [ w h i c h f i l e c o u n t ] );
{The appropriate file and directory is determined.}
R e S e t (I n F i l e ) ;
{Then the file is prepared to be read into the program.}
Readln(infile);
R e a d l n (i n f i l e ) ;
Readln(infile);
Readln(infile);
Readln(infile);
Assign
(outfile,
'C : \ l i n t e m p \ '+ o u t f i l e n a m e [ w h i c h f i l e c o u n t ] );
rewrite(outfile);
{The file to store the output is automatically selected and prepared.}
clrscr;
for n u m l o o p s
:= 1 to 251 do
{This for loop reads through all 251 data sets in a file. This loop will repeat for all requested files.}
begin
readlcurve;
{One 21 point data set is read in to be analyzed.}
W i n d o w (2,2,40,3);
TextBackground(blue);
TextColor(yellow);
145
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
W r i t e ( i n f i l e n a m e [ w h i c h f i l e c o u n t ] ,'
is being analyzed');
W i n d o w (2,4,30, 5) ;
TextBackground(red);
TextColor(yellow);
W r i t e ('File Loop Number
', N u m l o o p s :3);
W i n d o w (1,1,80,25);
Textbackground(LightGray);
Textcolor(White);
D e l a y (500);
If
(Numloops Mod 5 ) = 0 then
B eg i n
Inc(BarPos) ;
Gotoxy(BarPos, 7) ;
T e x t c o l o r ( R e d + Blink);
W r i t e ('0');
TextColor(White) ;
end;
{To prevent the user (myselO from pulling their hair out some distractions are placed on the monitor. They
tell which file is being analyzed and where in the file the program is currently analyzing.}
for lin_test
:= 7 to 13 do
Beg in
mult_factor
:= Lin_test
/ 10;
{This section systematically multiplies the initial estimates o f the parameters by a fudge factor and allows
simplex optimization to determine the best set to be passed onto the Levenberg-Marquardt Method }
For i
:= 1 to mp do
Begin
For
j := 1 to np do
Start_simplex[i, j ] := FitParam[j];
146
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
end;
j := 1;
For I := 2 to mp do
Begin
S t a r t _ s i m p l e x [ i , j ] := m ult_ f a c t o r * Start_simplex[i, j ];
i n c (j );
end;
j := 0;
For I := 1 to mp do
Begin
For j := 1 to np do
Begin
TestParam[j]
:= S t a r t _ s i m p l e x [ i , j ];
? r o c e s s e d _ S i m p l e x [ i , j ] := S t a r t _ s i m p l e x [ i , j ];
end;
Start_chisqarray[i]
:= func(T e s t P a r a m ) ;
Processea_chisqarray[i]
:= S t a r t _ c h i s q a r r a y [ i J ;
end;
A m o e b a (Processed_Simplex,
Processed_chisqarray,
np,
dchi,
counter);
If Lin_test = 7 then
Begin
B e s t _ si mp_ch isq
:= Start_chisqarray[l] ;
For I := 1 to mp do
Begin
For j := 1 to np do
Begin
B e s t _ S i m p l e x [ i , j ] := Start_Simplex[i, j ];
147
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
end;
end;
end;
{An initial estimate o f the best fit parameters is determined.}
If Processed_chisqarray[l]
< Bes t _ s i m p _ c h i s q then
Begin
Be s t _ s i m p _ c h i s q
:= P r o c e s s e d _ c h i s q a r r a y [1] ;
For I := 1 to m p do
Begin
For j := 1 to np do
B e s t _ S i m p l e x [\, j ] := P r o c e s s e d _ S i m p l e x [ i , j ];
end;
end;
{As the program cycles through the fudge factors to multiply to the initial parameters, it checks to see which
has given the best results. }
end;
NoParam
:= 4;
NoP ar a m F i t
:= 4;
P a r a m A d j [1]
:= 1
P a r a m A d j [2]
:= 2
P a r a m A d j [3]
:= 3
P a r a m A d j [4]
:= 4
alamda
:= - 10;
For J := 1 to np
FitParamfJ]
:= B e s t _ S i m p l e x [1, j ] ;
{The results o f the simplex optimization becomes the starting point o f the Levenberg-Marquardt Method .}
mrqmin(Volts,
NoParam,
Current,
sigma,
NoDataPoints,
P a r a m A d j , NoParamFit,
covar,
FitParam,
alpha,
148
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
chisq,
alamda,
test);
Repeat
Chi SqLast
:= ChiSq;
mrqmin(Volts,
NoParam,
chisq,
Until
Current,
sigma,
ParamAdj,
alamda,
NoDataPoints,
NoParamFit,
covar,
FitParam,
alpha,
test);
( (abs(ChiSqLast - C h i S q ) ) < IE-8)
( (abs(chisqlast - test))
and
< IE-8);
{The minimization procedure is repeated until the decrease in Chi squared is less than 1* 10"®}
alamda
:= 0;
mrqmin(Volts,
NoParam,
chisq,
Current,
ParamAdj,
alamda,
sigma,
NoDataPoints,
NoParamFit,
covar,
FitParam,
alpha,
test);
{One last cycle through to get the standard errors.}
w r i t e ( o u t f i l e , C h i S q : 10, ',
');
w r i t e ( o u t f i l e , l i g h t p t :14,',
');
For I := 1 to NoPara m do
Begin
W rit e(outf ile,F ItPara m[I] :14, ’, ' ) ;
SD
:= Sqrt(CoVar[I, I] ) ;
W r i t e ( o u t f i l e , S D : 14, 1, ’);
End;
{The results are written to the outfile.}
writeln(outfile);
end;
close(infile);
close(outfile);
{The analyzed file and the file storing the results are closed.}
149
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
end;
Clrscr;
G o t o x y (10,5) ;
W r i t e ('Do Another? Y/N:
');
readln(another);
another
:= u p c a s e ( a n o t h e r ) ;
{The user is asked if they wish to enter another rootname.}
If not
((another =
'Y')
or
(another =
*N *))
the n
B eg i n
Rep e a t
Beg i n
Clrscr;
G o t o x y (10,5);
W r i t e ('Do you wish to do another?');
G o t o x y (10,6);
W r i t e ('Please respond with Y or N
: ') ;
Readln(another);
another
:= u p c a s e ( a n o t h e r ) ;
end;
Until
(Another = 'Y ’) or
(Another =
*N ');
{A check is used to ensure that the appropriate response was entered.}
end;
end;
until
(another = 'N')
or
(RootName =
'EXIT');
{The program repeats until the user doesn’t wish to do another or the user enters exit as a rootname.}
clrscr;
End.
150
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
151
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
References
1 Press, W.H.; Flannery, B.P.; Teukolsky, S.A.; Vetterling, W.T. Numerical Recipes in Pascal: The Art of
Scientific Computing. Cambridge University Press, 547-598 (1989).
152
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Appendix 3
Pascal Program Determining
Chromatographic Peak Area of
Optimized Langmuir Probe Data
153
of the copyright owner. Further reproduction prohibited without permission
Program CalcPeakArea;
{This program takes the files analyzed by Program ComboS.pas and determines the peak area for each
parameter and its’ standard error. The background and peak location are determined using the light signal
and derivative analysis. Those same locations are declared background and signal in the Langmuir probe
results. The background corrected peak area is calculated for each param eter.}
uses Crt,
Dos;
{The Crt command gives the program control over several PC as well as monitor features. The Dos
command allows the program to access DOS features.}
const
{This section defines constants that will be used by the program.}
n u m loops = 250;
{There are 251 I-V curves per input file.}
Type
h o l d s t u f f = array
[0..numloops]
of double;
{Each time used holdstuff creates an array with 251 columns and 21 rows. Each column will hold values
used for an entire I-V curve. }
H o l d _Data = ''holdstuff;
{Points to the array holdstuff, sort o f like a map.}
Var
Dirlnfo:
SearchRec;
InFileName,
RootName
txtln,
InFile,
Ch
OutFileName,
{ For Windows,
tempfilename
use T S e a r c h R e c
: A r r a y [0..100]
of String[15];
: String;
nmbr
: string;
outfile
}
: text;
: char;
154
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
OK,
again,
filetrbl
Another
: Char;
ChiSqr,
light,
II,
: char;
SDIl,
12,
FirstDerivative
: Hold_Data;
Pointl,
Point3,
Point2,
Find_topl,
Find_top2,
AreaChiSqr,
AreaSDI2,
count
Point4
Areall,
AreaSDC,
C,
SDC,
Te,
SDTe
: Hold_Data;
: double;
Find_top3
Arealight,
AreaC,
SDI2,
: double;
AreaSDIl,
AreaTe,
AreaI2
AreaSDTe
: double;
: double;
: integer;
posctr,
EndOfLine,
filecounter,
filecounter2
w hichfilecount
Peak_Start,
No_Peak_found
: integer;
: integer;
: Integer;
Peak_Top,
DataPtsOnLine,
delnum,
strct
Peak_width
errorc o d e
; integer;
: Integer;
: integer;
I : Integer;
Procedure FindPeakArea ( S i g n a l F i l e
Peak_Start,
: Hold_Data;
Peak_width:
integer;
Var Area
: double);
{This procedure calculates the background corrected peak area of the ‘SignalFile’ using the locations for
the start o f the peak and the peak width. The background is calculated by averaging the six data points
before the start o f the peak. If the peak starts before the seventh data point the background will be adjusted
accordingly. The raw area is summed. The background is expanded to cover the peak width before
subtracting from the raw area to give the background subtracted peak area.}
Var AvgBack,
AreaCount
RawArea
: double;
: integer;
Begin
RawArea := 0;
155
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Case Peak_Start of
{This case statement determines the background. It is designed to handle the instances when the peak
starts at the beginning o f the collection process in which there will be fewer than six data points for the
background as well as expected peak starting locations.}
2 : AvgBack := (SignaIFile/'[Peak_Start -2] + SignalFileA[Peak_Start -l])/2;
3 : AvgBack := (SignalFileA[Peak_Start -3] + SignalFiIeA[Peak_Start -2]
+ SignalFiIeA[Peak_Start -l])/3;
4 : AvgBack := (SignalFileA[Peak_Start - 4] + SignaIFileA[Peak_Start -3] +
SignalFiIeA[Peak_Start -2] + SignalFileA[Peak_Start-l])/4;
5 : AvgBack := (SignalFileA[Peak_Start - 5] + SignalFiIeA[Peak_Start - 4] +
SignalFileA[Peak_Start -3] + SignalFileA[Peak_Start -2] +
SignalFileA[Peak_Start -1]) / 5;
else
AvgBack := (SignalFileA[Peak_Start - 6] + SignalFileA[Peak_Start - 5] +
SignalFileA[Peak_Start - 4] + SignalFileA[Peak_Start -3 ] +
SignalFileA[Peak_Start -2] + SignalFileA[Peak_Start -1]) / 6;
end;
For AreaCount := Peak_Start to (P eakS tart + Peakw idth) do
RawArea := RawArea + SignalFileA[AreaCount];
{RawArea is the summation o f the points in the peak.}
Area := RawArea - (AvgBack * Peak_width);
{The Area is the RawArea minus the background which is adjusted for the width o f the peak.}
end;
Procedure getfilename;
156
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{This procedure is used to obtain all the filenames with a common root and then allow the user to select
those to be analyzed. This allows the user to analyze numerous files at one time without having the tedious
task o f entering each name.}
Begin
W i n d o w ( l , 1,80,25);
Textbackground(LightGray);
T e x t c o l o r ( W h i t e );
clrscr;
G o t o x y (20,5);
W rite( ' E n t e r Root Name
(EXIT to quit):
’);
{First a window is placed on the monitor and the rootname is requested. If exit is entered the program is
terminated.}
Repeat
{This repeat has the computer searching for all o f the files in the directory C:\lintemp\ that have the given
rootname.}
ReadLn(RootName);
clrscr;
for strct
:= 1 to Length(rootname)
rootname [strct]
Filecounter
do
:= U p C a s e ( r o o t n a m e [ s t r c t ] ) ;
:= 0;
F i n d F i r s t ('C :\ l i n t e m p \ '+ R o o t N a m e + '*.Prn', AnyFile,
DIR * . PAS
Dirlnfo);
{ Same as
}
{The rootname is modified so that only one directory will be read. Here it is assumed that the files have
been stored in a file folder named lintemp on the C drive. The Findfirst procedure is used to execute a
search for the first match. After the first call the FindNext procedure will be used. These are Pascal’s
equivalent to the DOS command ‘Dir *.pm’.}
while DosError = 0 do
begin
157
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
I n c (f i l e c o u n t e r ) ;
g o t o x y ( 2 5 * ( f i l e c o u n t e r d i v 20)
W r i t e ('
+1, (f i l ecounter m o d 20)
+ 1);
',f i l e c o u n t e r : 3 , ’--- ',D i r l n f o . N a m e ) ;
InFileName[Filecounter]
OutFileName[Filecoun t e r ]
:= Dirlnfo.Name;
:=
('A'
+ I n F i l e N a m e [ F i l e c o u n t e r ] );
{OutfileName is the file where the background corrected peak areas will be stored. It is systematically
named by adding a ‘A’ to the beginning o f the original file. This way the user can readily determine which
files have been analyzed by this program. Since the original name is also present, the user can readily
reference the conditions under which the data were collected.}
FindNext(Dirlnfo);
end;
{The first filename is read and the FindNext procedure is used to find the next file in the directory.}
If
(Filecounter = 0) Then
Begin
If not
(Rootname = 'EXIT')
Then
Begin
ClrScr;
G o t o x y (10,26) ;
W r i t e l n ( ' N o Files Found W ith This Rootname
',rootname);
W r i t e ('Please enter a n other Rootname Or Type
"EXIT" to Exit:
');
end;
end;
{If no files are found an error message is given. The user is given the chance to conduct another search.}
If F i l e c o u n t e r > 0 Then
Begin
g o t o x y (10,22) ;
W r i t e l n ('This
W r i t e l n (’
Is The List Of All Files With This
Are These Ok? Y/N:
Rootname
') ;
158
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
');
{The user is asked if the listed files are ok to analyze. If they are ok then they are analyzed. If they are not
acceptable the user is allowed to start over or delete unwanted files from the list to be searched.}
repeat
OK
:= u p c a s e ( r e a d k e y ) ;
until
(OK =
If OK =
'Y')
or
(OK =
'N');
'N' Then
Begin
W r i t e l n ( ' T o D E L E T E a File from analysis list Enter "D" or
to STAR T O V E R
Enter "S"
');
{The user is allowed to delete files or to start over.}
repeat
filetrbl
Until
:= u p c a s e ( r e a d k e y ) ;
(Filetrbl =
If filetrbl =
'S'
*D ') or
(Filetrbl = ’S ’);
then
Begin
again
:=
'Y ' ;
ClrScr;
W rite( ' E n t e r Root Name
(EXIT to quit):
');
end;
If Filetrbl =
'D'
then
Begin
again
:= 'N ';
Repeat
writeln;
w rite( ' E n t e r numb e r of the File NOT to be analyzed or 0 for
finished
');
{If the user wishes to delete file(s) from the list o f files to be analyzed, the user is allowed to enter a number
corresponding to a file not to be analyzed. This repeats until only files to be analyzed remain. The number
0 is reserved to determine when the user is finished deleting files.}
159
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Readln(delnum);
clrscr;
If Not
(DelNum = 0) then
Begin
For I := D E L N U M to Filecounter - 1 do
Begin
InFileName[ I ]
:= I n F i l e N a m e [1+1];
O u t F i l e N a m e [I ] := O u t F i l e N a m e [1+1];
end;
I n F i l e N a m e [Filecounter]
OutFileName[Filec o u n t e r ]
:= '';
:= '';
D e c (f i l e c o u n t e r ) ;
For Filecounter2
:= 1 to Filecounter do
Begin
g o t o x y (25*(file c o u n t e r 2 div 20)
W r i t e (f i l e c o u n t e r 2 :3, '
+ 1 , ( filecounter2 m o d 20)
1,i n f i l e n a m e [f i l e c o u n t e r 2 ]);
end;
end;
Until DelNum = 0;
end;
End;
end;
Until
((again =
(Rootname =
'N')
and(Fi l e c o u n t e r > 0 ) )
'EXIT')
Or
Or
(OK = 'Y');
W r i t e l n ('Press any key to Continue');
Repeat Until Keypressed;
Ch
:= Readkey;
{The program is paused before the analysis begins.}
end;
160
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
+ 1);
{This begins the main program.}
Repeat
{This repeat command allows the program to accept multiple rootnames.}
GetFileName;
{This procedure gets the name(s) o f the file(s) to be analyzed.}
For w h i c h f i l e c o u n t
:= 1 to filecounter do
begin
Assign
(Infile,
' C : \ l i n t e m p \ '+ i n f i l e n a m e [ w h i c h f i l e c o u n t ] )
R e S e t (I n F i l e ) ;
{A file is prepared to be analyzed.}
New(ChiSqr);
N e w (l i g h t );
New(II) ;
N e w ( S D I 1) ;
N e w (12);
N ew(SDI2);
New(C);
New(SDC);
New(Te) ;
New(SDTe);
N e w (F i r s t D e r i v a t i v e ) ;
{The arrays to hold the data are prepared.}
No_Peak_found
count
:= 0;
:= 0;
Repeat
{The repeat statement is used to cycle through the 251 data sets.}
Begin
161
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Readln(infile,txtln);
{A line o f text is read from the file. This line contains the values for ChiSqr, light, 11, SDI1,12, SDI2, C,
SDC, TE and SDTE for one point on the chromatogram. }
DataPtsOnLine
EndOfLine
posctr
:= 0;
:=length(txtln) ;
:= 1;
{The line is read into the program. The output o f the program Combo5 was numerical. When reading a
file containing the output o f Combo 5, Pascal thinks that the information is in the form o f strings. The next
few lines go over partitioning the string and then converting the partitions into the original numbers.}
While posctr <= EndOf L i n e do
Begin
nmbr
:= '’ ;
While not(txtln[posctr]
in
[
'
0
9
E
e
) do
i nc(p o s c t r ) ;
While
(txtln[posctr]
in
[ ' 0 9 1, 1
AND
1
E
'
e
(posctr <= l e n g t h ( t x t l n ) ) do
Begin
nmbr
:= nmbr + t x t l n [ p o s c t r ];
inc(posctr);
End;
{The line is a string and has to be partitioned.}
Inc(DataPtsOnLine) ;
Case DataPtsOnLine of
1 :
)
v a l ( n m b r , C h i S q r ~ [ c o u n t ] , ErrorCode);
2
: v a l ( n m b r , l i g h t A [ c o u n t ] , ErrorCode);
3
: v a l ( n m b r , I I * [ c o u n t ] , ErrorCode);
4
: v a l ( n m b r , S D I 1 " [ c o u n t ] , ErrorCode);
5
: v a l ( n m b r , 1 2 * [c o u n t ], ErrorCode);
162
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
6 :
v a l ( n m b r , S D I 2 " [ c o u n t ], ErrorCode);
7 :
val(nmbr,C"[count], ErrorCode);
8 :
v a l ( n m b r , S D C " [ c o u n t ], ErrorCode);
9 :
val(nmbr,Te"[count], ErrorCode);
10
:
v a l ( n m b r , S D T e " [ c o u n t ], ErrorCode);
end;
{The case statement uses the Val procedure o f pascal to convert the partitioned string into a number. The
position on the string is used to determine which variable the number is associated with.}
End;
inc(count);
end;
until count = numloops;
{This ends the repeat statement.}
close(infile);
{The input file is closed.}
count
:= 0;
Repeat
{This repeat statement is used to calculate the Savitsky-Golay 5 point smoothed first derivative o f the light
signal. The first derivative is a standard test for determining peak start and peak top locations. Briefly, the
peak start is signaled by four consecutive points with increasing positive first derivatives when compared to
the previous point. After the start o f a peak is identified the top is determined. This is determined by three
consecutive points with decreasing first derivative when compared to the previous point. All three points
must be less than 0. }
If
(count = 0) or
or
(count = 1) or
(count = numloops)
(count =
(numloops-1))
then
F irstDerivative"[count]
:= 0
else
F irstDerivative^[count]
:=
((-2 * light"[count - 2 ])
Reproduced with permission o f the copyright owner. Further reproduction prohibited without permission.
+
(-1 * light" [count - 1] ) +
(light''[count + 1])
+
(2 *
l i g h t " [ c o u n t + 2 ] ));
Inc(count);
until count = numloops;
count
:= 0;
Repeat
{This repeat loop is looking for the start of a peak by analyzing the first derivative of the light signal.}
i n c ( c o u n t );
pointl
:=
FirstDerivative"[count];
point2
:=
F i r s t D e r i v a t i v e " [ c o u n t + 1] ;
point3
:=
F i r s t D e r i v a t i v e " [ c o u n t + 2];
point4
:=
First D e r i v a t i v e " [ c o u n t + 3] ;
until
(pointl > 0) and
and
(point4
(point2 > pointl)
> point3)
or
(Count =
and
(point3 > point2)
(Numloops - 1))
;
{It will search through the file until 4 consecutive positive and increasing first derivatives are found to
signal the start of a peak.}
If count =
(Numloops - 1)
the n
{This ifstatement is used when there is no peak found. It informs the user of this condition.}
Begin
clrscr;
Repeat
Begin
Write ( ' N o
Peak Was Found on File
');
W r i t e l n ('"',infilename[whichfilecount] , ' " ’);
W r i t e l n ('Press any key to continue
');
end;
until Keypressed;
Ch
:= readkey;
164
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
No_Peak_found
:= 1;
end;
Peak_Start
:= count;
If N o _ P e a k _ f o u n d = 0 then
{If a peak was found the following lines execute.}
Begin
Repeat
{The program searches for the top o f the peak.}
inc(count);
Find_topl
:= F i r s t D e r i v a t i v e * [ c o u n t ] ;
Find_top2
:= F i r s t D e r i v a t i v e * [ c o u n t + 1] ;
Find_top3
:= F i r s t D e r i v a t i v e * [ c o u n t + 3];
until
(Find_topl < 0)
and
and
(Find_top2 < Find_topl)
(Find_top3 < F i n d _ t o p 2 ) ;
{The top o f the peak is the first o f three consecutive negative first derivatives that are decreasing in value.}
Peak_Top
:= count;
Peak_width
:=
(3'(Peak_Top - P e a k _ S t a r t ) ) ;
{The peak width is determined to be 3 times the distance from the start o f the peak to the top o f the peak.}
end;
{The following lines calculate the background corrected peak area for the indicated parameter using the
procedure FindPeakArea. For example the first call calculates the background corrected peak area o f the
Chi Squared chromatogram.}
FindPeakArea(ChiSqr,
FindPeakArea(light,
FindPeakArea(II,
Peak_Start,
Peak_Start,
FindPeakArea(SDI1,
F i n d P e a k A r e a (12,
Peak_Start,
FindPeakArea(SDI2,
Peak_width,
Peak_width,
Peak_Start,
Peak_Start,
Peak_width,
Peak Start,
Arealight);
Areall);
Peak_width,
Peak_width,
AreaChiSqr);
AreaSDIl);
AreaI2);
P e a k width,
AreaSDI2);
165
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
FindPeakArea(C,
Peak_Start,
FindPeakArea(SDC,
FindPeakArea(Te,
Peak_Start,
Peak_Start,
FindPeakArea(SDTe,
Assign
(Outfile,
Peak_width,
AreaC);
Peak_width,
Peak_width,
Peak_Start,
' C : \ l i n t e m p \ ’+
A r e a S D C );
AreaTe);
Peak_width,
AreaSDTe);
O u t f i l e n a m e [ w h i c h f i l e c o u n t ])
Rewrite(outfile);
{The file to store the results is prepared.}
Write(outfile,
A r e a C h i S q r : 14,
Write(outfile,
A r e a l i g h t : 14, 1
Write(outfile.
A r e a l l : 1 4 , 1,')
Write(outfile,
A r e a S D I l :14, ',
Write(outfile,
A r e a I 2 :1 4 , 1,')
Write(outfile,
A r e a S D I 2 :14, ',
Write(outfile,
A r e a C : 1 4 , ’, ’);
Write(outfile.
A r e a S D C :14,', '
Write(outfile,
A r e a T e : 14,', 1)
Write(outfile,
A r e a S D T e : 14, ’,
close(outfile)
/
{The results are written to the file to store the results and when finished the file is closed.}
Dispose(ChiSqr);
D i s p o s e (l i g h t );
Dispose(II);
Dispose(SDI1);
Dispose( 12} ;
Dispose(SDI2);
Dispose(C);
Dispose(SDC);
Dispose(Te);
Dispose(SDTe);
166
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
D i s p o s e (F i r s t D e r i v a t i v e ) ;
{The arrays that stored the data and first derivative are removed. This frees memory for use by the
program.}
end;
W r i t e('Do you wish to enter ano t h e r rootname? Y/N
: ');
Readln(Another);
{The user is asked if they wish to do another. The result is read and tested to ensure that the answer is
acceptable.}
A n other
If not
:= u p c a s e ( a n o t h e r ) ;
((another =
'Y')
or
(another =
'N')) then
Begin
Repeat
Begin
Clrscr;
G o t o x y (10,5);
W r i t e ( ' D o you wish to do another?');
G o t o x y (10,6);
W r i t e ('Please r e s p o n d with Y or N
: ') ;
Readln(another);
an other
:= u p c a s e ( a n o t h e r ) ;
end;
Until
(Another =
'Y ') or
(Another = 'N ') ;
end;
until A n o t h e r =
'N';
end.
{This ends the program.}
167
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Appendix 4
Pascal Program for Generating
Simulated Langmuir Probe Data
168
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
p r o g r a m testrandomnumber;
{This program will simulate Langmuir probe current-voltage data similar to that collected in the Microwave
Induced Plasma Langmuir probe experiments. The relationship between current and voltage for Langmuir
probe studies is given in Equation 1. A set o f realistic voltages are selected from a randomly chosen file of
actual data. These are combined with a set o f similarly chosen parameters (C, Te, I^x and Inn) and are used
to solve for the corresponding current.
Icalc
=
Lnax - (imax - Lnm) /
[l + C * Exp(l 1604.43 *
Vapp /
Te)]
Equation 1
I ^ c : simulates the measured current
Inu, : the maximum current the curve would obtain
Inin: the minimum current the curve would obtain
C : a constant made up o f several terms
Te : the electron temperature (k)
Vw : the applied voltage
The user can choose to have noise added to the simulated current-voltage curve which is done using
Equation 2. The computer generates 1000 random numbers each between 0 and 1. These numbers are
summed. The result o f the summation (if repeated numerous times) will be a normal distribution about 500.
An individual run’s summation could be above or below 500 and the amount it differs would vary
randomly. 500 is subtracted from the summation to center it around 0. This process will be used to
determine the noise to be added to the current. The term SD*„/SDgot sets the scale for the noise and
assures that the standard deviation o f the noise is a reasonable approximation o f a real experiment.
169
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
1000
£
r
#G )
-5 0 0
Equation 2
Inoue : the simulated current with noise added
Idc : calculated current from equation 1
SDwm,: the desired standard deviation o f I„oise
i : used as a counter
R# : computer generated random number (value between 0 and 1)
S D got: the standard deviation obtained when sum of 1000 random numbers (value between 0 and 1) were
centered around 0.
The simulated spectrum will by default be saved on the A drive. The user can specify the name of the file
and alter the default directory if so desired.}
uses Crt;
{This line gives the program control over such PC features as internal speakers, keyboard codes and
monitor features like color, windows and screen m ode.}
Const
{This section defines constants that will be used by the program.}
numloops = 250;
{Actually add 1 to this number)
{“numl o o p s ” is one less than the number o f individual I-V curves that will be generated per output file. }
Varray
: array[0..20]
of Double =
{-10.26674,
-7.13679,
-6.07315,
-1.92834,
-0.86121,
3.28447,
4.35421,
-5.0609,
-9.2362,
-8.19347,
-3.99987,
-2.9763
0.18762,
1.24604,
2.24435
5.4344,
6.45013,
7.492
170
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
8.53212,
9.56963,
10.66376);
{Varray is an array, or group o f numbers, that will be used as V.^, in equation 1 to generate the simulated IV curves. It will be saved in the output file to allow the optimization program to w ork.}
Imax
=
3.2e-5;
Imin
= -9.5e-5;
c
=
5.0;
Te
=
2.4e+4;
{The above four parameters are all used by Equation 1 in generating the simulated data. For the equation
they are constants. The values come from an actual data set and so the simulated data will accurately
approximate that of a real experiment.}
sdgot = 9.065785;
{Used as SDgot in equation 2. If the random number summation is repeated numerous times this is the
resulting standard deviation.}
sdwant =2.0e-6;
{Used as S D ^ , in equation 2. This is the experimentally determined standard deviation o f a current
reading.}
Type
h o l d s t u f f = array
[0..numloops, 0..20]
of real;
{Each time used holdstuff creates an array with 251 columns and 21 rows. Each column will hold values
used for an entire I-V curve. }
h o l d _ d a t a = "holdstuff;
{Points to the array holdstuff, sort o f like a map.}
var
{This section defines variables that will be used by the program.}
i, v p t n u m
: integer;
171
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
{The variable I is used to count and vptnum is used to define the present location in a 21 point I-V curve.}
countup,
init n u m
: real;
{These are used to store and add up the initial random numbers}
ch,
answer,
doublecheck
: char;
{These are used as buffers to read single keystrokes in answer to yes/no questions.}
outfile
: text;
{This holds the name o f the file where the simulated data will be stored, it’s directory and extension.}
filename,
filenamel
: string;
{These are used to determine outfile above.}
calcl
: hold_data;
{CalcI is an array used to hold the calculated currents final value before being saved in outfile.}
curvenum
: integer;
{Curvenum is used to determine which o f the 251 curves the program is presently being accessed.}
WantNoise
: char;
{WantNoise is used to determine if the user wishes to have noise added to the resultant current values.}
Rand n u m
: real;
{Randnum is used to temporarily store the noise that will be added to a calculated current, only used if the
user wishes noise added to the simulated data. }
Itemp
: real;
{If the user wishes noise added to the signal, Itemp stores the current calculated by Equation 1. }
begin
{This starts the main body of the program.}
clrscr;
{This clears the screen.}
New(Calcl);
{New is used to initialize Calcl which is allocated on the heap.}
172
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
w r i t e ( ' D o you wish noise to be included in the results? Y/N:
');
readln(WantNoise};
WantNoise
:= u p c a s e ( W a n t N o i s e ) ;
{These lines determine if the user wishes noise in the final results.}
case W a n t N o i s e of
{The case statement handles the results to the question o f adding noise to the curve.}
'N'
: Begin
{If WantNoise is ‘N ’ this begin statement executes. No noise is added to the resulting simulated data.}
for curv e n u m
:= 0 to numloops do
{This for statement will create 251 I-V curves.}
beg i n
FOR vpt n u m
:= 0 T O 20 DO
{This for statement will generate a 21 point I-V curve.}
c a l c l ^ [curven u m , v p t n u m ]
:=
I m a x - (I m a x - I m i n ) / ( l + C * E x p (11604.4 3 * V a r r a y [ v p t n u m ] / T e ) );
{This is Equation I and calculates the current corresponding to the given voltage.}
end;
end;
{Ends the case o f wantnoise o f ‘N ’.}
'Y'
: Begin
{If WantNoise is ‘Y’ this begin statement executes. Noise is added to the resulting data.}
for curve n u m
:= 0 to numloops do
{This for statement will create 251 I-V curves.}
beg i n
FOR vptnum
:= 0 TO 20 DO
{This for statement will generate a 21 point I-V curve.}
173
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Begin
Randomize;
{This initializes the random number generator of Pascal. It will generate evenly distributed numbers
between 0 and 1.}
countup
:= 0;
initnum
:= 0;
For i := 1 to 1000 do
Begin
initnum
:= random;
countup
:= countup + initnum;
end;
randnum
:= s d w a n t * ( c o u n t u p - 50 0 ) /sdgot;
{In the above lines the evenly distributed random numbers generated by Pascal are converted into a usable
normal distribution. First 1000 o f the random numbers are added up and 500 is subtracted from the sum. If
this process were repeated enough times the average result would be a normal distribution centered around
0 with a standard deviation o f SDgo,. The term randnum is generated by dividing the ‘0 centered number’
by it’s standard deviation and multiplying the result by the desired standard deviation o f the noise. This
generates normally distributed noise with the desired magnitude and standard deviation to model how
expected noise will effect the results o f an experiment}
Itemp
:= Imax-(ImaxI m i n ) / ( l + C * E x p (11604 .4 3 * V a r r a y [v p t n u m ] / T e ) ) ;
{The term Itemp is used to temporarily store the result o f Equation 1 before noise is added to it.}
calcl'’[curvenum, vptnum]
:= Itemp + randnum;
{This line adds the noise to the current value to give the simulated current value with noise.}
end;
{This ends the ‘for’ statement that generates a 21 point I-V curve }
end;
174
permission of the copyright owner. Further reproduction prohibited without permission.
{This ends the ‘for’ statement that generates 251 I-V curves.}
end;
{This ends the case of WantNoise o f ‘Y’.}
else
begin
w r i t e l n ('please answer with "Y" or " N " ');
end;
{This section makes sure that the response to the question about adding noise is yes or no.}
end;
{This ends the case statement.}
Repeat
{This repeat is used in checking to see if the user wishes to save the simulated data. The user has to
respond appropriately once to save the file and twice, as a double check, if they decide that they don’t want
the file saved. }
w r i t e ( ' s a v e file? y/n:
');
r e a d l n (a n s w e r );
answer
:= u p c a s e ( a n s w e r );
{Asks if the file should be saved.}
case a n s w e r of
'Y'
: Begin
{If answer is ‘Y’ then the file will be saved.}
w r i t e l n ('Ent e r Filename');
w r i t e l n ('D efault Path A:');
w r i t e ('Default Extension
.PRN:
');
{The user is asked to enter the name under which to save the file. The default location to save the file is the
A drive. The default extension is .pm.}
r e a d l n (F i l e n a m e l );
filename
:= filenamel;
175
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
If P o s (':',F i l e n a m e ) = 0 then
Filename
:= 'A:'
+ Filename;
If P o s F i l e n a m e )
Filename
= 0 then
:= F i l e n a m e +
'.pm';
{These lines default the drive to A: and the extension to .pm, unless the user enters a drive and/or an
extension.}
Assign(Outfile,
Filename);
Rewrite(Outfile);
{This is used to create the file that the data where the data will be saved.}
Writeln(Outfile,
Filenamel,'"');
writeln(outfile);
writeln(outfile);
writeln(outfile);
WRITE(OUTFILE,'LIGHT
INT
' );
WRITE(OUTFILE,'VOLTAGE
');
WRITELN(OUTFILE, 'CURRENT
');
{The above lines are used to format the beginning o f the file so that it will match those files collected by
Testl5.pas the data collection program .}
for curvenum := 0 to n u m l o o p s do
{This is used to cycle through the 251 I-V curves.}
begin
FOR vptnum
:= 0 T O 20 DO
{This is used to cycle through the 21 data points on an I-V curve.}
begin
WRITE(OUTFILE, (1.1*2) :13:7, '
’ );
{This line generates a number located where the light data would appear.}
W R I T E ( O U T F I L E , V a r r a y [ v p t n u m ] :13 :5, ’
') ;
{This line writes the voltage to the expected location in the data storage file.}
176
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
WRITELN(OUTFILE, calcl"[curvenum, v p t n u m ! :13 :10, ’
':;
{This line writes the calculated current to the expected location in the data storage file.}
end;
end;
WriteLn(OutFile) ;
close(outfile);
{This closes the file where the data was written.}
end;
'N'
: Begin
{If answer is ‘N ’ then the file will not be saved. The following lines double check to ensure that the user
wishes to discard the file.}
writeln('the
w r i t e ( ’Ar e
file will not be saved');
you sure that you wish to d i s c a r d the file? Y/N
’);
readln(doublecheck) ;
doublecheck
:= u p c a s e ( d o u b l e c h e c k ) ;
End;
{This is the end for the case o f answer o f ‘N’.}
else
begin
{This is used to ensure that the user has entered ‘Y’ or ‘N ’ in response to the question o f saving the file.}
w r i t e l n ('p l e a s e answer w i t h "Y" or " N " ');
end;
{This ends the else statement.}
end;
{This ends the case statement.}
until
(answer =
'Y ') or
((answer =
'N')
and
(doublecheck = 'Y '));
D i s p o s e ( C a l c l );
{This disposes o f the space on the heap allocated by the ‘new’ line above.}
177
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
end.
{This is used to end the program.}
178
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Документ
Категория
Без категории
Просмотров
0
Размер файла
5 078 Кб
Теги
sdewsdweddes
1/--страниц
Пожаловаться на содержимое документа