sampling module¶
Sampling for multidisciplinary design problems under uncertainty.
[Sampling][gemseo_umdo.formulations.sampling.Sampling] is an [UMDOFormulation][gemseo_umdo.formulations.formulation.UMDOFormulation] estimating the statistics with (quasi) Monte Carlo techniques.
E.g. $mathbb{E}[f(x,U)] approx frac{1}{N}sum_{i=1}^N fleft(x,U^{(i)}right)$ or $mathbb{V}[f(x,U)] approx frac{1}{N}sum_{i=1}^N left(fleft(x,U^{(i)}right)- frac{1}{N}sum_{j=1}^N fleft(x,U^{(j)}right)right)^2$ where $U$ is normally distributed with mean $mu$ and variance $sigma^2$ and $U^{(1)},ldots,U^{(N)}$ are $N$ realizations of $U$ obtained with an optimized Latin hypercube sampling technique.
- class gemseo_umdo.formulations.sampling.Sampling(disciplines, objective_name, design_space, mdo_formulation, uncertain_space, objective_statistic_name, n_samples, objective_statistic_parameters=None, maximize_objective=False, grammar_type=GrammarType.JSON, algo='OT_OPT_LHS', algo_options=None, seed=1, **options)[source]
Bases:
UMDOFormulationSampling-based robust MDO formulation.
- Parameters:
disciplines (Sequence[MDODiscipline]) – The disciplines.
objective_name (str) – The name(s) of the discipline output(s) used as objective. If multiple names are passed, the objective will be a vector.
design_space (DesignSpace) – The design space.
mdo_formulation (MDOFormulation) – The class name of the MDO formulation, e.g. “MDF”.
uncertain_space (ParameterSpace) – The uncertain variables with their probability distributions.
objective_statistic_name (str) – The name of the statistic to be applied to the objective.
n_samples (int) – The number of samples, i.e. the size of the DOE.
objective_statistic_parameters (Mapping[str, Any] | None) – The values of the parameters of the statistic to be applied to the objective, if any.
maximize_objective (bool) –
Whether to maximize the objective.
By default it is set to False.
grammar_type (MDODiscipline.GrammarType) –
The type of the input and output grammars.
By default it is set to “JSONGrammar”.
algo (str) –
The name of the DOE algorithm.
By default it is set to “OT_OPT_LHS”.
algo_options (Mapping[str, Any] | None) – The options of the DOE algorithm.
seed (int) –
The description is missing.
By default it is set to 1.
**options (Any) – The options of the formulation.
- compute_samples(problem)[source]
Evaluate the functions of a problem with a DOE algorithm.
- Parameters:
problem (OptimizationProblem) – The problem.
- Return type:
None
- opt_problem: OptimizationProblem
The optimization problem generated by the formulation from the disciplines.