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

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding
 Screenshots

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

Mailing list

Search web/mailinglist

Documentation
 McStas manual
 FAQ
 Known problems
 Publications
 C Compilers
 Other
 Tools
 Tutorial

Workshops/conferences

Developments

Links

Report bugs

Git

McStas Ubuntu live-dvd


Exercise: Insert a sample with two powder lines next up previous
Next: Exercise: Insert a real Up: Exercises Previous: Exercise: Insert a sample

Exercise: Insert a sample with two powder lines

  1. Next, let us insert something more interesting. Remove the V_sample and PSD_monitor_4PI and insert a PowderN component with the following parameters:
    COMPONENT sample = PowderN(radius=0.01,h=0.01, d_phi0=0.1, pack=0.5, 
       DW=0.9, frac=0.5, reflections="mylist.dat",
       Vc=3.86*3.86*11.82, sigma_abs=0, sigma_inc=2, barns=1)
      AT (0, 0, 0) RELATIVE \<name of arm at the sample position\>
    
    You should also create a list of reflections and save it as mylist.dat. The list should have the following contents:
    # column_j 3 multiplicity 'j'
    # column_q 1  Scattering vector modulus [Angs^-1]
    # column_F2 2 Scattering factor |F^2| in [barns]
    1 10 8
    1.3 10 4
    
  2. Insert a banana shaped detector:
    COMPONENT BananaDetector = Monitor_nD(
       xwidth=2, yheight = 0.09, 
       options="banana, theta limits [-55 -35] bins=360, file =detector.dat")
      AT (0,0,0) RELATIVE sample
    
    and make sure that the previously inserted beamstop is after the banana detector in the component list. Test that neutrons reach the detector by running a simulation.

    Afterwards, choose trace instead of simulate in the Run simulation window and see the instrument, you have created. To see only the trace of the neutrons, which hit the detector, select the detector component in the list given in the Inspect component box. Also, insert the following after the sample component:

    EXTEND %{ 
    if (!SCATTERED) ABSORB;
    %}
    
    This will insert a command in c-language into the compiled instrument file. The command says that if the simulated neutron does not scatter at the sample, it is absorbed. This removes the direct beam and should be used with caution.

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


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