--- myst: substitutions: macro: python: 1-5,18-35,38-47,50-55 cpp: 4-6,13-25,28-35,38-43 bloc1: python: "38" cpp: "28" console: python: 2-56 cpp: 6-60 --- (use_cases_macro_sensitivity_sobol_load_file)= # Macro "**sensitivitySobolLoadFile.{{extension}}**" ## Objective The objective of this macro is to perform a full Sobol analysis using the existing file created when the Sobol class is allowed to perform the {{doe}} and the estimations by itself when this one is not considered accurate enough (from the statistical point of view). The idea is to use anyway all the computations already done and generate some more to increase the statistical precision. In order to do that there are few things to keep in mind: - The problem should obviously be exactly the same: same input and output (name, statistical laws, parameter values...). - The input file (here `ref_sobol_launching_.dat`) should contains the internal variable in order to figure out from what matrices every configuration is taken out of (generally an iterator whose name should look like `sobol__n__iter__` plus the dataserver name). - If the pseudo-random generator seed is set to a given value, be sure that you are not be using the same seed than the once used to generate the input file, which would lead to twice the same events. One can find another discussion for this objective in the third item in the tip box in [](#sensitivity_sobol_computation_indices). ```{warning} The `ref_sobol_launching_.dat` file used as input is not provided in the usual sub-directory *"/share/uranie/macros"* of the installation folder of {{uranie}} (*$URANIESYS*) but can be generated by the user by running the macro discussed in [](#use_cases_macro_sensitivity_sobol). ``` ## Macro {{uranie}} {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolLoadFile." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + macro[language] + "\n" + "```" }} As for [](#use_cases_macro_sensitivity_sobol), the `UserFunctions.C` file is loaded and all the input stochastic distribution are chosen wisely. The number of new estimations is set (to 10000, doubling the statistic as this is also the number used in [](#use_cases_macro_sensitivity_sobol) which provided the input file that would be used to complete this estimation). All the code lines are exactly those taken out of [](#use_cases_macro_sensitivity_sobol_macro) but the one that is used to load a previous estimation which is shown below: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolLoadFile." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} Once done, the `computeIndexes()` method is called and few lines are shown to display the results in the classical plot form, leading to the figure below (it is provided to illustrate how to represent results). The numerical results are shown in the console below and the improvement in terms of statistical precision can be seen by comparing the 95 percent confidence intervals going from [](#use_cases_macro_sensitivity_sobol_console) to [](#use_cases_macro_sensitivity_sobol_load_file_console). ## Graph The results of the previous macro is shown in {numref}`use_cases_sensitivitySobolLoadFile`, where the evolution of the sobol coefficient is shown for all inputs with the uncertainty band, for the first order coefficient and the total one, respectively on the top and bottom panel. {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sobol_load_file/sensitivitySobolLoadFile.png\n" + ":align: center\n" + ":name: use_cases_sensitivitySobolLoadFile\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"sensitivitySobolLoadFile." + extension + "\"**" + "\n" + "```" }} ```{raw} latex \begin{landscape} ``` (use_cases_macro_sensitivity_sobol_load_file_console)= ## Console {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolLoadFile_clean.log" + "\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }} ```{raw} latex \end{landscape} ```