|
|
|
The Computing for Science (CS) group supports ILL scientists, students and visitors in a number of activities including data analysis, instrument simulation and sample simulation.

These help pages were designed at theClarendon Laboratory, Department of Physics, Oxford University, U.K.by A. Tennant and D. McMorrow. Monte Carlo simulations of scans for neutron triple-axis spectrometers.One of the options on the menu bar of the "Rescal: Parameters" window is labelled "simulation". Clicking on it causes an extra window to a appear entitled "Rescal: Simulation". In order to make a simulation, a dispersion and line-shape need to be defined. At the moment the program is set up for sinusoidal dispersions with an energy gap at the zone centre. The current line-shape is Lorentzian and a detailed balance and 1/energy structure factor for antiferromagnetic line-shapes has been included. Details of how to modify the program are given in the final section of this web page. The simulation takes full account of the changes in the resolution at each point in the scan and also corrects for changes in resolution volume, counts by monitor etc. Entering parameters for the simulation Parameters defining the scan, dispersion, and linewidth are given in the "Rescal: Simulation" window generated on clicking on the "simulation" button on the menu bar of the "Rescal: Parameters" window. The "Rescal: Simulation" window (a screen-shot will be added later) consists of a title bar ("Rescal: Simulation"), menu bar with options
the final component of the "Rescal: Simulation" window is the set of parameter boxes. This consists of nine parameters describing the scan a parameter for the number of Monte Carlo points in the integration ten parameters describing the dispersion of the excitations and the final two parametrs are Modifying the dispersion and line-shapeAs remarked earlier, the program has been set up to calculate scattering for a sinusoidal dispersion and Lorentzian line-shape. Both of these can be tailored for specific purposes. The dispersion and lineshape are defined in the macro mc_sqw.m. This consists of a definition of wq - the dispersion as a function of Q(r.l.u.) - and s - the scattering from the line-shape. The definitions of wq and s are self evident form mc_sqw.m, however there is a fundamental difference in the definition of the functions from that using Fortran. Matlab uses matrices as it's basic unit rather than scalars. Because of this wq and s should be viewed as array equalities and functions. One ramification of this is that the normal arithmetic operators (+,-,*,/,^) are matrix operations and other operators between scalars and matrices or element-by-element operations must be prfixed by a dot i.e. .*,./ or .^.(c) A. Tennant D. McMorrow November 29 1995
|