McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics NEXMAP


About McStas
 Conditions of use
 Project funding

 Linux Install (deb/rpm)
 Mac OS X Install
 Unix Install (src code)
 Windows Install
 Other Downloads (share)

Mailing list

Search web/mailinglist

 McStas manual
 Known problems
 C Compilers




Report bugs


McStas Ubuntu live-dvd

Exercise: Source and PSD next up previous
Next: Exercise: Insert a monochromator Up: Exercises Previous: Exercises

Exercise: Source and PSD

  1. Start the GUI (Graphical User Interface) by writing the command mcgui in a terminal. To open a terminal in Ubuntu, go to Applications $\rightarrow$ Accessories $\rightarrow$ Terminal or press Ctrl+Alt+t.
  2. Click the Edit/New button on the GUI.
  3. Insert a template instrument through the menu Insert $\rightarrow$ Instrument template or by pressing Alt+i twice. Set up an instrument, consisting only of an arm (keep the arm 'Progress_bar' that is already in the file), a source (Source_Maxwell_3) and two monitors (a PSD_monitor and an L_monitor). Insert the source at (0,0,0) relative to the origin and the monitors at (0,0,1) relative to the origin. As you input each component you should read the their documentation to find the needed input parameters. The component library can be accessed by clicking the Help (McDoc) button on McGui and choosing 'Component library index'. This will open up an webpage with a list of all the components.

    For the source we will help you out. Try

    COMPONENT source = Source_Maxwell_3(
        size = 0.1, l_low = 0.1, l_high = 10, dist = 10, xw = 0.01,
        yh = 0.01, T1 = 300, T2=300, T3=300, I1=1e14, I2=0, I3=0)
    AT (0, 0, 0) RELATIVE Origin
    Read the Source_Maxwell_3 documents using McDoc to understand the suggested parameters.
  4. When the file is saved for the first time, McGui is automatically given the name of the instrument file. Run a simulation by pressing the Run button in McGui. After compiling the instrument file, McGui will open a window with questions on the simulation such as neutron count, i.e. how many times a neutron ray is simulated. For now, simply press the Start button. The instrument simulation will run and its output will be given in the McGui window. When the simulation finishes, plot the results by pressing the Plot button. You should now have two plots, one from the PSD monitor and one from the wavelength monitor. If either or both of the monitors have detected no neutrons, start looking for mistakes in your instrument file.
  5. Narrow down the interval of wavelengths emitted from the source to e.g. l_low=0.999 and l_high=1.001. Rerun your simulation to check the effect. Reset the wavelength interval to [0.1 10] Å.
  6. Estimate the solid angle covered by your PSD. Try to understand the neutron intensity as illustrated by the plot of the registered events in the PSD in the two previous runs. Try running the simulation with half or double the number of neutron rays. Try also to vary the source focus area and to understand what you observe.

next up previous
Next: Exercise: Insert a monochromator Up: Exercises Previous: Exercises
Peter Kjær Willendrup 2015-11-12

Last Modified: Thursday, 12-Nov-2015 11:53:11 CET
Search website mailinglist archive GitHub repos