McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 54 forks source link

Discrepancy between experimental reflectivities of supermirrors and output of ref-lib.c #1247

Closed gmangiap closed 1 year ago

gmangiap commented 2 years ago

Hello everybody,

during some McStas simulations of supermirror-based neutron guides I came across the paper of Henrik Jacobsen et al. (Bi-spectral extraction through elliptic neutron guides, in Nuclear Instruments and Methods in Physics Research A 717 (2013) 69–76) in which a plot of the experimental reflectivities of supermirrors produced by Peter Böni (Swiss Neutronics) with different m-values are reported vs. q (Fig. 2a). As far as I know, the reported values have been used in McStas for the simulation of supermirrors when the user introduces a single m-value with W and alpha both null. The optimized values of W and alpha (and beta) based on the experimental values are reported in ref-lib.c (I have reported below only the necessary code)

 // Simpler parametrization from Henrik Jacobsen uses these values that depend on m only
   m = m * 0.9853 + 0.1978;
   W = -0.0002 * m + 0.0022;
   alpha = 0.2304 * m + 5.0944;
   beta = -7.6251 * m + 68.1137;
   if (m<=3) {
      alpha = m;
      beta = 0;
    }

   /* If W and alpha are set to 0, use Henrik's approach for estimating these parameters
      and apply the formulation: 
   arg = (q - m*Qc)/W
   R = R0*0.5*(1-tanh(arg))*(1-alpha*(q-Qc)+beta*(q-Qc)*(q-Qc));
   */

Anyway I noticed that these values give reflectivities, R, which are lower than the experimental values, especially in the interval between Qc and m * Qc, where R should have a parabolic dependence with q-Qc. Since I was not able to retrieve the original Swiss Neutronic data (reference 19 of the paper points to a non-existent page and further search on www.swissneutronics.ch was unfruitful) I overlapped figure 2a of the paper with the reflectivities coming from the equations used in ref-lib.c, getting the results below (I used the same colors as the paper)

Fig_A

Except for the case m = 2, the coefficients do not accurately reproduce the reflectivities. Basically it seems that the "almost correct slope" corresponds to that of the "previous" m. Based on that I just tried to use the following different values (for m >=3):

   m = m * 0.9853 + 0.1978;
   m_corr = m * 0.9853 - 0.7875;
   W = -0.0002 * m_corr + 0.0022;
   alpha = 0.2304 * m_corr + 5.0944;
   beta = -7.6251 * m_corr + 68.1137;
   if (m==3) {
      alpha = m_corr;
      beta = 0;
    }
   arg = (q - m*Qc)/W // <--- here m, not m_corr!!
   R = R0*0.5*(1-tanh(arg))*(1-alpha*(q-Qc)+beta*(q-Qc)*(q-Qc));

getting a better agreement, although not 100% satisfactory (this time using a black color with different patterns for all the plots):

Fig_B

Anyway it could be that the plot reported is not correct, and in any case the overlapping of the fig2A can help to a limited extent, which is why I ask the McStas team to investigate this point, apologizing if this is an old problem already known (I tried to search in the list of old tickets but could not find any trace of this topic)

Best regards

Gaetano Mangiapia Helmholtz-Zentrum Hereon Forschungs-Neutronenquelle Heinz Maier-Leibnitz (FRM II) - Technische Universität München

willend commented 2 years ago

Hi @gmangiap,

Thanks for the thoughts and patch - I will have a closer look and see to incorporate this patch to both the master and mccode-3 branches for the forthcoming 2.x and 3.x releases!

Best Peter Willendrup

gmangiap commented 2 years ago

Dear @willend,

thank you for your reply. Obviously the result coming from my coefficients still needs to be improved, as I used a very crude approach, not having access to the experimental reflectivity data.

Best

Gaetano Mangiapia Helmholtz-Zentrum Hereon Forschungs-Neutronenquelle Heinz Maier-Leibnitz (FRM II) - Technische Universität München

willend commented 2 years ago

Hi @gmangiap,

Sure, no worries. What should perhaps also be more visible in our docs is a more recent "third alternative" contributed from Klaus Lieutenant (FZJ/Vitess), namely a set of .txt files in the data folder:

Mirrotron_mirors_2020.txt
S-DH_mirors_2020.txt
SwissNeutronics_mirors_2020.txt

For each of the main vendors a set of parameters are listed corresponding to the original "simple" model.

(I have just realised both the typo in the filenames and that the files are actually only present in the 2.7.1 release, not in 3.1... )

Best Peter

willend commented 1 year ago

Implemented for release of McStas 3.2 and 2.7.2