Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://xmm.vilspa.esa.es/scisim/release/latest/help/postscript/msim.ps
Äàòà èçìåíåíèÿ: Wed Jan 12 14:07:56 2005
Äàòà èíäåêñèðîâàíèÿ: Sat Dec 22 15:34:28 2007
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: dust
Mirror module Simulator (MSIM) 4.0
M.W. Beijersbergen
January 12, 2005
This is a paper version of the MSIM help. If possible, refer to the HTML version, which contains images
and hypertext links.
MSIM is a simulator for the Mirror Moduleon the XMM-Newtonsatellite. It forms part of the XMM-
Newton Science Simulator SciSim.
This document contains information speci c to MSIM only; for generic information about SciSim, see
the SciSim User Guide.
1

XMM-Newton Science Simulator Page: 2
Contents
1 Overview of MSIM 4
1.1 Features simulated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Usage 5
2.1 SciSim GUI usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Command line usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Con guring the simulation 6
3.1 Model selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 Simulator parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.1 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.2 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Tools 8
4.1 Modelcurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Modelimg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5 Con guring the Mirror Module 8
5.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.1.1 Function tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.1.1.1 One-dimensional function tables . . . . . . . . . . . . . . . . . . . . . . . 9
5.1.1.2 Surface function tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.3 Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.3.1 PSD textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.3.1.1 Fractal one-dimensional scattering surfaces . . . . . . . . . . . . . . . . . 11
5.3.1.2 Tabular PSD texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.4 Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

XMM-Newton Science Simulator Page: 3
5.4.1 Spider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.4.2 X-ray baes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.4.3 Nest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4.3.1 Mirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4.4 Cylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4.5 Tube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4.6 Constructive solid geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4.6.1 Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.4.6.2 Union . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5 Mirror shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.1 Roll-o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.1.1 Polynomial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.5.1.2 Spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.5.1.3 GradientRollO and ReverseGradientRollO . . . . . . . . . . . . . . . . 17
5.5.2 Distortions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5.2.1 Fourier-Legendre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5.2.2 Polynomial Distortion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.5.2.3 TableDistortion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6 MSIM Internals 19
6.1 Section rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.2 Fresnel re ection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.3 PSD Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.3.1 Exact scattering algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.3.2 Fast scattering algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.4 Bilinear interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.5 Fourier-Legendre distortion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.6 Numerical intersection procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

XMM-Newton Science Simulator Page: 4
1 Overview of MSIM
MSIM is a ray tracer that simulates the X-ray response of the mirror modules of the XMM-Newton
satellite.
MSIM reads rays, traces them through the mirror module and writes the resulting rays to the output.
It is implemented as a single executable that acts as a lter on rays.
The mirror model is de ned in a model le which is highly con gurable. The model consists of sections
that are placed behind each other. Rays are traced through these sections step by step. A step can also
involve propagating backwards. There is no limit on the number of re ections a ray can undergo. This
means that scattering processes with multiple re ections can also be studied.
The mirror model consists of a set of X-ray bae plates, a spider, a mirror nest with a core cylinder and
an electron de ector. The shape of each of these parts is considered nominal. A few modi cations can
however be made:
 The nominal values can be changed
 Noise can be added to the centre coordinates and radii of an X-ray bae
 Each section can be misaligned with respect to the others
 Mirror distortions are modelled.
 The scattering o the gold surfaces of the mirrors is modelled.
MSIM comes with model les that contain the best knowledge available for all these parameters.
The software makes use of a uniform interface to pass ray information between various programs. This
means that the output of MSIM can be used as input for RSIM or ESIM. Furthermore, the set of tools
provided with SciSim can be directly applied to the output of MSIM, for example to obtain plots of the
ray paths, spot diagrams, e ective area calculation, ray statistics etc.
1.1 Features simulated
MSIM models the following features:
 X-ray bae plates with tolerancing on the centering and radii
 spider with tapered spokes
 nest with deformed mirror shells; included are Fourier-Legendre deformations, roll-o , poly-
nomial distortions, spider xation distortions, non-uniform thickness, tilt and decentre.
 re ection coeôcients of nickel and gold, taking into account the density, dust contamination
and energy and angle dependent absorption.
 scattering of gold and nickel surfaces, modelled with a power-law power spectral density of
the surface roughness, a tabular speci cation of the PSD or Gaussian scattering.
 electron de ector
 misalignment of all parts of the module
 misalignment of the entire module with respect to the satellite

XMM-Newton Science Simulator Page: 5
2 Usage
The basic functionality of MSIM is to work as a lter on a ray stream. This ray stream is typically
generated by GSIM, the ray generator of SciSim.
MSIM can be used in two ways: either from the SciSim graphical user interface (GUI) or from the
command line. The output le can be analysed with the ray analysis tools, or used as input for RSIM or
ESIM.
MSIM is con gured by the msim config section of the scisim.cfg(see SciSim User Guide). Which les
are scanned for this section is described in the SciSim User Guide. On the command line one can specify
an explicit le to be used with the -c option. From the GUI all relevant parameters can be adjusted.
All parameters that are accessible from the GUI can also be changed on the command line with the
--keyword value option, e.g. msim --model qm.
The most important parameter is the model. With this parameter one selects one of the model les from
a list of model les. In this model le(Sec. 5) the entire model is speci ed, including the description of
the surfaces.
With the other parameters the simulation can be modi ed. There are a number of switches to change
the type of re ection on various surfaces, and to turn o various distortions. Furthermore the accuracy
of the simulation can be speci ed to optimize the performance (see Con guring the simulation(Sec. 3)).
2.1 SciSim GUI usage
To use MSIM from within the SciSim GUI, rst start scisim (see SciSim User Guide). First set up a
source con guration. Then select GSIMand MSIM, and click on the Run button.
The rays that leave the mirror module are now written to a le. This le can be analysed with any of the
SciSim tools from the command line. It can also be used as input for the other simulators, either within
the GUI or from the command line.
The simulation can be con gured(Sec. 3) by clicking the mirror icon with the right mouse button. This
pops up a con guration screen.
2.2 Command line usage
To use MSIM from the command line, rst generate an MSIM input le with GSIM.
Suppose that the output from GSIMis in gsim.out. MSIM is now run with
msim gsim.out > msim.out
The generated le can be analysed with the SciSim tools, or used as input for the other SciSim simulators.
MSIM can also be used in a pipe together with other simulators, e.g.
cat csim.out j gsim j msim j rsim j esim > esim.out
MSIM can be con gured by editing the SciSim con guration le, by adding command line options or by
specifying a customised con guration le with the -c option (see the SciSim User Guide). The available
con guration options are described in Con guring the simulation(Sec. 3).

XMM-Newton Science Simulator Page: 6
3 Con guring the simulation
3.1 Model selection
With the model parameter one can choose which model is to be raytraced. In the GUI, one can choose
between the FM1 and FM2 mirror modules, as well as the QM. There is an extra model for the QM
as con gured in Panter. Note that the list of available models is de ned by the models entry of the
msim config section of the con guration les. This list is not accessible from the GUI; to change it, edit
one of the con guration les used by the GUI.
3.2 Coordinate system
See the description of coordinate systems in the SciSim User Guide.
3.3 Simulator parameters
Given a model, one can modify certain features of the simulation. The following parameters are available:
3.3.1 Simulation
models A list of model labels and related lenames, enclosed between begin and end labels. The model
le will be searched for using the generic le lookup mechanism of SciSim (see SciSim User
Guide).
model The label of the model to be simulated.
overrule Speci es the way the model is simulated. It can take the following values:
0 User speci ed model
1 Ideal model i.e. no distortion, no scattering, and using Fresnel re ection coeôcients.
2 Precalculated accurate model, see p

recalc.
3 Accurate model
Most users will use the pre-calculated or accurate model, and perhaps the ideal model out of
interest. The user speci ed model is only needed for advanced purposes. Note that the GUI
will always display the values of the parameters that are used for the di erent simulation
modes.
debug Determines the level of detail of the messages.
0 Log only global information and errors.
1 Include warnings during processing a ray.
2 Include raytracing information.
3 Include all available information.
seed The seed to use for the random number generator. Can be any number, but if it is zero the time is
used to set the seed, which gives independent runs. The seed is reported in the log le, so
that the simulation can be rerun using this seed to give identical results.

XMM-Newton Science Simulator Page: 7
3.3.2 Model
These parameters are only used if the user speci ed model is selected. Otherwise the model parameters
are overridden with the values for either the ideal model or the most realistic model.
distortShape If this is zero, the mirror shape is considered to be perfect Wolter-I. Note that if distort-
Normal is non-zero, the gradients of the surface are still that of a distorted mirror. Setting
distortShape to zero speeds up the simulation considerably, but both the point spread func-
tion and the e ective area are a ected.
disteps The maximum error in the calculation of the intersection point with a distorted shape in mm.
distortNormal If this is zero, the surface normal of the mirrors is that of a perfect Wolter-I.
precalc If this is non-zero, the mirror shape is calculated on a grid speci ed by xPoints and phiPoints
and stored before the raytracing starts. This increases the raytracing speed considerably.
The initialization time is however increased. This makes this option interesting only if a
large number of rays is to be processed; the turnover point depends on the con guration.
xPoints The number of points along the axial coordinate to be used to pre-calculate the mirror shape.
phiPoints The number of points along the azimuthal coordinate to be used to pre-calculate the mirror
shape.
mirrorFrontRe ect The re ection model for the front side of the mirrors:
0 Fully absorbing
1 Ideal Fresnel re ection
1 Specular re ection
2 Fast scattering model
3 Exact scattering model
Note that with re ection mode 1 (specular re ection) the loss of re ectivity due to dust and
absorption is still taken into account.
mirrorBackRe ect The re ection model for the mirror backside (see mirrorFrontRe ect).
re ect The re ection model for all surfaces apart from the mirrors. Note: in the current version there
are no re ecting surfaces other than the mirror front and back side, so this option is not
used.
mediumDensity If zero, the density of materials is set equal to the bulk density instead of the density
that is speci ed in the model le.
re ectCoeôcient If zero, the Fresnel re ection coeôcient for all re ections is 1.
re ectDust If zero, shadowing by dust is not taken into account.
re ectTransmission If zero, the transmission tables as speci ed in the model le are ignored.
parabolicRollO If this is zero, the roll-o distortion on the parabolic (entrance) side of the mirrors is
turned o .
intersectionRollO If this is zero, the roll-o distortion around the intersection plane is turned o .
hyperbolicRollO If this is zero, the roll-o distortion on the the hyperbolic (exit) side of the mirrors
is turned o .
fourierLegendre If this is zero, the low-frequency shape errors, as described by a Fourier-Legendre
expansion, are turned o .

XMM-Newton Science Simulator Page: 8
tableDistortion If this is zero, the distortion of the mirrors speci ed in the form of a table is turned o .
This includes the mirror thickness and the distortions caused by the xation to the spider.
polynomialDistortion If this is zero, the distortion of the mirrors speci ed in the form of axial poly-
nomials (speci ed at several azimuthal angle) is turned o .
xationDistortion If this is zero, the distortion of the mirrors due to xation to the spider is not
modelled.
shellMisalign If this is zero, the misalignment (decentre and tilt) of the mirror shells is turned o .
xbaeTolerance If this is zero, the noise in the centering and the radii of the rings of the sieve plates
of the x-ray bae is turned o .
sectionMisalign If this is zero, the misalignment of sections with respect to each other (bae, spider,
nest, de ector) is turned o .
4 Tools
4.1 Modelcurve
With the modelcurve tool it is possible to obtain a picture of a cut through the x,y plane of the mirror
module. The command line syntax is
modelcurve < model le > output le
All distortions are included in the plot. The output le is ASCII text formatted especially for the xmgr
plotting program, but can be used by other programs as well. An example of a plot with xmgr:
xmgr -maxsets 500 -nxy output le
4.2 Modelimg
The modelimg tool produces a visual image of the mirror model by sampling the input aperture on a reg-
ular grid and determining the rst intersection point of array with the mirror module. The corresponding
pixel in the output image is given a colour determined by which object the ray intersects; the brightness
is determined by the distance to the intersection. The result is a raytraced image of the mirror model.
The command line syntax is described when modelimg is started with the -h option. The output is a
portable pixmap (ppm) le which can be viewed by any pixmap viewer (e.g. xv).
5 Con guring the Mirror Module
The model that is raytraced by MSIM is speci ed in a model le. This section explains the contents of
a model le, and the way the data is used in the simulation. Normally a user would not want to modify
the model les, but change the simulation parameters instead.
5.1 General
5.1.1 Function tables

XMM-Newton Science Simulator Page: 9
5.1.1.1 One-dimensional function tables Many one dimensional functions y(x) are speci ed in
the form of a table (x i ; y i ). The function values are then calculated using linear interpolation in this
table. For values of x that are smaller than the lowest x in the table, the function returns the y value of
the point with the lowest x. Similarly, for values of x that are larger than the highest x in the table, the
function returns the y value of the point with the highest x (Fig. 1).
x
y
Figure 1: An example of the way a function that is speci ed as a table of points is interpolated and
extrapolated.
Input:
N x 1 : : : xn y 1 : : : yN .
To specify a constant use n = 1 and an arbitrary value of x, e.g.
1 0 0.0151.
To specify a value that is non-zero on a limited range only, specify zero-valued end points, e.g.
4 0 0.01 2.99 3 0 0.0151 0.0151 0.
5.1.1.2 Surface function tables Many surface functions z(x; y) can be speci ed in the form of a
table. This table is interpolated using bilinear interpolation(Sec. 6.4). For points outside the table the
value of the closest point is used.
Input:
N x 1 : : : xN
M y 1 : : : yM
z(x 1 ; y 1 )    z(x 1 ; yM )
. . . . . . . . .
z(xN ; y 1 )    z(xN ; yM )
To specify a constant value use a single, arbitrary point, e.g.
1 0 1 0 0.015.
To specify a function of x only, use a single point for y, e.g.
3 0 0.1 0.2
1 0
0.0846 0.0151 0.0223.
To specify a function of y only, use a single point for x, e.g.
1 0

XMM-Newton Science Simulator Page: 10
3 0 0.1 0.2
0.0846 0.0151 0.0223.
It takes a little more care to specify a cylindrical function z(x; ). The azimuthal angle  is taken as
0   < 2. To obtain the required z(x; 0) = z(x; 2), we have to specify equal z values for  = 0 and
 = 2. These tables therefore should have the format
N x 1 : : : xN
M 0 : : : 6:2832
z(x 1 ; 0)    z(x 1 ; 2)
. . . . . . . . .
z(xN ; 0)    z(xN ; 2)
where the last column is a copy of the rst 1 .
5.2 Media
Re ecting materials are speci ed in the form of a table of the refractive index as a function of energy.
The columns in the table are:
E energy in eV
n real part of refractive index
k imaginary part of refractive index
ô 1 n
From these numbers the re ection coeôcient(Sec. 6.2) is calculated.
Input:
medium name
begin
E 1 n 1 k 1 ô 1
. . .
. . .
. . .
. . .
end
5.3 Textures
5.3.1 PSD textures
PSD textures are de ned in terms of the power spectral density (PSD) of the surface roughness.
The scattering distribution of the surfaces is determined from the PSD using scalar di raction. The core
is broadened with a Gaussian. This gives for the scattering density
1
I
@I
@ =
p
R R
"
e [ 4 sin
 ] 2 e ô 2 =w 2
w p
 + 16 2
 3 sin sin 2 PSD(f)
#
(1)
1 Note that if we do not need the azimuthal dependency, we do not need both the  = 0 and  = 2 points, and thus
use the same trick as above.

XMM-Newton Science Simulator Page: 11
with
f = j cos cos j

(2)
ô = (3)
Here is the grazing incident angle and the grazing scattering angle,  is the wavelength of the incident
beam and R  is the Fresnel re ection coeôcient for this wavelength and grazing incident angle .
The Gaussian width w is speci ed as a function of the energy E and the incident angle . This is speci ed
as a surface function table(Sec. 5.1.1.2).
The scattering distribution is calculated using either an exact(Sec. 6.3.1) or an approximating fast(Sec. 6.3.2)
algorithm. Which one is used is determined by the re ection mode of the surface.
In the exact scattering model, a histogram is constructed by sampling the scattered intensity as a function
of . In order to construct this histogram the PSD energy is scanned logarithmically. The value fmult
determines the ratio between successive f values.
Dust is speci ed as the fractional coverage D of the surface by dust. The transmission is then calculated
from the shadowing by spherical particles, neglecting interference e ects (di raction, Mie scattering)
T = 1 D
sin
D
sin : (4)
Molecular contamination can be speci ed in the form of a transmission T as function of energy and angle.
This transmission is speci ed as a surface table(Sec. 5.1.1.2).
5.3.1.1 Fractal one-dimensional scattering surfaces The roughness is in many cases fractal-like,
which means that the PSD is a power of f . This is implemented as the fractal PSD type of texture. Used
is
PSD(f) = K
 f
f u
 n
f 0  f  f 1
0 elsewhere (5)
Four parameters are used: K, the scattering strength, n, the powerlaw exponent, and f 0 and f 1 , the
cuto frequencies of the surface roughness. The low-frequency cuto f 0 is necessary since the powerlaw
expression for the PSD diverges for small f ; the high-frequency cuto f 1 limits the total scattering by
making it zero for large scattering angles. f u is used to de ne the frequency units in the PSD expression,
and is normally 1.
Input:
PSDTexture FractalPSD name
(name of medium)

D
n E 1 : : : En m 1 : : : m T 11 T 12 : : : Tnm

m E 1 : : : En m 1 : : : m w 11 w 12 : : : wnm
fmult
K n
f 0 f 1 f u

XMM-Newton Science Simulator Page: 12
5.3.1.2 Tabular PSD texture For the TabularPSD type texture the PSD is speci ed as a histogram
of the PSD as function of the spatial frequency f .
Input:
PSDTexture TabularPSD name
(name of medium)

D
n E 1 : : : En m 1 : : : m T 11 T 12 : : : Tnm

m E 1 : : : En m 1 : : : m w 11 w 12 : : : wnm
fmult
begin
f 1;low f 1;high psd 1
. . . f n;low f n;high psdn
end
5.4 Sections
Each section starts with the section parameters. These are
v x v y v z d x d y d z x 1 x 2
The section is rotated(Sec. 6.1) around ~v = (v x ; v y ; v z ) over an angle , and then translated over a
distance (d x ; d y ; d z ). The equations x = x 1 and x = x 2 are used as bounding planes for the section. The
user has to make sure that this is correct for the section that follows.
5.4.1 Spider
A spider consists of a ring-shaped aperture, open between the radii r 0 and r 1 . It has N radial spokes
which are uniformly distributed over the azimuthal angles, starting at angle  0 . The width w of the
spokes is a function of the radius, and is speci ed as a table function(Sec. 5.1.1.1). The spokes extend
along the axial direction from x in;0 to x in;1 at the inner radius r 0 , and from x out;0 to x out;1 at the outer
radius r 1 .
Input:
Spider name
v x v y v z d x d y d z x 0 x 1
r 0 r 1
x in;0 x in;1
x out;0 x out;1
N
 0
n r 1 : : : r n w 1 : : : wn
5.4.2 X-ray baes
An X-ray bae plate is a plate with slits in the form of rings. The structure connecting the rings has
the form of a spider with uniform thickness. There are M rings, open between the radii r n;0 and r n;1 .
To simulate tolerances on the fabrication, the radii and the centering of the rings can be randomised.

XMM-Newton Science Simulator Page: 13
The centering of the entire plate is uniformly distributed over a circle with radius ô center . Each radius of
a ring is uniformly distributed over the interval ô radius around the nominal value. For each ray a new
random value is used for both the centre and the radii.
Input:
XBaffle name
v x v y v z d x d y d z x 0 x 1
r 0 r 1
x in;0 x in;1
x out;0 x out;1
N
 0
n r 1 : : : r n w 1 : : : wn
ô center ô radius
M
r 1;0 r 1;1
. . .
. . .
r M;0 r M;1
5.4.3 Nest
The nest consists of a blocking cylinder surrounded by a set of nested mirrors.
Input:
Nest name
v x v y v z d x d y d z x 0 x 1
(arbitrary section speci cation as blocking cylinder)
begin
(list of mirrors)
end
5.4.3.1 Mirror A mirror is by far the most complex geometrical object in the simulation. A mirror is
identi ed by its shell number N . Its basic shape is speci ed in terms of a Wolter-I shell that extends from
x 0 to x 1 along the axis. It has Wolter-I parameters A; B; C; D;E and a focal length f . The parabolic
surface is calculated from these parameters by
r(x; ) =
p
A(B + f x) x < x mid (6)
and the hyperbolic surface by
r(x; ) =
p
C(D + f x) 2 +E x  x mid (7)
where x mid is the axial coordinate of the intersection plane.
The shell is tilted over an angle  in the azimuthal direction . This tilt is around the centre of the shell
at the entrance plane (that is, the parabolic end).
The shell is translated by a vector (d x ; d y ; d z ). Due to the implementation of the nesting, it is advised
not to implement a displacement in the axial direction (d x = 0).
The texture is speci ed as a symbolic name that should refer to a texture that is already de ned in the
model le. There is one texture speci cation for the front and one for the backside of the shells.
The shell thickness is speci ed as the nominal thickness d.

XMM-Newton Science Simulator Page: 14
The mirror allows speci cation of a list of rollo s and a list of distortions for the front side, and a list of
distortions for the thickness. These are explained in section Mirror shape(Sec. 5.5).
The shape of the mirrors can be pre-calculated by the simulator, and this pre-calculated shape can also
be stored in the model le. Since this cannot be done by hand, the label precalc should be speci ed for
both the front and backside of the mirrors.
Input:
N
x 0 x 1
A B C D E
f x mid
 
d x d y d z
begin (rollo s) end
begin (distortions) end
(name of front surface)
precalc
d
begin (thickness distortions) end
(name of back surface)
precalc
5.4.4 Cylinder
A cylinder is speci ed as a section with radius r. It has no texture, and thus absorbs all rays that hit it.
Input:
Cylinder name
v x v y v z d x d y d z x 0 x 1 r
5.4.5 Tube
A tube is a circular hole with radius r in an otherwise opaque section. It has no texture, and thus absorbs
all rays that do not pass through the hole.
Input:
Tube name
v x v y v z d x d y d z x 0 x 1 r
5.4.6 Constructive solid geometry
5.4.6.1 Stack A stack is a combination of section, where one is placed behind the other in the x
direction. The user has to make sure that the section do not overlap.
Input:
Stack name
v x v y v z d x d y d z x 0 x 1

XMM-Newton Science Simulator Page: 15
begin
(list of sections)
end
5.4.6.2 Union A union is the additive combination of di erent sections. The intersection points with
each component are calculated, and the one that is closest is used as the intersection point.
Input:
Union name
v x v y v z d x d y d z x 0 x 1
begin
(list of sections)
end
5.5 Mirror shape
The speci cation of the nominal shape of a mirror shell is described in Mirror(Sec. 5.4.3.1). This section
describes the modi cations that can be made to this nominal shape.
With a rollo speci cation the radius can be modi ed in certain sections of the mirrors. This distortion
is rotationaly symmetric. The rollo radius replaces the Wolter-I radius function r(x; ) over the range
where they are enabled. Rollo s include:
1. polynomial (PolyRollOff.H)
2. spline (SplineRollOff.H)
(a) Hermite (Hermite.H)
(b) Cubic (Cubic.H)
(c) Linear (Linear.H)
Distortions are added to the radius equation. These distortions are a function (x; ) of both the axial
coordinate x and the azimuthal coordinate . Distortions include:
1. FourierLegendre (FourierLegendre.H)
2. Tabular (TableDistortion.H)
3. Polynomial (PolynomialDistortion.H)
5.5.1 Roll-o
5.5.1.1 Polynomial Polynomial roll-o is intended for modeling the roll-o at the end of the mirror
shells. The radius is a third order polynomial between x 0 and x 1 . It matches smoothly the ideal shape
R 0 (x) in the plane x = x 0 . The polynomial is speci ed by two parameters, a 2 and a 3 , which represent
the displacement of the second and third order term at the end point x = x 1 . This can be used to model
the roll-o at the hyperbolic end. The radius R(x) for x 0  x  x 1 is given by
R(x; ) = R 0 (x 0 ) +R 0
0 (x 0 ) (x x 0 ) + a 2
 x x 0
x 1 x 0
 2
+ a 3
 x x0
x 1 x 0
 3
(8)

XMM-Newton Science Simulator Page: 16
If the reverse ag r is set to 1 instead of 0, then the role of x 1 and x 0 are reversed. The polynomial then
is matched smoothly at x = x 1 , and a 2 and a 3 are the values of the second and third order terms in the
plane x = x 0 . This can be used to specify the roll-o at the parabolic end.
Input:
PolyRollOff x 0 x 1 r a 2 a 3
5.5.1.2 Spline The spline roll-o implements a curve R(x) that goes through N points. In each
point the distortion d relative to the ideal shape is speci ed. A curve is interpolated between each pair
of points. The tangent at the end points is matched to that of the ideal shape; the tangent in the inner
points is parallel to the line connecting the neighbouring points (Catmull-Rom spline[2, p483]).
5.5.1.2.1 Cubic The cubic spline implements a cubic polynomial between each pair of points.
Input:
SplineRollOff Cubic begin
x 0 d 0
. . .
xN dN
end
5.5.1.2.2 Hermite The Hermite spline implements a Hermite curve between each pair of points[2].
The Hermite curve is a third order parametric curve:
x(t) = a 0 + a 1 t + a 2 t 2 + a 3 t 3 (9)
R(t) = b 0 + b 1 t + b 2 t 2 + b 3 t 3 (10)
The coeôcients are chosen such that the gradient vector in the end points is parallel to the tangents
of the ideal curve; in the inner points the gradients are parallel to the line connecting the neighbouring
points. The lengths of the gradient vectors in the end points (v l and v r ) are however free. They are
speci ed after each section.
Input:
SplineRollOff Hermite begin
x 0 d 0
x 1 d 1 v l v r
x 2 d 2 v l v r
. . .
xN dN v l v r
end
5.5.1.2.3 Linear The 'linear spline' implements linear section between each pair of point. Note that
the derivatives are not matched in this case.
Input:
SplineRollOff Linear begin

XMM-Newton Science Simulator Page: 17
x 0 d 0
x 1 d 1
x 2 d 2
. . .
xN dN
end
5.5.1.3 GradientRollO and ReverseGradientRollO The gradient rollo implements a curve
R(x) that is built up from a set of segments. The gradient error in the end points is speci ed, not the
distortion distance. A curve is interpolated between each pair of points. The type of the curve determines
the distortion distance in the end point. Two types of gradient rollo exist: the one that is de ned in
the negative x direction and one that is de ned in the positive x direction.
5.5.1.3.1 Parabolic The parabolic gradient rollo implements parabolic sections that have the pre-
scribed gradient errors in the end points.
Input:
GradientRollOff Parabolic begin
x 0 g 0
. . .
xN g N
end
or
ReverseGradientRollOff Parabolic begin
x 0 g 0
. . .
xN g N
end
5.5.2 Distortions
5.5.2.1 Fourier-Legendre The Fourier-Legendre distortion is given in terms of a dimensionless x
coordinate that ranges from -1 to 1,
 = (x x 0 )=d x (11)
For this the zero point x 0 as well as d x , the length that corresponds to 1, has to be speci ed. For the
screening device analysis of XMM-Newton this is 0 and 300 mm respectively.
The distortion is given by
 =
X
m
X
n
KnmPn ()[ c
nm cos m +  s
nm sin m] (12)
The axial Legendre polynomial is only supported for orders up to 2. The  values are to be speci ed in
mm.
Input:
FourierLegendre

XMM-Newton Science Simulator Page: 18
x 0 d x
N M
 c
00     c
N 1;0
. . . . . . . . .
 c
N 1;M 1     c
N 1;M 1
 s
01     s
N 1;1
. . . . . . . . .
 s
N 1;M 1     s
N 1;M 1
5.5.2.2 Polynomial Distortion The polynomial distortion is given as axis polynomials. Several
polynomials can be speci ed, one for each azimuthal angle. The polynomials are expressed in a dimen-
sionless x coordinate, that runs from 0 to 1 over the range x 0 to x 1 that are speci ed in the input:
 = (x x 0 )=(x 1 x 0 ) (13)
The distortion in a given point (x; ) is calculated by interpolating the polynomials to get a polynomial
P at the speci ed azimuthal angle . Then this polynomial is evaluated in the point :
(x; ) =
n
X
i=0
P i  i (14)
Input:
PolynomialDistortion
x 0 x 1
n  1    n
m 1 P 0 : : : Pm1 1
. . .
mn P 0 : : : Pmn 1
5.5.2.3 TableDistortion A TableDistortion is a distortion of the mirror surface based on a table of
distortions. This table is interpolated using bilinear interpolation[3].
For points outside the rectangle the value is set to the value in the closest point on the boundary. If
you want to de ne the distortion on a nite part of the mirror, make thus sure that the values at the
boundaries of the rectangle are zero. For a table that spans the full azimuthal range, make sure to include
both the column for  1 = 0 and N = 2, with identical  values.
Input is a surface table function(Sec. 5.1.1.2):
TableDistortion
N x 1 : : : xN
M  1 : : : M
(x 1 ;  1 )    (x 0 ; M )
. . . . . . . . .
(x N ;  1 )    (x N ; M )
Here x is in mm and  in radians.

XMM-Newton Science Simulator Page: 19
6 MSIM Internals
6.1 Section rotation
The coordinates are represented as a vector ~x = (x; y; z; 1). This vector is rotated according to
~x 0 = M~x (15)
with M the rotation matrix[2](p227)
M =
0
B B B @
u 2 x + cos (1 u 2 x ) uxuy (1 cos ) uz sin  uz ux (1 cos ) + uy sin  dx
uxuy (1 cos ) + uz sin  u 2 y + cos (1 u 2 y ) uy uz (1 cos ) ux sin  dy
uz ux (1 cos ) uy sin  uy uz (1 cos ) + ux sin  u 2 z + cos (1 u 2 z ) dz
0 0 0 1
1
C C C A (16)
6.2 Fresnel re ection
The index of refraction table is linearly interpolated. The Fresnel re ection coeôcients are calculated
from the real part n and the complex part k of the index of refraction. For a normal incidence angle 
the re ection coeôcient R s and R p (for the orthogonal and parallel polarizations) are calculated from
c = n 2 k 2 sin 2  (17)
g =
p
c 2 + (2nk) 2 (18)
a =
p
(g + c)=2 (19)
v = g + cos 2  (20)
w = 2a cos  (21)
R s = v w
v + w (22)
v 0 = g + sin 2  tan 2  (23)
w 0 = 2a sin  tan  (24)
R p = R s
v 0 w 0
v 0 + w 0 (25)
(26)
6.3 PSD Textures
6.3.1 Exact scattering algorithm
The distribution(Sec. 1) is generated by executing the following algorithm for each re ection:
 Construct a histogram by evaluating 1

@I
@ at the specular angle and logarithmically over
the scattering angles that correspond to the roughness frequencies f 0 to f 1 . Note that this
histogram is a function of the energy E and the incident angle and is therefore generated
each time a ray is to be re ected. The histogram is lled starting at low energies; when the
area under the histogram becomes larger than one, no further bins are added.
 Generate a random scattered angle from this histogram.
 Multiply the intensity of the ray by the total area under the histogram.

XMM-Newton Science Simulator Page: 20
The speed and accuracy of this procedure depend on the number of bins in the histogram. This is
determined by the multiplication factor fmult that is used to generate a logarithmic frequency scale:
fn = f 0 (f mult ) n ; n = 0; 1; 2; 3 : : : (27)
6.3.2 Fast scattering algorithm
For a fast scattering algorithm we approximate
sin  sin (28)
cos cos  ô sin (29)
R  R (30)
with
ô = : (31)
The scattering distribution becomes
1
I
@I
@
=
p
R R
"
e [ 4 sin
 ] 2 e ô 2 =w 2
w p

+ 16 2
 sin

 3
PSD(f)
#
(32)
with
f = jô sin =j (33)
This is generated using the following algorithm:
 With a chance C re ect using a Gaussian distribution with width w.
 Otherwise, with a chance B generate a random spatial frequency f with the distribution
PSD(f ). Calculate the corresponding angle . This is taken on either side of the specular
angle , with equal probability.
 Otherwise, absorb the ray.
The intensity of the re ected ray is then multiplied by
p
R R . This results in a distribution
1
I
@I
@ =
p
R R
"
C e ô 2 =w 2
w p
 + (1 C)B PSD(f)
R 1
0 PSD(f)
#
(34)
With
C = exp
 4 sin

 2
(35)
B = 16 2
 sin

 3
R 1
0 PSD(f)
1 C (36)
this gives the desired approximated distribution (32).

XMM-Newton Science Simulator Page: 21
6.4 Bilinear interpolation
Surface functions that are de ned as a table of function values on a grid are interpolated using bilinear
interpolation [3]. The value in a point (x; ) is given by
z(x; ) = (1 t)(1 u)z ij + t(1 u)z i+1;j + (1 t)uz i;j+1 + tuz i+1;j+1 (37)
where x i < x < x i+1 and  i <  <  i+1 , and
t = (x x i )=(x i+1 x i ) (38)
u = (  j )=( j+1  j ) (39)
6.5 Fourier-Legendre distortion
The gradient of the Fourier-Legendre distortion is given by
r =
X
m
X
n
Knm 
( dPn ()
d
[ c
nm cos m +  s
nm sin m] ^
x
+ mPn ()[  c
nm sin m+  s
nm cos m] ^
 ) (40)
6.6 Numerical intersection procedure
The intersection point of a ray with a mirror surface is computed numerically. For this the closest root
of the function d(l) = 0 is determined with a variant of the secant method [1](p53). Initial starting point
is the intersection of the ray with the undistorted Wolter-I shape, which can be calculated analytically.
If there is no such point, or if the secant method does not converge to a proper intersection point, the
intersection points with the bounding box are determined. This box is the volume enclosed by two
undistorted bounding Wolter-I shapes and the entrance and exit planes. If there is any such point, the
secant method is applied to each point, the closest one rst.
References
[1] R.L Burden and J.D. Faires. Numerical Analysis. PWS-Kent, Boston, 4 edition, 1989.
[2] J.D. Foley, A. van Dam, S.K. Feiner, and J.F. Hughes. Computer Graphics: Principles and Practice.
Addison-Wesley, Reading, Massachusetts, 2 edition, 1993.
[3] W.H. Press, S.A. Teukolsky, W.T. Vetterling, and B.P. Flannery. Numerical Recipes in C. Cambridge
University Press, Cambridge, NY, USA, 1992.