--- myst: substitutions: macro: python: 1-5,19-38,42-49,52-55,58 cpp: 4-6,13-28,32-39,42-45,48 bloc1: python: "20" cpp: "13" bloc2: python: 22-31 cpp: 5,15-22 bloc3: python: 37-38 cpp: "28" bloc4: python: "42" cpp: "32" console: python: 2-33 cpp: 6-37 suffix: python: "_py" cpp: "" --- (use_cases_macro_sensitivity_johnson_rw)= # Macro "**sensitivityJohnsonRWFunctionFlowrate.{{extension}}**" ## Objective The objective of this macro is to perform a sensitivity analysis using the Johnson's relative weight method on a set of eight parameters used in the `flowrateModel` model described in [](#launcher_introduction_simple_case_problem). (use_cases_macro_sensitivity_johnson_rw_macro)= ## Macro {{uranie}} {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivityJohnsonRWFunctionFlowrate." + 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 + "/sensitivityJohnsonRWFunctionFlowrate." + 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 + "/sensitivityJohnsonRWFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} To instantiate the `TJohnsonRW` object, one uses the {{tds}}, the name of the function, the number of samplings needed to perform sensitivity analysis (here $n_S$ =4000) and the input and output variables: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivityJohnsonRWFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + "```" }} Computation of sensitivity indexes: {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/uranie/doc/sensitivity/use_cases/" + language + "/sensitivityJohnsonRWFunctionFlowrate." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + "```" }} The rest is very common to all sensitivity macros discussed here: it will produce two plots (the first one being a histogram show below) and the console is also shown below for completness. ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/johnson_rw/appliUranieFlowrateJohnsonRW1000Histogram" + suffix[language] + ".png\n" + ":align: center\n" + ":name: use_cases_sensitivityJohnsonRWFunctionFlowrate\n" + figure_scale + "\n" + "\n" + "Graph of the macro **\"sensitivityJohnsonRWFunctionFlowrate." + extension + "\"**" + "\n" + "```" }} ## Console {{ "```{" "literalinclude" "} " + parent_dir + "/roottest/build/uranie/doc/sensitivity/use_cases/" + language + "/sensitivityJohnsonRWFunctionFlowrate_clean.log" + "\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }}