<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Thierry,<div class=""><br class=""></div><div class="">can one realize this by a source that selects the transverse momentum k_x and k_y by a Monte Carlo choice?</div><div class="">Simply “Extending” the source component?</div><div class=""><br class=""></div><div class="">Regards</div><div class=""><br class=""></div><div class="">Jörg</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 11. Mar 2021, at 10:20, Andrew Wildes <<a href="mailto:wildes@ill.fr" class="">wildes@ill.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Thierry,<div class=""><br class=""></div><div class="">I’m a big fan of making relative comparisons using the simplest possible source. I first simulate a “reference” instrument before playing with parameters. So long as the source characteristics stay the same, any changes in performance can be expressed by dividing the monitor counts for the modified instrument by the monitor counts for the reference instrument.</div><div class=""><br class=""></div><div class="">Consequently, I’d solve your problem by using the Source_div component and have the focus as a variable defined in the INITIALIZE section, e.g.:</div><div class=""><br class=""></div><div class="">DEFINE INSTRUMENT Thierry(lambda=6, dlambda=0.1,m=1)</div><div class=""><br class=""></div><div class="">DECLARE</div><div class="">%{</div><div class=""> double DivSource_m;</div><div class=""><div class=""> double SourceWid = 0.1;</div></div><div class=""><div class=""> double SourceHi = 0.1;</div></div><div class=""><br class=""></div><div class="">%}</div><div class=""><br class=""></div><div class="">INITIALIZE</div><div class="">%{</div><div class=""> DivSource_m=m*0.1*lambda;</div><div class="">%}</div><div class=""><br class=""></div><div class="">TRACE</div><div class="">COMPONENT Centre = Progress_bar()<br class=""> AT (0, 0, 0) ABSOLUTE<br class=""><br class="">/*******************************************************/<br class="">/******************* Source ****************************/<br class="">/*******************************************************/<br class="">COMPONENT source = Source_div(<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>xwidth = SourceWid, <br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>yheight = SourceHi, <br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>focus_aw = DivSource_m, <br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>focus_ah = DivSource_m,<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>lambda0 = lambda,<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>dlambda = dlambda,<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>gauss = 0)<br class=""> AT (0,0,0) ABSOLUTE</div><div class=""><br class=""></div><div class="">END</div><div class=""><br class=""></div><div class="">(Please forgive any direct programming errors).</div><div class=""><br class=""></div><div class="">I suspect that there might be a problem with my relative comparisons if you change the source divergence between instruments as the flux at your target might change. Someone might be able to advise on that.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Andrew<br class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 10 Mar 2021, at 16:46, Thierry Bigault <<a href="mailto:bigault@ill.fr" class="">bigault@ill.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<div class="">
<font size="-1" class=""><font face="Verdana" class="">Dear McStas,<br class="">
<br class="">
Here is my problem: <br class="">
I would like to simulate the exit of a cold neutron guide with a
source. The aim is to concentrate on the instrument optics,
without having to calculate all the guide from the reactor.<br class="">
A simplified and quite general description of a guide exit is a
beam with a fixed "m-value" divergence: for a given wavelength,
the width of the angular divergence (either box-type, Gaussian
or whatever) is essentially proportional to the m-value of the
guide coating and to the wavelength.<br class="">
If the guide has different supermirror coatings on horizontal
and on vertical faces, this leads to different angular widths.<br class="">
I assume the beam characteristics does not depend on the
position at the guide exit in this approach.<br class="">
My question is : what is the simplest way to simulate such a
secondary (or virtual) source in McStas ? I only found
components where the angular width is geometrically fixed (in
degrees), therefore wavelength-independent.<br class="">
Ideally I would also like to include a non-flat wavelength
intensity distribution, but this can probably be done by adding
a Filter_gen after the source.<br class="">
I am thinking of making several calculations at different
wavelengths, but if anyone knows a all-in-one solution I am
interested.<br class="">
<br class="">
Thierry<br class=""></font></font></div></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">mcstas-users mailing list<br class=""><a href="mailto:mcstas-users@mcstas.org" class="">mcstas-users@mcstas.org</a><br class="">https://mailman2.mcstas.org/mailman/listinfo/mcstas-users<br class=""></div></blockquote></div><br class=""></div></body></html>