--- myst: substitutions: macro: python: 1-5,18-34,37-51 cpp: 6-8,12-27,30-44,56 bloc1: python: "19" cpp: "12" bloc2: python: 21-30 cpp: 14-23 bloc3: python: 33-34,37-41 cpp: 26-27,30-34 bloc4: python: "44" cpp: "37" bloc5: python: "45" cpp: "38" console: python: 2-18 cpp: 6-22 --- # Macro "**sensitivitySobolRankFunctionFlowrate.{{extension}}**" ## Objective The objective of this macro is to perform a sensitivity analysis using the SobolRank method on a set of eight parameters used in the `flowrateModel` model described in [](#launcher_introduction_simple_case_problem). ## Macro {{uranie}} {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolRankFunctionFlowrate." + 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 + "/sensitivitySobolRankFunctionFlowrate." + 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 + "/sensitivitySobolRankFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} SobolRank does not need a specific DOE, it works with a given sample. We generate a sample with `TSampling` and we evaluate it using `TLauncherFunction` {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolRankFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} To instantiate the `TSobolRank` object, one uses the {{tds}}, the name of the input and output variables: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolRankFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + "```" }} Computation of sensitivity indexes: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolRankFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc5[language] + "\n" + "```" }} It will produce one plot containing the first Sobol indices. The console is also shown below for completness. ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sobol_rank/sensitivitySobolRankFunctionFlowrate.png\n" + ":align: center\n" + ":name: use_cases_sensitivitySobolRankFunctionFlowrate\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"sensitivitySobolRankFunctionFlowrate." + extension + "\"**" + "\n" + "```" }} ## Console {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sensitivitySobolRankFunctionFlowrate_clean.log" + "\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }}