--- myst: substitutions: macro: python: 1-5,18-34,37-44,47-57 cpp: 4-6,13-25,28-34,37-45 bloc1: python: "19" cpp: "13" bloc2: python: 22-30 cpp: 5,15-22 bloc3: python: 33-34 cpp: "25" bloc4: python: "38" cpp: "29" bloc5: python: 55-57 cpp: 44-45 console: python: 2-50 cpp: 6-54 --- (use_cases_macro_sensitivity_sobol)= # Macro "**sensitivitySobolFunctionFlowrate.{{extension}}**" ## Objective The objective of this macro is to perform Sobol sensitivity analysis on a set of eight parameters used in the `flowrateModel` model described in [](#launcher_introduction_simple_case_problem). (use_cases_macro_sensitivity_sobol_macro)= ## Macro {{uranie}} {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + macro[language] + "\n" + "```" }} The function `flowrateModel` is loaded from the macro `UserFunctions.C` (the file can be found in `${URANIESYS}/share/uranie/macros`) {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} Each parameter is related to the {{tds}} as a `TAttribute` and obeys an uniform law on specific interval: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} To instantiate the `TSobol`, one uses the {{tds}}, the name of the function and the number of samplings needed to perform sensitivity analysis (here ns=600): {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} ```{only} py The last argument is the option field, which in most cases is empty. Here it is filled with "DummyPython" which helps specify to python which constructor to choose. There are indeed several possible constructors these 5 five first arguments, but C++ can make the difference between them as the literal members are either `std::string`, `ROOT::TString`, `Char_t*` or even `Option_t*`. For python, these format are all `PyString`, so the sixth argument is compulsory to disentangle the possibilities. ``` Computation of the sensitivity indexes: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + "```" }} ```{only} cpp The automatic backup of data (the file `_sobol_launching_.dat`) is renamed so that it can be used in other macros (see [](#use_cases_macro_sensitivity_sobol_reestimation) and [](#use_cases_macro_sensitivity_sobol_load_file)) while the tds contains is exported (only the $M$ and $N$ matrices content) to be also used in another macro ([](#use_cases_macro_sensitivity_sobol_data)) : ``` ```{only} py Data are exported from the {{tds}} to an ASCII file: ``` {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc5[language] + "\n" + "```" }} ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sobol/sensitivitySobolFunctionFlowrate.png\n" + ":align: center\n" + ":name: use_cases_sensitivitySobolFunctionFlowrate\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"sensitivitySobolFunctionFlowrate." + extension + "\"**" + "\n" + "```" }} ```{raw} latex \begin{landscape} ``` (use_cases_macro_sensitivity_sobol_console)= ## Console {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolFunctionFlowrate_clean.log" + "\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }} ```{raw} latex \end{landscape} ```