optimization of the speed dependent line shape calculation kendra l. letchworth and d. chris benner...

30
Optimization of the Optimization of the Speed Dependent Line Speed Dependent Line Shape Calculation Shape Calculation Kendra L. Letchworth and D. Chris Kendra L. Letchworth and D. Chris Benner Benner Molecular Spectroscopy Symposium Molecular Spectroscopy Symposium June 19, 2007 June 19, 2007

Upload: lisa-hines

Post on 28-Dec-2015

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Optimization of the Speed Optimization of the Speed Dependent Line Shape Dependent Line Shape

CalculationCalculationKendra L. Letchworth and D. Chris BennerKendra L. Letchworth and D. Chris Benner

Molecular Spectroscopy SymposiumMolecular Spectroscopy SymposiumJune 19, 2007June 19, 2007

Page 2: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

OverviewOverview• Spectra with higher signal to noise ratios and more Spectra with higher signal to noise ratios and more

powerful analysis techniques have created a need powerful analysis techniques have created a need for more accurate line shape models.for more accurate line shape models.

• Fitting programs and simulations often perform Fitting programs and simulations often perform billions of calculations, so routines to calculate line billions of calculations, so routines to calculate line shapes must also be fast.shapes must also be fast.

• The Voigt Profile is no longer a sufficient model.The Voigt Profile is no longer a sufficient model.• Our routine calculates the speed dependent profile Our routine calculates the speed dependent profile

to a relative accuracy of 10to a relative accuracy of 10-5-5, with only a few , with only a few exceptions.exceptions.

• An order of magnitude more accurate than Voigt An order of magnitude more accurate than Voigt calculation routines such as Drayson & Humlcalculation routines such as Drayson & Humlíčíček.ek.

• However, it will require approximately the same However, it will require approximately the same amount of calculation time as those same routines.amount of calculation time as those same routines.

Page 3: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

The Voigt ProfileThe Voigt Profile

dttxy

tyyxK

Dv

22

2

2/3 )(

)exp()2ln(),(

Dvvx /)()2ln( 0 DLy /)2ln(

• v - vv - v0 0 : distance from line center: distance from line center• ααL L : Lorentz half-width: Lorentz half-width• ααD D : Doppler half-width: Doppler half-width

A line shape combining the Doppler line shape due to thermal A line shape combining the Doppler line shape due to thermal motion and the Lorentz line shape due to collisions motion and the Lorentz line shape due to collisions

between molecules. between molecules.

Page 4: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Previous work on the Voigt FunctionPrevious work on the Voigt Function

• Calculates the Voigt Function to a relative accuracy Calculates the Voigt Function to a relative accuracy of 10of 10-6-6

• Returns derivatives of the real and imaginary parts Returns derivatives of the real and imaginary parts of the function with respect to the parameters x and of the function with respect to the parameters x and y to an accuracy of 0.5%y to an accuracy of 0.5%

• Provides a speed increase of a factor of 4-18 over Provides a speed increase of a factor of 4-18 over the published versions of common Voigt routines the published versions of common Voigt routines such as Drayson and Humlsuch as Drayson and Humlíčíček.ek.

• Smooth interpolation down to Doppler limit (small y) Smooth interpolation down to Doppler limit (small y) provides accuracy when many other routines fail provides accuracy when many other routines fail

• Many of the same techniques used for the Voigt Many of the same techniques used for the Voigt function will be employed to calculate the speed function will be employed to calculate the speed dependent line shape dependent line shape

Page 5: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

What is the speed dependent effect?What is the speed dependent effect?

• The Lorentz portion of the Voigt profile assumes The Lorentz portion of the Voigt profile assumes that all collisions occur at the average velocity.that all collisions occur at the average velocity.

• Molecules actually have a distribution of speeds.Molecules actually have a distribution of speeds.

• The Lorentz width The Lorentz width ααLL must be modified to must be modified to

become dependent on velocity v, thus y become dependent on velocity v, thus y becomes y(v).becomes y(v).

• Only beginning to be observed in spectra, but as Only beginning to be observed in spectra, but as technology increases and analysis routines technology increases and analysis routines become more powerful, so will the need for become more powerful, so will the need for speed dependent routines.speed dependent routines.

Page 6: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Analysis ofAnalysis of 12 12CC1616OO2 2 spectra using LABFIT, a multispectrum fitting program.spectra using LABFIT, a multispectrum fitting program.

Page 7: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy
Page 8: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Typical values of the speed dependent parameter STypical values of the speed dependent parameter S

Larger values of S become increasingly unphysicalLarger values of S become increasingly unphysical because they cause the Lorentz width to becomebecause they cause the Lorentz width to become extremely sensitive to small changes in velocity extremely sensitive to small changes in velocity

Values of S for Values of S for 1212CC1616OO22 spectra. spectra.

Page 9: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Toronto’s calculation algorithmToronto’s calculation algorithm• 1717thth order numerical integration technique involving equally order numerical integration technique involving equally

spaced points and equal weights.spaced points and equal weights.

• Order n=17, point spacing Order n=17, point spacing ΔΔ=0.5, initial point v=0.5, initial point v00=-4.0=-4.0

• Successfully used to fit COSuccessfully used to fit CO2 2 spectra by our laboratory.spectra by our laboratory.

• Inaccurate for small values of x and y since function can no Inaccurate for small values of x and y since function can no longer be estimated as a polynomial.longer be estimated as a polynomial.

• Inefficient because it calculates the exponential, arctangent, Inefficient because it calculates the exponential, arctangent, and logarithm for every point. and logarithm for every point.

Page 10: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Mathematical Approximations: Mathematical Approximations: Gauss-Hermite QuadratureGauss-Hermite Quadrature

n

iii

v vfwdvvfe1

)()(2

Quadrature Points - Quadrature Points - vviiQuadrature Weights - Quadrature Weights - wwii

Expression simplified using:Expression simplified using:• SymmetrySymmetry• Odd-order quadratureOdd-order quadrature

An approximationAn approximation designed to calculate integrals including exp(-vdesigned to calculate integrals including exp(-v22))

Page 11: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Quadrature and Elementary Function ExpansionsQuadrature and Elementary Function Expansions

• Simplifying the function to optimize for quadrature using:Simplifying the function to optimize for quadrature using:

• Yields for real part:Yields for real part:

• And for imaginary part: And for imaginary part:

Page 12: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

• Expansion of arctangent for the real part of the function |z| <1.Expansion of arctangent for the real part of the function |z| <1.

• Expansion of logarithm for the imaginary part of the function |q|Expansion of logarithm for the imaginary part of the function |q|<1.<1.

• Other expansions are used for different values of z and q.Other expansions are used for different values of z and q.• Approximation routines calculate the elementary functions to an Approximation routines calculate the elementary functions to an

accuracy of 10accuracy of 10-6 -6 over the entire domain of the functions.over the entire domain of the functions.• Implementing these expansions with quadrature is still Implementing these expansions with quadrature is still

inefficient compared to Voigt routines and provides inefficient compared to Voigt routines and provides unpredictable accuracy. unpredictable accuracy.

Expansion of Elementary FunctionsExpansion of Elementary Functions

Page 13: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

• Integration by parts is advantageous because the first term Integration by parts is advantageous because the first term vanishes due to the exp(-vvanishes due to the exp(-v22) evaluated from negative infinity ) evaluated from negative infinity to infinity.to infinity.

• Eliminates elementary functions and provides predictable Eliminates elementary functions and provides predictable

patterns for determining quadrature regions.patterns for determining quadrature regions.

Integration by Parts and QuadratureIntegration by Parts and Quadrature

Page 14: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Schematic of regions in which various orders of quadrature are effectiveSchematic of regions in which various orders of quadrature are effective for various values of S and all values of H. for various values of S and all values of H.

Page 15: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Interpolation MethodsInterpolation Methods• Must be used when the function f(v) no longer behaves Must be used when the function f(v) no longer behaves

like a polynomial.like a polynomial.• Small Small xx and small and small yy..• To interpolate in To interpolate in xx, , yy, and , and SS requires 24 MB of memory requires 24 MB of memory

for interpolation tables.for interpolation tables.• To create interpolation tables which include To create interpolation tables which include HH would would

increase the required memory by an order of magnitude.increase the required memory by an order of magnitude.• Since this would be prohibitively large for some current Since this would be prohibitively large for some current

computers, interpolation is restricted to the computers, interpolation is restricted to the HH=0 case. =0 case. • Since observing Dicke narrowing requires extremely high Since observing Dicke narrowing requires extremely high

resolution spectra, resolution spectra, HH=0 is adequate for most cases.=0 is adequate for most cases.• Though the error requirement is not met, cases for Though the error requirement is not met, cases for

nonzero H can still be modeled effectively using nonzero H can still be modeled effectively using quadrature, choosing 17quadrature, choosing 17thth order quadrature for the areas order quadrature for the areas where interpolation would be necessary. where interpolation would be necessary.

Page 16: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Mathematical Approximations: Mathematical Approximations: Taylor Series ExpansionTaylor Series Expansion

• Uses table of pre-computed values of the complex Voigt Uses table of pre-computed values of the complex Voigt function (K+function (K+iiL) and its derivatives.L) and its derivatives.

• Evaluation formula for real part Evaluation formula for real part (2(2ndnd order Taylor expansion) order Taylor expansion)

• etcetc. . stored in interpolation tablestored in interpolation table

• ΔΔx=x-xx=x-x00, , ΔΔy=y-yy=y-y0,0,ΔΔS=S-SS=S-S00,, where (xwhere (x00,y,y00,S,S00) is the closest ) is the closest gridpoint.gridpoint.

Page 17: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Taylor Series ExpansionTaylor Series Expansion

• A third order approximation is used to calculate both the A third order approximation is used to calculate both the real and imaginary parts of the speed dependent function real and imaginary parts of the speed dependent function for all cases where Taylor series expansion is used.for all cases where Taylor series expansion is used.

• Requires the storage of the values of the real and Requires the storage of the values of the real and imaginary functions and 38 derivatives at each gridpoint.imaginary functions and 38 derivatives at each gridpoint.

• It was hoped that relationships between the derivatives It was hoped that relationships between the derivatives would simplify this calculation as with the Voigt profile, but would simplify this calculation as with the Voigt profile, but this was not the case.this was not the case.

• Gridpoint spacing of 0.02, 0.05, and 0.1 in Gridpoint spacing of 0.02, 0.05, and 0.1 in xx and and y y is used is used for various regions of the for various regions of the xx--yy plane. plane.

• Gridpoint spacing of 0.03 in S is always used. Gridpoint spacing of 0.03 in S is always used.

Page 18: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Mathematical Approximations:Mathematical Approximations:Lagrange Interpolating PolynomialsLagrange Interpolating Polynomials

• Used only in very small areas when other methods fail.Used only in very small areas when other methods fail.• Employs equal grid point spacing. Employs equal grid point spacing. • dx=0.005, dy=0.005, dS=0.01.dx=0.005, dy=0.005, dS=0.01.• 22ndnd order polynomial order polynomial P(a) P(a) as shown belowas shown below is employedis employed..

• aa11, a, a22, a, a33 are the three grid points and are the three grid points and ∆a=(a- a∆a=(a- a22)/da.)/da.

• a=x,y,Sa=x,y,S

n

j

n

jkk kj

kj aa

aaaPaP

1 ,1

)()(

))(2)()((2

1))()((

2

1)()( 213

2132 aPaPaPaaPaPaaPaP

Page 19: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Lagrange Polynomial InterpolationLagrange Polynomial Interpolation

13 polynomial interpolations are required for one 13 polynomial interpolations are required for one spline interpolation of real or imaginary part.spline interpolation of real or imaginary part.

•9 interpolations in x.9 interpolations in x.(black dotted lines)(black dotted lines)

•3 interpolations in y.3 interpolations in y.(blue dotted lines)(blue dotted lines)

•1 interpolation in S.1 interpolation in S.(red dotted line)(red dotted line)

Page 20: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Maximum Error 7x10-4 Maximum Error 1.5x10-2

How bad do some routines get at small y?How bad do some routines get at small y?

Advantage to using interpolationAdvantage to using interpolation

Page 21: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Displays regions where Taylor series expansion and Lagrange Displays regions where Taylor series expansion and Lagrange polynomial interpolations are used, as well as polynomial interpolations are used, as well as

the gridpoint spacing for the Taylor series expansion.the gridpoint spacing for the Taylor series expansion.

Page 22: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Programming TechniquesProgramming Techniques

• Calculates the function for an entire spectral line at one Calculates the function for an entire spectral line at one time, removing unnecessary subroutine calls.time, removing unnecessary subroutine calls.

• Each parameter involving y, S and H is calculated only Each parameter involving y, S and H is calculated only once per spectral line, saving calculation time. once per spectral line, saving calculation time.

• To do this we require equal spacing in wavenumber; a To do this we require equal spacing in wavenumber; a version of the routine called for individual points will be version of the routine called for individual points will be available, but not as time efficient. available, but not as time efficient.

• Store intermediate variables to decrease number of floating Store intermediate variables to decrease number of floating point operations.point operations.

• The logical structure for determining the order of The logical structure for determining the order of quadrature or interpolation also only called once per line. quadrature or interpolation also only called once per line.

• Interpolation tables stored as binary files on the hard drive Interpolation tables stored as binary files on the hard drive and read in to working memory only when needed.and read in to working memory only when needed.

• Data in interpolation tables as well as commonly used Data in interpolation tables as well as commonly used variables are stored in modules.variables are stored in modules.

Page 23: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Time Trials for 10Time Trials for 108 8 calculations for calculations for each order of quadratureeach order of quadrature

•The most efficient speed dependent routine employsThe most efficient speed dependent routine employs quadrature and integration by parts rather than quadrature andquadrature and integration by parts rather than quadrature and Taylor series expansion of transcendental functions.Taylor series expansion of transcendental functions.•The optimal speed dependent routine takes 2.5 to 3 times The optimal speed dependent routine takes 2.5 to 3 times longer to calculate than the Voigt function using longer to calculate than the Voigt function using Letchworth & Benner for a given region of quadrature.Letchworth & Benner for a given region of quadrature.•Still competitive with other common Voigt routines which areStill competitive with other common Voigt routines which are 4 to 18 times slower than Letchworth & Benner. 4 to 18 times slower than Letchworth & Benner.

Page 24: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Time Trials including logical structures Time Trials including logical structures and interpolation regionsand interpolation regions

• Shows results for, equally spaced points 0<x,y<100.Shows results for, equally spaced points 0<x,y<100.• Our algorithm still much better than Toronto algorithm.Our algorithm still much better than Toronto algorithm.• Further improvements (by ~2-3 s) will occur when Further improvements (by ~2-3 s) will occur when

extraneous subroutine calls are eliminated from the extraneous subroutine calls are eliminated from the speed dependent algorithm. speed dependent algorithm.

Page 25: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Relative error for most Relative error for most used region of calculationused region of calculation

0.1<S<0.160.1<S<0.16

Error remains lessError remains less than 10than 10-5-5..

Page 26: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

AAccuracy ComparisonsAccuracy Comparisons

Base 10 logarithm of the relative error in the speed dependentBase 10 logarithm of the relative error in the speed dependent calculation with S=0.09999 using our algorithm.calculation with S=0.09999 using our algorithm.

Page 27: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Base 10 logarithm of the relative error in the speed dependentBase 10 logarithm of the relative error in the speed dependent calculation with S=0.09999 using the Toronto algorithm.calculation with S=0.09999 using the Toronto algorithm.

This calculation has relative error as poor as 20%.This calculation has relative error as poor as 20%.

Page 28: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

Future PlansFuture Plans• Create final routine which does not call Create final routine which does not call

multiple subroutines and remove extraneous multiple subroutines and remove extraneous code.code.

• Investigate relationship of the speed Investigate relationship of the speed dependent parameter to the temperature dependent parameter to the temperature dependence of the halfwidth.dependence of the halfwidth.

• Explore possibilities for pressure shift and Explore possibilities for pressure shift and Dicke narrowing in the interpolation region, Dicke narrowing in the interpolation region, including storing the difference between the including storing the difference between the Voigt function and the model to be Voigt function and the model to be calculated to decrease the gridpoint spacing calculated to decrease the gridpoint spacing in interpolation tables.in interpolation tables.

Page 29: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

• Our speed dependent routine provides accuracy Our speed dependent routine provides accuracy without losing timewithout losing time

• Includes the imaginary part of the function for Includes the imaginary part of the function for applications to line-mixingapplications to line-mixing

• Comparable in time to Voigt routines such as Comparable in time to Voigt routines such as Drayson & HumlDrayson & Humlíčíček.ek.

• The accuracy provided by this routine is The accuracy provided by this routine is becoming necessary as spectra become better.becoming necessary as spectra become better.

• The choice to optimize the speed dependent The choice to optimize the speed dependent calculation over the entire x-y plane makes it calculation over the entire x-y plane makes it suitable to many different applications suitable to many different applications

ConclusionsConclusions

Page 30: Optimization of the Speed Dependent Line Shape Calculation Kendra L. Letchworth and D. Chris Benner Molecular Spectroscopy Symposium Molecular Spectroscopy

AcknowledgementsAcknowledgements

Thank you to:Thank you to:

• Adriana Predoi-Cross at the University of Adriana Predoi-Cross at the University of Lethbridge for providing the Toronto Lethbridge for providing the Toronto algorithm code.algorithm code.

• Alan Pine for his extremely helpful Alan Pine for his extremely helpful documentation on speed dependence.documentation on speed dependence.

• This work was partially supported by This work was partially supported by National Science Foundation Grant No. National Science Foundation Grant No. ATM-0338475.ATM-0338475.