[mcstas-users] Too low I and N on detector

Aaron M. Percival percival at physics.queensu.ca
Sun Jul 27 18:05:30 CEST 2008


Hi Tom,

Upon a quick review of your instrument file, I have the following
suggestions to improve efficiency:

In such an instrument that involves a long pre-sample guide, I would suggest
using the virtual_input/virtual_output component (see documentation).

Insert a virtual_input after the PSDafterSlit_before component.  Run a
simulation such that a statistically appropriate distribution of neutrons is
observed on this detector.

Create a new instrument, starting from the Sample component, using the
virtual_output as a source.  The repeat parameter the virtual_output should
then be used to set the number of neutron histories to simulation (do not
let ncount be the limiting factor or relative intensities will not be
correct).

Append the SPLIT keyword  (something like SPLIT 10 COMPONENT Sample=...) to
your Sample component (see documentation).

Using the dphi parameter of the PowderN component to limit vertical
scattering to an appropriate range.

Your source focusing seems a little strange.  You have as a default dist =
2.  Try focusing to the M2Exit slit, which would give dist =4.049 and make
xw and yh slightly larger than the dimensions of this slit (use your own
discretion).  You might even try focusing to the end of the collimator1
component.  Just be sure that xw and yh are not limiting factors to
divergence or neutron distribution.

I'm also curious to know what your ncount was for this simulation.  My
feeling would be that with your current setup, you'd probably need an ncount
of around 1e11 to get a sufficient signal into your final detector.

I would stress that you use virtual_input and virtual_output to split this
simulation into two parts.  This will greatly help your efficiency,
especially if you will be detecting more than one diffraction peak from your
sample.  The logic is that since your pre-sample guide and collimation will
probably be static, there is no need to continuously simulate this part of
the instrument.  If you build a data file with sufficient neutron histories
at the slit_before component, then you can simply repeat this set of
histories to build enough statistics on your final detector.  The SPLIT 10
appended to the sample component will also increase your efficiency by ~10x.

Should you have further questions, feel free to ask, as I have extensive
experience simulating this type of two-axis instrument.

Cheers,

Aaron

2008/7/24 wokaoyan1981 <wokaoyan1981 at 126.com>

> Hello colleagues,
>
>    I've set up a residual stress instrument.The simulation result
> suggests(Neutron count=109): Neutrons after Fe(211) diffraction are I
> I_err N=[29927.1 31233.5 3];And neutrons reaching the detector through
> aperture are I I_err N=[0 0 0]. Both I and N are too low.
>    I raised horizontal divergences of the first and second collimator but I
> and N remain too low. What should I do in order to get high I and N on
> detector?
>
>    Here is the code:
>
> /*******************************************************************************
> *         McStas instrument definition URL=http://www.mcstas.org
> *
> * Instrument: residual stress instrument
> *
> * %Identification
> * Written by: Tom
> * Date:10 Jan 2008
> * Origin: institute
> * Release: McStas 1.6
> * Version: 0.2
> * %INSTRUMENT_SITE:thesis
> *
> * residual stress instrument
> *
> * %Description
> * try to optimize parameters of residual stress instrument. default
> geometry is
> * from blueprints of residual stress instruments at
> CARR,FRM-II(Germany),E3* (Germany) * and SALSA(France)
> * Example: mcrun residual_stress.instr <RV=-1>
> *
> * %Parameters
> * dist:       [m]    focusing distance from source to SlitIn
> * GapM2_G:    [m]    distance between M2Exit and guide entrance
> * xw:         [m]    width of neutron guide entrance
> * yh:         [m]    height of neutron guide entrance
> * l:          [m]    length of straight neutron guide
> * m:          [1]    m-value of material1.5~3
> * CH1:        [']    horizontal divergence of the first collimator
> * len_C1      [m]    length of the first collimator
> * L1:         [m]    distance between exit of first collimator and
> *                    monochromator,0.01~0.3m
> * A1:         [deg]  rotation of mono
> * DM:         [Angs] d-spacing of monochromator
> * NH:         [columns]   number of slabs horizontal
> * NV:         [rows]   number of slabs vertical
> * mosaich:   [']    Horisontal mosaic FWHM
> * mosaicv:    [']    Vertical mosaic FWHM
> * RV:         [m]    Monochromator vertical curvature, 0 for flat, -1 for
> automatic
> *                    setting(then RV=2*L2*sin(DEG2RAD*A1) )
> * RH:         [m]    Monochromator horizontal curvature, 0 for flat, -1 for
> automatic
> *                    setting(then  RH = 2*L2/sin(DEG2RAD*A1))
> * L2:         [m]    distance between monochromator and sample,1.9~2.2
> * CH2:        [']    horizontal divergence of the second collimator
> * DS:         [Angs] d-spacing of sample:default Fe(hkl)
> * L3:         [m]    distance between sample and detector
> * %Link
> * A reference/HTML link for more information
> *
> * %End
>
> *******************************************************************************/
> /* Change name of instrument and input parameters with default values */
> DEFINE INSTRUMENT residual_stress(
>    dist=2, GapM2_G=0, xw=0.06, yh=0.11, l=6, m=2, CH1=10,
>    L1=0.3, A1=45, DM=1.0886, len_C1=0.6, NH=1, NV=15,
> mosaich=30,mosaicv=30,
>    RV=-1, RH=0, L2=1.9,CH2=30,DS=1.1782,L3=1.0)
> /* The DECLARE section allows us to declare variables or  small      */
> /* functions in C syntax. These may be used in the whole instrument. */
>
> DECLARE
> %{
> double M2Exit_mono; /* distance between M2Exit and monochromator */
> double lambda; /*wavelength after diffraction*/
> double monow; /*width of mono*/
> double A2;  /*half of sample take off angle*/
> %}
>
> /* The INITIALIZE section is executed when the simulation starts     */
> /* (C code). You may use them as component parameter values.         */
> INITIALIZE
> %{
> M2Exit_mono=GapM2_G+l+len_C1+L1;
> lambda=2*DM*sin(DEG2RAD*A1);
> if (RV<0) RV=2*L2*sin(DEG2RAD*A1);
> if (RH<0) RH = 2*L2/sin(DEG2RAD*A1);
> monow=xw/sin(DEG2RAD*A1);
> A2=asin(lambda/(2*DS))*RAD2DEG;
> printf("\nlambda=%f\tRV=%f\tRH=%f\tmonow=%f\tA2=%f\n",lambda,RV,RH,monow,A2);
>
> %}
>
> /* Here comes the TRACE section, where the actual      */
> /* instrument is defined as a sequence of components.  */
> TRACE
> /* Progress_bar is an Arm displaying simulation progress.*/
> COMPONENT Origin = Progress_bar()
>   AT (0,0,0) ABSOLUTE
>
> /********************* neutron source********************************/
> COMPONENT Source = Source_Maxwell_3(
>     height = 0.75, width =0.52988 ,
>     l_low =0.2,l_high =7,
>     dist = dist,
>     xw = 0.06, yh = 0.11,
>     T1 = 320,I1 =9.87E12)
>    AT (0, 0, 0)  RELATIVE Origin
>
> /************channel(Al and Fe) inside reactor, length:4.049m**********/
> COMPONENT SlitIn = Slit(
>     width = 0.06, height = 0.11)
>   AT (0, 0, 0 ) RELATIVE  Source
>
> COMPONENT M2Exit = Slit(
>     width = 0.06, height = 0.11)
>   AT (0, 0, 4.049 ) RELATIVE SlitIn
>
>
>  /*************************straight_guide*******************/
> COMPONENT straight_guide = Guide(
>     w1 = xw, h1 = yh, w2 = xw, h2 = yh, l =l, m = m)
>   AT (0, 0, GapM2_G) RELATIVE M2Exit
>
>
> /**************************first collimator**************************/
> COMPONENT collimator1 = Collimator_linear(
>     xmin = -xw/2, xmax = xw/2, ymin = -yh/2, ymax = yh/2,
>     len = len_C1, divergence = CH1)
>   AT (0, 0, l) RELATIVE straight_guide
>
>
> /*************************mono_craddle***************************/
> COMPONENT mono_craddle = Arm(
>     )
>   AT (0, 0, M2Exit_mono) RELATIVE M2Exit
>   ROTATED (0, A1, 0) RELATIVE Origin
>
> /***************************monochromator
> Ge(511)****************************/
> COMPONENT monochromator = Monochromator_curved(
>     width=monow, height=0.15, NH=NH, NV=NV,reflect = "0", transmit = "0",
>     gap = 0.0005,  mosaich = mosaich, mosaicv = mosaicv, r0 = 0.7,
>     t0 = 1.0, RV = RV, RH = RH, DM = DM)
>   AT (0, 0, 0) RELATIVE mono_craddle
>
> /*********************mono_out*******************/
> COMPONENT mono_out = Arm(
>     )
>   AT (0, 0, 0) RELATIVE mono_craddle
>   ROTATED (0, 2*A1, 0) RELATIVE Origin
>
> /********************detectors before second
> collimator**************************/
> COMPONENT LDbeforeC2 = L_monitor(
>     nchan = 200, filename = "LDbeforeC2", xwidth = 0.15,
>     yheight = 0.15, Lmin = 0, Lmax = lambda+0.1)
>   AT (0, 0, 0.8) RELATIVE mono_out
>
> COMPONENT PSDbeforeC2 = PSD_monitor(
>     filename = "PSDbeforeC2", xwidth = 0.15, yheight = 0.15)
>   AT (0, 0, 0.8) RELATIVE mono_out
>
> /***********************second collimator***************************/
>  COMPONENT collimator2 = Collimator_linear(
>     xmin = -xw/2, xmax = xw/2, ymin = -yh/2, ymax = yh/2, len = 0.4,
>     divergence = CH2)
>  AT (0, 0, 0.8) RELATIVE mono_out
>
> /**********************detector after second
> collimator********************/
> COMPONENT PSDafterC2 = PSD_monitor(
>     filename = "PSDafterC2", xwidth = 0.06, yheight = 0.11)
>   AT (0, 0, 0.4) RELATIVE collimator2
>
>
> /**********************aperture before sample*************************/
>  COMPONENT slit_before = Slit(
>      width = 0.008, height = 0.008)
>    AT (0, 0, 1.88) RELATIVE mono_out
>
> /**********************detector behind Slit_before***********************/
> COMPONENT PSDafterSlit_before = PSD_monitor(
>     filename = "PSDafterSlit_before", xwidth = 0.01, yheight = 0.01)
>   AT (0, 0, 0.01) RELATIVE slit_before
>
>
> /************************Fe(221) sample****************************/
> COMPONENT Sample = PowderN(
>     reflections = "Fe.laz", radius = 0.004, yheight = 0.8)
>   AT (0, 0, L2) RELATIVE mono_out
> EXTEND
> %{
> if(!SCATTERED) ABSORB;          /*perfect beamstop*/
> %}
>
> /************************sample_out************************/
> COMPONENT sample_out = Arm(
>    )
>   AT (0, 0, 0) RELATIVE Sample
>   ROTATED (0, -2*A2, 0) RELATIVE Sample
>
> /************************detector before slit_after********************/
> COMPONENT PSDbeforeSlit_after = PSD_monitor(
>     filename = "PSDbeforeSlit_after", xwidth = 0.008,
>     yheight = 0.050)
>   AT (0, 0, 0.01) RELATIVE sample_out
>
> /************************aperture after sample***************************/
> COMPONENT slit_after = Slit(
>     width = 0.008, height = 0.050)
>  AT (0, 0, 0.02) RELATIVE sample_out
>
> /************************detector*********************************/
> COMPONENT PSDafterSample = PSDlin_monitor(
>     nx = 200, filename = "PSDafterSample", xwidth = 0.2,
>     yheight = 0.2)
>   AT (0, 0, L3) RELATIVE sample_out
>
>
> /* This section is executed when the simulation ends (C code). Other    */
> /* optional sections are : SAVE                                         */
> FINALLY
> %{
> %}
> /* The END token marks the instrument definition end */
> END
>
> Regards,
> Tom
>
>
>
>
>
>
>
>
> ------------------------------
> 想免费升级vip邮箱吗? <http://popme.163.com/link/004572_0721_2489.html>
> 快来参加喝汇源游网易活动吧!
> _______________________________________________
> mcstas-users mailing list
> mcstas-users at mcstas.org
> http://mailman.mcstas.org/cgi-bin/mailman/listinfo/mcstas-users
>
>


-- 
*************************************************
Aaron M. Percival
M.Sc. Candidate
Dept. of Physics, Engineering Physics & Astronomy
Queen's University
Kingston, Ontario, Canada, K7L 3N6
Office: 613-533-6000 ext. 74789
Fax: 613-533-6463
*************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20080727/ac2de827/attachment.html>
-------------- next part --------------
_______________________________________________
mcstas-users mailing list
mcstas-users at mcstas.org
http://mailman.mcstas.org/cgi-bin/mailman/listinfo/mcstas-users


More information about the mcstas-users mailing list