Integrating frequencydependent data with scuffintegrate
Many application codes in the scuffem suite compute physical quantities defined by definite integrals over real or imaginary frequencies, with the numerical value of the integrand at each point obtained by solving individual scuffem scattering problems at that frequency. For example,
 scuffcas3d and scuffcaspol compute zerotemperature Casimir quantities by integrating contributions from imaginary frequencies :
Here is a zerotemperature Casimir energy/force/torque (scuffcas3d) or CasimirPolder potential (scuffcaspol) and is the spectral density of contributions to from fluctuations at imaginary frequency , which may be obtained by solving scuffem scattering calculations at imaginary frequency .
 scuffneq computes the total rate of energy or momentum transfer from a source body to a destination body by integrating contributions from real frequencies :
Here is the contribution of body to quantity (a heattransfer rate, force, or torque) for body , is the BoseEinstein statistical factor, and are the temperatures of the source body and the environment, and is a "generalized flux" quantity that may be computed by solving scuffem scattering calculations at frequency .
The integrals over and are evaluated by numerical cubaturethat is, as weighted sums of integrand samples. In a perfect world, it would be possible for scuffem application codes to choose appropriate integration strategies automatically, hiding these details from the user and reporting just the frequencyintegrated quantities . This is in fact the strategy that was adopted in early incarnations of the scuffem codes.
In the real world, however, the behavior of integrand functions like and varies widely from problem to problem, depending on factors such as the shapes and materials of bodies in the scattering geometry and the quantity being computed. For this reason, it's hard for scuffem to make intelligent automatic choices of integration strategies, and attempts to do so without user input may result in misleading or even flatout incorrect data.
For this reason, the modern approach to frequency integration
in scuffem is to ask users to define a
list of frequencies at which to sample the integrand; this
list is passed to scuffem application codes using the
XiFile
or OmegaFile
commandline options, and in
response the code produces an output file reporting values
of the integrand at the specified points. The frequency
integral may then be calculated as as postprocessing step
using the information reported in the frequencyresolved
data files, and this is the task for which scuffintegrate
exists.
scuffintegrate tutorial walkthrough
Integrating a single function of frequency
The simplest usage of scuffintegrate is to integrate
a single function of frequency
[where denotes either real or imaginary frequency].
Suppose we have a file called fData
in which
are tabulated numerical pairs , ,
where :
x1 f1
x2 f2
...
xN fN
Then to compute we can just go like this:
% scuffintegrate datafile fData freqColumn 1 dataColumn 2
This will produce a file named fData.Integrated
containing
a single line of data: the integrated value of .
If the frequency and/or integrand values are printed in
different columns of the data file, just adjust the
freqColumn
and dataColumn
options accordingly. For
example, if the data file looks like this:
<stuff> <stuff> x1 <stuff> <stuff> f1 <stuff> ...
<stuff> <stuff> x2 <stuff> <stuff> f2 <stuff> ...
...
<stuff> <stuff> xN <stuff> <stuff> fN <stuff> ...
you would use freqcolumn 3 datacolumn 6.
In this case, the content of the other columns (the <stuff>
in the above snippet) is ignored.
Integrating multiple functions of frequency
More generally, frequencyresolved data files produced by scuffem codes will contain data on multiple functions . (For example, in scuffcas3d each line of the data file may contain data on both Casimir energy and Casimir force.)
You can integrate all of these
at once simply by specifying multiple dataColumn
options. For example, if you have functions and
and you have a file named fgData
with the format
x1 f1 g1
x2 f2 g2
...
xN fN gN
then you can say
% scuffintegrate datafile fgData freqColumn 1 dataColumn 2 datacolumn 3
and the resulting output file fgData.Integrated
will report values for both and .
Giving names to data columns
In the legend at the top of the .Integrated
output file,
the values of the various integrated functions will by default
be labeled data 0
, data 1
, etc. If you want to give more
descriptive names, just follow each dataColumn
option
with a dataName
option.
For example, if your force and torque
integrands are respectively reported on columns 8 and 11
of your data file, say
dataColumn 8 dataName Force dataColumn 11 dataName Torque
.
Integrating functions of frequency and other parameters
In many cases we will have functions that depend on various parameters beside frequency. (In scuffcas3d, for example, we might compute Casimir forces between particles separated by various distances , so the integrand function may be thought of as a function of both distance and frequency.)
For example, suppose your data file is called pxfgData
and
looks something like
p1 x1 f11 g11
p1 x2 f12 g12
....
p1 xN f1N g1N
p2 x1 f21 g21
p2 x2 f22 g22
....
p2 xN f2N g2N
....
pM xN fMN gMN
where p1,
p2,
..., pM
denote distinct values
of some parameter and fmn,gmn
are the numerical
integrand values .
In this case you can't simply say
freqColumn2 dataColumn 3 dataColumn 4,
because then
data for all parameter values will be mashed all together and
integrated as a single function of frequency, yielding nonsense.
Instead, you handle this situation by specifying the additional
commandline parameter tagColumn 1
to tell scuffintegrate
to interpret data lines with different values in column 1
as samples of different functions:
% scuffintegrate datafile pxfgData tagcolumn 1 freqColumn 2 dataColumn 3 dataColumn 4
In this case, the output file pxfgData.Integrated
will report
integrated values of and separately for each value of
.
If your integrands depend on multiple parameters ,
you may specify multiple tagColumn
options to specify
the columns in which values of the various parameters live.
Then each line of the .Integrated
output file will report
integrated values of all functions for a single tuple of
parameter values
Integrating scuffneq data
scuffintegrate incorporates special functionality
for handling the particular frequencyresolved data files
produced by scuffneq.
In this case, for a geometry containing bodies,
each line of the .SIFlux
output file is tagged with
a data field of the form (where and are
integers between 1 and ) to label the contributions
of sources in body to the power, force, and/or torque
(PFT) on body . (For example, lines for which this field reads
13
give contributions of body 1 to the PFT for body 3).
The actual data quantities reported in the
.SIFlux
file are the generalized fluxes
in equation (1) above, and to evaluate the integral
here we need to know the temperatures of the environment
and of all bodies in the geometry, which enter through
the BoseEinstein factors in (1).
To handle these complications, scuffintegrate supports the following additional commandline options:

sdColumn xx
Specifies that the indicator field appears on column
xx
of the data file. (The default issdColumn 3
, matching the default file format of the.SIFlux
files produced by scuffneq, so for those files this option may be omitted.)

Temperature N T
If , this sets the temperature of the th object/surface in the geometry to
T
Kelvin. (Here objects/surfaces are indexed using a 1based convention; to set the temperature of the first object/surface specified in the.scuffgeo
file to room temperature you would sayTemperature 1 300.
)If , this instead sets the temperature of the environment to
T
.

TemperatureFile TFile
Specifies a file containing multiple temperature configurations at which to compute total PFTs. For an body geometry, each line of
TFile
should contain spaceseparated numbers in the same format as the arguments to theTemperature
option, i.e.TEnv T1 ... TN.
For example, to compute PFTs in a twobody geometry with the temperature of body 1 scanned from 10 to 300 Kelvin, the temperature of body 2 held fixed at room temperature, and the environment temperature fixed at 0,
TFile
would look like
0 10 300
0 20 300
...
0 300 300
scuffintegrate CommandLine Reference
Only numerical data columns are counted as columns
There is one potentially confusing aspect of the way
scuffintegrate interprets column indices as specified
by commandline arguments such as FreqColumn
or DataColumn
.
This is that scuffintegrate treats nonnumerical data columns
as white space, and in particular does not include data columns
containing text strings when counting column indices.
Thus, for example, if your data file contains frequency and integrand data in the second and third columns, with the first column containing a character string, like this:
DEFAULT 0.1 3.45e5
DEFAULT 0.2 7.82e5
DEFAULT 0.3 1.10e4
...
then scuffintegrate ignores the DEFAULT
column and considers
the first column with numerical data to be column 1, so here
you would say freqColumn 1 dataColumn 2.
In contrast, if your data file looks instead like this:
4.00000 0.1 3.45e5
4.00000 0.2 7.82e5
4.00000 0.3 1.10e4
...
you would want to say freqColumn 2 dataColumn 3.