Virtual Experiments With Mcstas Inserting MD Into Simulated Instruments
Virtual Experiments With Mcstas Inserting MD Into Simulated Instruments
Used by Nature since ... (a long time) : diversity of Life
Examples: flies in the kitchen, kids running everywhere, ...
First application using computers:
Metropolis, Ulam and Von Neumann at Los Alamos, 1943
Neutron Scattering and Absorption in U and Pu, Origin of MCNP
Name:
Monte Carlo Casino, a random generator (Ulam played poker)
Explore a complex and large phase space (many parameters)
Integrates microscopic random events into measurable quantities
not a usual regular sampling integration
n b
1 1 b−a
lim ∑
n→ ∞ n i=1, a<u <b
f ( u i )= ∫
b−a a
f ( u) du du→
n
i
Metropolis algorithm: model energy gap E as a probability
p eE/kT
Integrals converge faster than any other method (for d > 3)
when using enough independent events (central limit theorem)
F. James, Rep. Prog. Phys., Vol. 43 (1980) 1145.
McStas – Farhi – ILL/CS – May 2014 - 4/32
When to use Monte-Carlo methods ?
Dimensionality of phase space must be large (d > 5)
Overall complexity is beyond reasonable analytical methods
Each event can be computed easily and independently
MC is the 'lazy guy' method – think microscopic
Examples:
Estimate from a circle/square (“Buffon needle”)
Area under/inside a curve/volume (integration) Number of points for which
Molecular Dynamics { x2+y2 1, (x,y) [0,1] }
Ratio circle/square →
spinsystem phase transitions (Ising model)
nuclear reactions
raytracing (light, particles)
Good random generator:
from thermal electronic noise (hardware)
or quasirandom generators => quasiMonteCarlo
We encounter a probability 0 < p < 1.
Crude MonteCarlo (yes/no choice):
We shoot n events [0,1]
We keep events that satisfy < p
np events → low statistics
Importance sampling (fuzzy choice – event weighting):
Keep n events, no more random number...
But associate a weight p to each of them (we set = p)
Retain statistical accuracy (1/√n)
Each time physics takes place (scattering, absorption, ...) random choices
are made.
X-ray tracing
Shadow, McXtrace
Most widely used code in its ecological niche (compared to other similar codes)..
A Triple-Axis
M
M A A Spectrometer (IN20)
S
S
Design new instruments
Optimize existing instruments (flux/resolution)
Optimize usage of existing instruments (better experiments)
Get accustomed with the instruments before coming at the ILL
Measure the instrument effects on the simulated 'ideal' sample signal
Estimate complex effects like :
absorption, multiple scattering, geometry, resolution function...
Compare virtual experiments with real ones, possibly during exp.
n
Neutron ray/package:
n
Components: Here the neutron physics
(Bragg law) happen, neutron weight
adjusted according to scattering
probabilities etc (Monte Carlo is here).
λ=2 d sin θ
n
Instrument: positioning +
transformation between sequential
component coordinate systems, e.g.
neutron source, crystal, detector.
Sources (neutrons)
Continuous (reactor), Pulsed
Moving optics
Choppers (disk and Fermi), velocity selectors, phase space transformers
Static optics
Guides, mirrors, benders, lenses, collimators, slits, filters, monochromators
Samples/materials
Single crystals, liquids, gas, polymers, colloid
Detectors
Histogram and event monitors, gas detectors
Instruments are defined from a text file. General syntax is based upon C.
Basic syntax:
Virtual experiments
=
Instrument simulation
⊗
Realistic Sample model
=
Neutron flight simulator
and then we play with it without breaking the instrument and sample.
Most instrument components are 'easy' to simulate. The samples are often
more complex.
Neutronist's Mantra
Holy Book (Squires)
Effective cross section
for scattered intensity
V.F. Sears. Adv. Phys., 24 (1975) 1
Detector efficiency,
Experiments normalization, LAMP →q;t→
(TOF, TAS) transmission
(multiple scattering) FullProf
NAMD, DL_POLY
Molecular Inter-atomic
Dynamics potential u(r)
VASP, CASTEP
McStas – Farhi – ILL/CS – May 2014 - 19/32
Benefits from a virtual experiment
Benefits:
The resolution from the instrument is implicitly convolved with the sample,
without analytical integration
The 'spurious' effects from the instrument can be included
Treat absorption in the sample (self attenuation=2nd extinction)
Treat coherent/incoherent scattering
May include multiple scattering (depends on the sample component)
May model the measurement background
Requirements:
Need as accurate instrument description as possible
Use proper sample component/kernel
Give accurate data to the sample component (experiment, MD, …)
Be critical regarding the results (it's so easy to get rubbish)
7- Click the Run button (next to Edit). This builds the instrument.
8- Click again the Run button. A dialogue appears. It is possible here to
change the instrument parameters (wavelength, sample, ...).
9- Press Start. This takes 1 min.
10- Press the Plot button (below Run).
All histogram monitors defined in the
instrument are displayed. Data files are
pure text, stored in a directory.
Diffraction pattern
INC
COH
Water, MD
McStas – Farhi – ILL/CS – May 2014 - 30/32
Mission 5: Monitoring multiple scattering
S(q,w)
S(q)
Heavy Water, IN4 =1.1 Angs
McStas – Farhi – ILL/CS – May 2014 - 32/32