sddsinteg

**description:**`sddsinteg`integrates one or more columns of data as a function of a common column. The program will perform error propagation if error bars are provided in the data set.**examples:**Find the integral for APS lattices`sddsinteg APS.twi APS.integ -integrate=etax -versus=s`**synopsis:**`sddsinteg [-pipe=[input][,output]] [`*input*] [*output*] -integrate=*columnName*[,*sigmaName*] ... -versus=*columnName*[,*sigmaName*] [-mainTemplates=*item*=*string*[,...]] [-errorTemplates=*item*=*string*[,...]] [-method=*methodName*] [-printFinal[=bare][,stdout]]**files:***input*is an SDDS file containing columns of data to be integrated. If it contains multiple data pages, each is treated separately. The independent quantity along with the requested integrals is placed in columns in*output*. By default, the integral column name is constructed by appending ``Integ'' to the variable column name. If applicable, the column name for the integral error is constructed by appending ``IntegSigma''.**switches:**`-pipe[=input][,output]`-- The standard SDDS Toolkit pipe option.`-integrate=`-- Specifies the name of a column to integrate, and optionally the name of the column containing the error in the integrand. May be given any number of times.*columnName*[,*sigmaName*]`-versus=`-- Specifies the name of the independent variable column, and optinally the name of the column containing its error.*columnName*[,*sigmaName*]`-mainTemplates=`-- Specifies template strings for names and definition entries for the integral columns in the output file.*item*=*string*[,...]*item*may be one of`name`,`description`,`symbol`. The symbols ``%x'' and ``%y'' are used to represent the independent variable name and the name of the integrand, respectively.`-errorTemplates=`-- Specifies template strings for names and definition entries for the integral error columns in the output file.*item*=*string*[,...]*item*may be one of`name`,`description`, the independent variable name and the name of the integrand, respectively.`-method=`-- Specifies the integration method. The default method is ``trapazoid,'' for trapizoid rule integration. Another method is ``GillMiller,'' which is based on cubic interpolation and is much more accurate than trapazoid rule; unlike most higher-order formulae, it is not restricted to equispaced points. (See P.E. Gill and G. F. Miller, The Computer Journal, Vol. 15, N. 1, 80-83, 1972.) Error propagation is available for trapazoid rule integration only. If higher-order integration is needed, one can first interpolate the data with reduced spacing of the independent variable using*methodName*`sddsinterp`with the`-equispaced`option and`-order=2`or higher, then integrate using`sddsinteg`. This is mathematically equivalent to using a higher-order formula, but is more general as it is not restricted to initially equispaced data. However, using Gill-Miller is probably the best approach.`-printFinal[=bare][,stdout]`-- Specifies that the final value of each integral should be printed out. By default, the printout goes to stderr and includes the name of the integral. If`bare`is given, the names are omitted. If`stdout`is given, the printout goes to stdout.

**see also:**- sddsderiv
`sddsderiv`()sddsderiv - sddsinterp
`sddsinterp`()sddsinterp

- sddsderiv
**author:**M. Borland, ANL/APS.