Parameter space#

In this example, we will see the basics of ParameterSpace.

from __future__ import annotations

from gemseo import configure_logger
from gemseo import create_discipline
from gemseo import create_scenario
from gemseo.algos.parameter_space import ParameterSpace
from gemseo.post.dataset.scatter_plot_matrix import ScatterMatrix

configure_logger()
<RootLogger root (INFO)>

Firstly, a ParameterSpace does not require any mandatory argument.

Create a parameter space#

parameter_space = ParameterSpace()

Then, we can add either deterministic variables from their lower and upper bounds (use ParameterSpace.add_variable()):

parameter_space.add_variable("x", lower_bound=-2.0, upper_bound=2.0)

or uncertain variables from their distribution names and parameters (use ParameterSpace.add_random_variable()):

parameter_space.add_random_variable("y", "SPNormalDistribution", mu=0.0, sigma=1.0)
parameter_space
Parameter space:
Name Lower bound Value Upper bound Type Distribution
x -2 None 2 float
y -inf 0 inf float norm(mu=0.0, sigma=1.0)


Warning

We cannot mix probability distributions from different families, e.g. an OTDistribution and a SPDistribution.

We can check that the variables x and y are implemented as deterministic and uncertain variables respectively:

parameter_space.is_deterministic("x"), parameter_space.is_uncertain("y")
(True, True)

Note that when GEMSEO does not offer a class for the SciPy distribution, we can use the generic GEMSEO class SPDistribution to create any SciPy distribution by setting interfaced_distribution to its SciPy name and parameters as a dictionary of SciPy parameter names and values (see the documentation of SciPy).

# parameter_space.add_random_variable(
#     "y",
#     "SPDistribution",
#     interfaced_distribution="norm",
#     parameters={"loc": 1.0, "scale": 2.0},
# )

A similar procedure can be followed for OpenTURNS distributions for which GEMSEO does not offer a class directly. We can use the generic GEMSEO class OTDistribution to create any OpenTURNS distribution by setting interfaced_distribution to its OpenTURNS name and parameters as a tuple of OpenTURNS parameter values (see the documentation of OpenTURNS).

# parameter_space.add_random_variable(
#     "y",
#     "OTDistribution",
#     interfaced_distribution="Normal",
#     parameters=(1.0, 2.0),
# )

Sample from the parameter space#

We can sample the uncertain variables from the ParameterSpace and get values either as an array (default value):

sample = parameter_space.compute_samples(n_samples=2, as_dict=True)
sample
[{'y': array([-0.42714971])}, {'y': array([0.43695646])}]

or as a dictionary:

sample = parameter_space.compute_samples(n_samples=4)
sample
array([[1.31165494],
       [0.70986137],
       [0.36095451],
       [0.48890063]])

Sample a discipline over the parameter space#

We can also sample a discipline over the parameter space. For simplicity, we instantiate an AnalyticDiscipline from a dictionary of expressions.

discipline = create_discipline("AnalyticDiscipline", expressions={"z": "x+y"})

From these parameter space and discipline, we build a DOEScenario and execute it with a Latin Hypercube Sampling algorithm and 100 samples.

Warning

A Scenario deals with all variables available in the DesignSpace. By inheritance, a DOEScenario deals with all variables available in the ParameterSpace. Thus, if we do not filter the uncertain variables, the DOEScenario will consider all variables. In particular, the deterministic variables will be considered as uniformly distributed.

scenario = create_scenario(
    [discipline],
    "z",
    parameter_space,
    scenario_type="DOE",
    formulation_name="DisciplinaryOpt",
)
scenario.execute(algo_name="PYDOE_LHS", n_samples=100)
INFO - 08:38:25:
INFO - 08:38:25: *** Start DOEScenario execution ***
INFO - 08:38:25: DOEScenario
INFO - 08:38:25:    Disciplines: AnalyticDiscipline
INFO - 08:38:25:    MDO formulation: DisciplinaryOpt
INFO - 08:38:25: Optimization problem:
INFO - 08:38:25:    minimize z(x, y)
INFO - 08:38:25:    with respect to x, y
INFO - 08:38:25:    over the design space:
INFO - 08:38:25:       +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:38:25:       | Name | Lower bound | Value | Upper bound | Type  |       Distribution      |
INFO - 08:38:25:       +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:38:25:       | x    |      -2     |  None |      2      | float |                         |
INFO - 08:38:25:       | y    |     -inf    |   0   |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:38:25:       +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:38:25: Solving optimization problem with algorithm PYDOE_LHS:
INFO - 08:38:26:      1%|          | 1/100 [00:00<00:00, 439.84 it/sec, obj=3.12]
INFO - 08:38:26:      2%|▏         | 2/100 [00:00<00:00, 718.26 it/sec, obj=1.72]
INFO - 08:38:26:      3%|▎         | 3/100 [00:00<00:00, 933.10 it/sec, obj=0.181]
INFO - 08:38:26:      4%|▍         | 4/100 [00:00<00:00, 1102.89 it/sec, obj=3.76]
INFO - 08:38:26:      5%|▌         | 5/100 [00:00<00:00, 1239.23 it/sec, obj=2.15]
INFO - 08:38:26:      6%|▌         | 6/100 [00:00<00:00, 1345.26 it/sec, obj=-0.666]
INFO - 08:38:26:      7%|▋         | 7/100 [00:00<00:00, 1435.00 it/sec, obj=1.53]
INFO - 08:38:26:      8%|▊         | 8/100 [00:00<00:00, 1514.80 it/sec, obj=1.7]
INFO - 08:38:26:      9%|▉         | 9/100 [00:00<00:00, 1581.89 it/sec, obj=-2.27]
INFO - 08:38:26:     10%|█         | 10/100 [00:00<00:00, 1639.87 it/sec, obj=-2.08]
INFO - 08:38:26:     11%|█         | 11/100 [00:00<00:00, 1691.13 it/sec, obj=-2.8]
INFO - 08:38:26:     12%|█▏        | 12/100 [00:00<00:00, 1729.13 it/sec, obj=-1.31]
INFO - 08:38:26:     13%|█▎        | 13/100 [00:00<00:00, 1768.83 it/sec, obj=1.1]
INFO - 08:38:26:     14%|█▍        | 14/100 [00:00<00:00, 1805.28 it/sec, obj=0.38]
INFO - 08:38:26:     15%|█▌        | 15/100 [00:00<00:00, 1835.58 it/sec, obj=1.68]
INFO - 08:38:26:     16%|█▌        | 16/100 [00:00<00:00, 1864.76 it/sec, obj=0.672]
INFO - 08:38:26:     17%|█▋        | 17/100 [00:00<00:00, 1891.08 it/sec, obj=0.643]
INFO - 08:38:26:     18%|█▊        | 18/100 [00:00<00:00, 1916.23 it/sec, obj=0.568]
INFO - 08:38:26:     19%|█▉        | 19/100 [00:00<00:00, 1939.44 it/sec, obj=-0.277]
INFO - 08:38:26:     20%|██        | 20/100 [00:00<00:00, 1961.24 it/sec, obj=1.51]
INFO - 08:38:26:     21%|██        | 21/100 [00:00<00:00, 1980.85 it/sec, obj=1.83]
INFO - 08:38:26:     22%|██▏       | 22/100 [00:00<00:00, 1993.36 it/sec, obj=2.12]
INFO - 08:38:26:     23%|██▎       | 23/100 [00:00<00:00, 2010.27 it/sec, obj=0.526]
INFO - 08:38:26:     24%|██▍       | 24/100 [00:00<00:00, 2026.72 it/sec, obj=1.47]
INFO - 08:38:26:     25%|██▌       | 25/100 [00:00<00:00, 2038.96 it/sec, obj=-1.49]
INFO - 08:38:26:     26%|██▌       | 26/100 [00:00<00:00, 2052.12 it/sec, obj=-1.58]
INFO - 08:38:26:     27%|██▋       | 27/100 [00:00<00:00, 2064.99 it/sec, obj=1.59]
INFO - 08:38:26:     28%|██▊       | 28/100 [00:00<00:00, 2077.12 it/sec, obj=0.329]
INFO - 08:38:26:     29%|██▉       | 29/100 [00:00<00:00, 2088.76 it/sec, obj=-1.46]
INFO - 08:38:26:     30%|███       | 30/100 [00:00<00:00, 2099.46 it/sec, obj=-0.045]
INFO - 08:38:26:     31%|███       | 31/100 [00:00<00:00, 2106.70 it/sec, obj=-0.736]
INFO - 08:38:26:     32%|███▏      | 32/100 [00:00<00:00, 2115.40 it/sec, obj=0.867]
INFO - 08:38:26:     33%|███▎      | 33/100 [00:00<00:00, 2124.12 it/sec, obj=-3.12]
INFO - 08:38:26:     34%|███▍      | 34/100 [00:00<00:00, 2132.69 it/sec, obj=-0.252]
INFO - 08:38:26:     35%|███▌      | 35/100 [00:00<00:00, 2138.86 it/sec, obj=1.46]
INFO - 08:38:26:     36%|███▌      | 36/100 [00:00<00:00, 2146.55 it/sec, obj=-2.02]
INFO - 08:38:26:     37%|███▋      | 37/100 [00:00<00:00, 2154.06 it/sec, obj=-1.68]
INFO - 08:38:26:     38%|███▊      | 38/100 [00:00<00:00, 2161.54 it/sec, obj=-0.913]
INFO - 08:38:26:     39%|███▉      | 39/100 [00:00<00:00, 2168.55 it/sec, obj=-2.38]
INFO - 08:38:26:     40%|████      | 40/100 [00:00<00:00, 2175.44 it/sec, obj=1.07]
INFO - 08:38:26:     41%|████      | 41/100 [00:00<00:00, 2179.05 it/sec, obj=3.77]
INFO - 08:38:26:     42%|████▏     | 42/100 [00:00<00:00, 2172.38 it/sec, obj=-1.88]
INFO - 08:38:26:     43%|████▎     | 43/100 [00:00<00:00, 2176.60 it/sec, obj=0.116]
INFO - 08:38:26:     44%|████▍     | 44/100 [00:00<00:00, 2180.46 it/sec, obj=-1.51]
INFO - 08:38:26:     45%|████▌     | 45/100 [00:00<00:00, 2185.37 it/sec, obj=-0.0194]
INFO - 08:38:26:     46%|████▌     | 46/100 [00:00<00:00, 2190.51 it/sec, obj=0.984]
INFO - 08:38:26:     47%|████▋     | 47/100 [00:00<00:00, 2195.73 it/sec, obj=-0.34]
INFO - 08:38:26:     48%|████▊     | 48/100 [00:00<00:00, 2200.31 it/sec, obj=-0.941]
INFO - 08:38:26:     49%|████▉     | 49/100 [00:00<00:00, 2204.97 it/sec, obj=0.363]
INFO - 08:38:26:     50%|█████     | 50/100 [00:00<00:00, 2209.41 it/sec, obj=-1.01]
INFO - 08:38:26:     51%|█████     | 51/100 [00:00<00:00, 2211.32 it/sec, obj=-0.359]
INFO - 08:38:26:     52%|█████▏    | 52/100 [00:00<00:00, 2215.47 it/sec, obj=-3.06]
INFO - 08:38:26:     53%|█████▎    | 53/100 [00:00<00:00, 2219.43 it/sec, obj=2.34]
INFO - 08:38:26:     54%|█████▍    | 54/100 [00:00<00:00, 2221.71 it/sec, obj=-0.262]
INFO - 08:38:26:     55%|█████▌    | 55/100 [00:00<00:00, 2225.27 it/sec, obj=0.812]
INFO - 08:38:26:     56%|█████▌    | 56/100 [00:00<00:00, 2229.02 it/sec, obj=-2.47]
INFO - 08:38:26:     57%|█████▋    | 57/100 [00:00<00:00, 2232.95 it/sec, obj=1.49]
INFO - 08:38:26:     58%|█████▊    | 58/100 [00:00<00:00, 2236.63 it/sec, obj=0.268]
INFO - 08:38:26:     59%|█████▉    | 59/100 [00:00<00:00, 2240.41 it/sec, obj=0.559]
INFO - 08:38:26:     60%|██████    | 60/100 [00:00<00:00, 2241.76 it/sec, obj=-2.01]
INFO - 08:38:26:     61%|██████    | 61/100 [00:00<00:00, 2244.66 it/sec, obj=-0.854]
INFO - 08:38:26:     62%|██████▏   | 62/100 [00:00<00:00, 2247.93 it/sec, obj=1.61]
INFO - 08:38:26:     63%|██████▎   | 63/100 [00:00<00:00, 2251.12 it/sec, obj=-2.64]
INFO - 08:38:26:     64%|██████▍   | 64/100 [00:00<00:00, 2252.75 it/sec, obj=0.818]
INFO - 08:38:26:     65%|██████▌   | 65/100 [00:00<00:00, 2255.62 it/sec, obj=1.04]
INFO - 08:38:26:     66%|██████▌   | 66/100 [00:00<00:00, 2258.59 it/sec, obj=-0.832]
INFO - 08:38:26:     67%|██████▋   | 67/100 [00:00<00:00, 2261.50 it/sec, obj=0.692]
INFO - 08:38:26:     68%|██████▊   | 68/100 [00:00<00:00, 2264.26 it/sec, obj=-3.33]
INFO - 08:38:26:     69%|██████▉   | 69/100 [00:00<00:00, 2267.08 it/sec, obj=0.47]
INFO - 08:38:26:     70%|███████   | 70/100 [00:00<00:00, 2267.70 it/sec, obj=0.445]
INFO - 08:38:26:     71%|███████   | 71/100 [00:00<00:00, 2269.89 it/sec, obj=0.402]
INFO - 08:38:26:     72%|███████▏  | 72/100 [00:00<00:00, 2272.41 it/sec, obj=2.77]
INFO - 08:38:26:     73%|███████▎  | 73/100 [00:00<00:00, 2274.11 it/sec, obj=-0.256]
INFO - 08:38:26:     74%|███████▍  | 74/100 [00:00<00:00, 2275.90 it/sec, obj=3.36]
INFO - 08:38:26:     75%|███████▌  | 75/100 [00:00<00:00, 2278.18 it/sec, obj=-0.229]
INFO - 08:38:26:     76%|███████▌  | 76/100 [00:00<00:00, 2280.56 it/sec, obj=-0.739]
INFO - 08:38:26:     77%|███████▋  | 77/100 [00:00<00:00, 2282.67 it/sec, obj=0.808]
INFO - 08:38:26:     78%|███████▊  | 78/100 [00:00<00:00, 2284.85 it/sec, obj=-0.377]
INFO - 08:38:26:     79%|███████▉  | 79/100 [00:00<00:00, 2287.14 it/sec, obj=0.708]
INFO - 08:38:26:     80%|████████  | 80/100 [00:00<00:00, 2286.66 it/sec, obj=-0.874]
INFO - 08:38:26:     81%|████████  | 81/100 [00:00<00:00, 2288.34 it/sec, obj=-1.29]
INFO - 08:38:26:     82%|████████▏ | 82/100 [00:00<00:00, 2290.03 it/sec, obj=0.505]
INFO - 08:38:26:     83%|████████▎ | 83/100 [00:00<00:00, 2291.08 it/sec, obj=1.99]
INFO - 08:38:26:     84%|████████▍ | 84/100 [00:00<00:00, 2292.80 it/sec, obj=0.574]
INFO - 08:38:26:     85%|████████▌ | 85/100 [00:00<00:00, 2294.65 it/sec, obj=-2.06]
INFO - 08:38:26:     86%|████████▌ | 86/100 [00:00<00:00, 2296.33 it/sec, obj=-1.49]
INFO - 08:38:26:     87%|████████▋ | 87/100 [00:00<00:00, 2298.28 it/sec, obj=0.61]
INFO - 08:38:26:     88%|████████▊ | 88/100 [00:00<00:00, 2300.25 it/sec, obj=0.542]
INFO - 08:38:26:     89%|████████▉ | 89/100 [00:00<00:00, 2300.98 it/sec, obj=-1.5]
INFO - 08:38:26:     90%|█████████ | 90/100 [00:00<00:00, 2302.09 it/sec, obj=0.201]
INFO - 08:38:26:     91%|█████████ | 91/100 [00:00<00:00, 2301.60 it/sec, obj=0.949]
INFO - 08:38:26:     92%|█████████▏| 92/100 [00:00<00:00, 2302.84 it/sec, obj=-1.86]
INFO - 08:38:26:     93%|█████████▎| 93/100 [00:00<00:00, 2303.39 it/sec, obj=-0.0722]
INFO - 08:38:26:     94%|█████████▍| 94/100 [00:00<00:00, 2304.97 it/sec, obj=-0.407]
INFO - 08:38:26:     95%|█████████▌| 95/100 [00:00<00:00, 2306.64 it/sec, obj=0.194]
INFO - 08:38:26:     96%|█████████▌| 96/100 [00:00<00:00, 2308.28 it/sec, obj=-0.207]
INFO - 08:38:26:     97%|█████████▋| 97/100 [00:00<00:00, 2309.68 it/sec, obj=0.462]
INFO - 08:38:26:     98%|█████████▊| 98/100 [00:00<00:00, 2311.16 it/sec, obj=-2.37]
INFO - 08:38:26:     99%|█████████▉| 99/100 [00:00<00:00, 2311.04 it/sec, obj=1.32]
INFO - 08:38:26:    100%|██████████| 100/100 [00:00<00:00, 2312.16 it/sec, obj=-2.21]
INFO - 08:38:26: Optimization result:
INFO - 08:38:26:    Optimizer info:
INFO - 08:38:26:       Status: None
INFO - 08:38:26:       Message: None
INFO - 08:38:26:       Number of calls to the objective function by the optimizer: 100
INFO - 08:38:26:    Solution:
INFO - 08:38:26:       Objective: -3.3284373246961634
INFO - 08:38:26:       Design space:
INFO - 08:38:26:          +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:38:26:          | Name | Lower bound |       Value        | Upper bound | Type  |       Distribution      |
INFO - 08:38:26:          +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:38:26:          | x    |      -2     | -1.959995425007306 |      2      | float |                         |
INFO - 08:38:26:          | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:38:26:          +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:38:26: *** End DOEScenario execution (time: 0:00:00.059892) ***

We can visualize the result by encapsulating the database in a Dataset:

dataset = scenario.to_dataset(opt_naming=False)

This visualization can be tabular for example:

dataset
GROUP inputs outputs
VARIABLE x y z
COMPONENT 0 0 0
0 1.869403 1.246453 3.115855
1 -1.567970 3.285041 1.717071
2 0.282640 -0.101706 0.180934
3 1.916313 1.848317 3.764630
4 1.562653 0.586038 2.148691
... ... ... ...
95 0.120633 -0.327477 -0.206844
96 -0.999225 1.461403 0.462178
97 -1.396066 -0.972779 -2.368845
98 1.090093 0.225565 1.315658
99 -1.433207 -0.779330 -2.212536

100 rows × 3 columns



or graphical by means of a scatter plot matrix for example:

ScatterMatrix(dataset).execute(save=False, show=True)
plot parameter space
[<Figure size 640x480 with 9 Axes>]

Sample a discipline over the uncertain space#

If we want to sample a discipline over the uncertain space, we need to filter the uncertain variables:

parameter_space.filter(parameter_space.uncertain_variables)
Parameter space:
Name Lower bound Value Upper bound Type Distribution
y -inf -1.368441899688857 inf float norm(mu=0.0, sigma=1.0)


Then, we create a new scenario from this parameter space containing only the uncertain variables and execute it.

scenario = create_scenario(
    [discipline],
    "z",
    parameter_space,
    scenario_type="DOE",
    formulation_name="DisciplinaryOpt",
)
scenario.execute(algo_name="PYDOE_LHS", n_samples=100)
INFO - 08:38:26:
INFO - 08:38:26: *** Start DOEScenario execution ***
INFO - 08:38:26: DOEScenario
INFO - 08:38:26:    Disciplines: AnalyticDiscipline
INFO - 08:38:26:    MDO formulation: DisciplinaryOpt
INFO - 08:38:26: Optimization problem:
INFO - 08:38:26:    minimize z(y)
INFO - 08:38:26:    with respect to y
INFO - 08:38:26:    over the design space:
INFO - 08:38:26:       +------+-------------------------+
INFO - 08:38:26:       | Name |       Distribution      |
INFO - 08:38:26:       +------+-------------------------+
INFO - 08:38:26:       |  y   | norm(mu=0.0, sigma=1.0) |
INFO - 08:38:26:       +------+-------------------------+
INFO - 08:38:26: Solving optimization problem with algorithm PYDOE_LHS:
INFO - 08:38:26:      1%|          | 1/100 [00:00<00:00, 2437.13 it/sec, obj=-0.641]
INFO - 08:38:26:      2%|▏         | 2/100 [00:00<00:00, 2337.96 it/sec, obj=-0.394]
INFO - 08:38:26:      3%|▎         | 3/100 [00:00<00:00, 2333.63 it/sec, obj=0.551]
INFO - 08:38:26:      4%|▍         | 4/100 [00:00<00:00, 2341.22 it/sec, obj=0.944]
INFO - 08:38:26:      5%|▌         | 5/100 [00:00<00:00, 2343.71 it/sec, obj=-2.12]
INFO - 08:38:26:      6%|▌         | 6/100 [00:00<00:00, 2345.81 it/sec, obj=-1.64]
INFO - 08:38:26:      7%|▋         | 7/100 [00:00<00:00, 2338.71 it/sec, obj=0.656]
INFO - 08:38:26:      8%|▊         | 8/100 [00:00<00:00, 2350.74 it/sec, obj=-0.612]
INFO - 08:38:26:      9%|▉         | 9/100 [00:00<00:00, 2352.39 it/sec, obj=0.736]
INFO - 08:38:26:     10%|█         | 10/100 [00:00<00:00, 2340.83 it/sec, obj=0.36]
INFO - 08:38:26:     11%|█         | 11/100 [00:00<00:00, 2346.52 it/sec, obj=-0.31]
INFO - 08:38:26:     12%|█▏        | 12/100 [00:00<00:00, 2352.94 it/sec, obj=0.324]
INFO - 08:38:26:     13%|█▎        | 13/100 [00:00<00:00, 2350.76 it/sec, obj=-1.73]
INFO - 08:38:26:     14%|█▍        | 14/100 [00:00<00:00, 2355.41 it/sec, obj=0.494]
INFO - 08:38:26:     15%|█▌        | 15/100 [00:00<00:00, 2360.86 it/sec, obj=-0.148]
INFO - 08:38:26:     16%|█▌        | 16/100 [00:00<00:00, 2365.82 it/sec, obj=1.1]
INFO - 08:38:26:     17%|█▋        | 17/100 [00:00<00:00, 2370.92 it/sec, obj=-0.716]
INFO - 08:38:26:     18%|█▊        | 18/100 [00:00<00:00, 2375.18 it/sec, obj=0.0421]
INFO - 08:38:26:     19%|█▉        | 19/100 [00:00<00:00, 2369.95 it/sec, obj=0.256]
INFO - 08:38:26:     20%|██        | 20/100 [00:00<00:00, 2371.40 it/sec, obj=-1.45]
INFO - 08:38:26:     21%|██        | 21/100 [00:00<00:00, 2374.52 it/sec, obj=0.637]
INFO - 08:38:26:     22%|██▏       | 22/100 [00:00<00:00, 2373.01 it/sec, obj=1.97]
INFO - 08:38:26:     23%|██▎       | 23/100 [00:00<00:00, 2372.93 it/sec, obj=-0.208]
INFO - 08:38:26:     24%|██▍       | 24/100 [00:00<00:00, 2374.36 it/sec, obj=0.18]
INFO - 08:38:26:     25%|██▌       | 25/100 [00:00<00:00, 2375.95 it/sec, obj=0.000485]
INFO - 08:38:26:     26%|██▌       | 26/100 [00:00<00:00, 2377.31 it/sec, obj=1.17]
INFO - 08:38:26:     27%|██▋       | 27/100 [00:00<00:00, 2378.32 it/sec, obj=-0.305]
INFO - 08:38:26:     28%|██▊       | 28/100 [00:00<00:00, 2379.70 it/sec, obj=0.68]
INFO - 08:38:26:     29%|██▉       | 29/100 [00:00<00:00, 2374.98 it/sec, obj=-0.932]
INFO - 08:38:26:     30%|███       | 30/100 [00:00<00:00, 2376.38 it/sec, obj=0.901]
INFO - 08:38:26:     31%|███       | 31/100 [00:00<00:00, 2377.77 it/sec, obj=0.454]
INFO - 08:38:26:     32%|███▏      | 32/100 [00:00<00:00, 2376.46 it/sec, obj=-1.16]
INFO - 08:38:26:     33%|███▎      | 33/100 [00:00<00:00, 2377.11 it/sec, obj=1.44]
INFO - 08:38:26:     34%|███▍      | 34/100 [00:00<00:00, 2378.36 it/sec, obj=0.798]
INFO - 08:38:26:     35%|███▌      | 35/100 [00:00<00:00, 2379.69 it/sec, obj=1.59]
INFO - 08:38:26:     36%|███▌      | 36/100 [00:00<00:00, 2381.40 it/sec, obj=2.05]
INFO - 08:38:26:     37%|███▋      | 37/100 [00:00<00:00, 2382.94 it/sec, obj=-0.26]
INFO - 08:38:26:     38%|███▊      | 38/100 [00:00<00:00, 2380.49 it/sec, obj=0.874]
INFO - 08:38:26:     39%|███▉      | 39/100 [00:00<00:00, 2380.66 it/sec, obj=0.832]
INFO - 08:38:26:     40%|████      | 40/100 [00:00<00:00, 2381.91 it/sec, obj=-1.38]
INFO - 08:38:26:     41%|████      | 41/100 [00:00<00:00, 2383.00 it/sec, obj=1.52]
INFO - 08:38:26:     42%|████▏     | 42/100 [00:00<00:00, 2381.52 it/sec, obj=-0.522]
INFO - 08:38:26:     43%|████▎     | 43/100 [00:00<00:00, 2382.21 it/sec, obj=1.4]
INFO - 08:38:26:     44%|████▍     | 44/100 [00:00<00:00, 2382.91 it/sec, obj=-0.484]
INFO - 08:38:26:     45%|████▌     | 45/100 [00:00<00:00, 2383.64 it/sec, obj=-0.91]
INFO - 08:38:26:     46%|████▌     | 46/100 [00:00<00:00, 2384.63 it/sec, obj=0.343]
INFO - 08:38:26:     47%|████▋     | 47/100 [00:00<00:00, 2385.98 it/sec, obj=-0.441]
INFO - 08:38:26:     48%|████▊     | 48/100 [00:00<00:00, 2383.92 it/sec, obj=-0.871]
INFO - 08:38:26:     49%|████▉     | 49/100 [00:00<00:00, 2384.62 it/sec, obj=2.67]
INFO - 08:38:26:     50%|█████     | 50/100 [00:00<00:00, 2385.76 it/sec, obj=0.217]
INFO - 08:38:26:     51%|█████     | 51/100 [00:00<00:00, 2384.91 it/sec, obj=-0.425]
INFO - 08:38:26:     52%|█████▏    | 52/100 [00:00<00:00, 2385.13 it/sec, obj=0.113]
INFO - 08:38:26:     53%|█████▎    | 53/100 [00:00<00:00, 2385.51 it/sec, obj=-0.377]
INFO - 08:38:26:     54%|█████▍    | 54/100 [00:00<00:00, 2386.34 it/sec, obj=-1.19]
INFO - 08:38:26:     55%|█████▌    | 55/100 [00:00<00:00, 2387.00 it/sec, obj=-0.528]
INFO - 08:38:26:     56%|█████▌    | 56/100 [00:00<00:00, 2387.90 it/sec, obj=-2.64]
INFO - 08:38:26:     57%|█████▋    | 57/100 [00:00<00:00, 2371.38 it/sec, obj=-0.0776]
INFO - 08:38:26:     58%|█████▊    | 58/100 [00:00<00:00, 2371.00 it/sec, obj=1.08]
INFO - 08:38:26:     59%|█████▉    | 59/100 [00:00<00:00, 2371.78 it/sec, obj=-2.05]
INFO - 08:38:26:     60%|██████    | 60/100 [00:00<00:00, 2371.45 it/sec, obj=0.0555]
INFO - 08:38:26:     61%|██████    | 61/100 [00:00<00:00, 2371.60 it/sec, obj=-1.84]
INFO - 08:38:26:     62%|██████▏   | 62/100 [00:00<00:00, 2372.69 it/sec, obj=0.4]
INFO - 08:38:26:     63%|██████▎   | 63/100 [00:00<00:00, 2373.64 it/sec, obj=-0.195]
INFO - 08:38:26:     64%|██████▍   | 64/100 [00:00<00:00, 2374.32 it/sec, obj=-0.578]
INFO - 08:38:26:     65%|██████▌   | 65/100 [00:00<00:00, 2375.22 it/sec, obj=-0.977]
INFO - 08:38:26:     66%|██████▌   | 66/100 [00:00<00:00, 2376.07 it/sec, obj=-0.114]
INFO - 08:38:26:     67%|██████▋   | 67/100 [00:00<00:00, 2374.01 it/sec, obj=0.587]
INFO - 08:38:26:     68%|██████▊   | 68/100 [00:00<00:00, 2374.62 it/sec, obj=-0.0679]
INFO - 08:38:26:     69%|██████▉   | 69/100 [00:00<00:00, 2375.48 it/sec, obj=-0.0218]
INFO - 08:38:26:     70%|███████   | 70/100 [00:00<00:00, 2374.76 it/sec, obj=-0.228]
INFO - 08:38:26:     71%|███████   | 71/100 [00:00<00:00, 2375.37 it/sec, obj=1.21]
INFO - 08:38:26:     72%|███████▏  | 72/100 [00:00<00:00, 2376.08 it/sec, obj=-0.34]
INFO - 08:38:26:     73%|███████▎  | 73/100 [00:00<00:00, 2376.89 it/sec, obj=0.513]
INFO - 08:38:26:     74%|███████▍  | 74/100 [00:00<00:00, 2377.71 it/sec, obj=1.67]
INFO - 08:38:26:     75%|███████▌  | 75/100 [00:00<00:00, 2378.46 it/sec, obj=0.557]
INFO - 08:38:26:     76%|███████▌  | 76/100 [00:00<00:00, 2376.85 it/sec, obj=0.431]
INFO - 08:38:26:     77%|███████▋  | 77/100 [00:00<00:00, 2376.81 it/sec, obj=-1.31]
INFO - 08:38:26:     78%|███████▊  | 78/100 [00:00<00:00, 2377.52 it/sec, obj=-0.678]
INFO - 08:38:26:     79%|███████▉  | 79/100 [00:00<00:00, 2378.10 it/sec, obj=-1.01]
INFO - 08:38:26:     80%|████████  | 80/100 [00:00<00:00, 2377.42 it/sec, obj=0.246]
INFO - 08:38:26:     81%|████████  | 81/100 [00:00<00:00, 2377.84 it/sec, obj=1.29]
INFO - 08:38:26:     82%|████████▏ | 82/100 [00:00<00:00, 2378.45 it/sec, obj=0.75]
INFO - 08:38:26:     83%|████████▎ | 83/100 [00:00<00:00, 2379.27 it/sec, obj=-1.54]
INFO - 08:38:26:     84%|████████▍ | 84/100 [00:00<00:00, 2380.00 it/sec, obj=-0.156]
INFO - 08:38:26:     85%|████████▌ | 85/100 [00:00<00:00, 2380.61 it/sec, obj=1.87]
INFO - 08:38:26:     86%|████████▌ | 86/100 [00:00<00:00, 2378.95 it/sec, obj=-1.08]
INFO - 08:38:26:     87%|████████▋ | 87/100 [00:00<00:00, 2379.37 it/sec, obj=-0.647]
INFO - 08:38:26:     88%|████████▊ | 88/100 [00:00<00:00, 2380.02 it/sec, obj=0.968]
INFO - 08:38:26:     89%|████████▉ | 89/100 [00:00<00:00, 2379.85 it/sec, obj=-0.773]
INFO - 08:38:26:     90%|█████████ | 90/100 [00:00<00:00, 2380.09 it/sec, obj=1.26]
INFO - 08:38:26:     91%|█████████ | 91/100 [00:00<00:00, 2380.57 it/sec, obj=0.166]
INFO - 08:38:26:     92%|█████████▏| 92/100 [00:00<00:00, 2381.20 it/sec, obj=0.29]
INFO - 08:38:26:     93%|█████████▎| 93/100 [00:00<00:00, 2381.76 it/sec, obj=0.127]
INFO - 08:38:26:     94%|█████████▍| 94/100 [00:00<00:00, 2382.36 it/sec, obj=-1.26]
INFO - 08:38:26:     95%|█████████▌| 95/100 [00:00<00:00, 2381.62 it/sec, obj=1.01]
INFO - 08:38:26:     96%|█████████▌| 96/100 [00:00<00:00, 2381.72 it/sec, obj=0.0819]
INFO - 08:38:26:     97%|█████████▋| 97/100 [00:00<00:00, 2382.22 it/sec, obj=-1.09]
INFO - 08:38:26:     98%|█████████▊| 98/100 [00:00<00:00, 2382.74 it/sec, obj=-0.762]
INFO - 08:38:26:     99%|█████████▉| 99/100 [00:00<00:00, 2382.25 it/sec, obj=-0.0429]
INFO - 08:38:26:    100%|██████████| 100/100 [00:00<00:00, 2382.63 it/sec, obj=-0.813]
INFO - 08:38:26: Optimization result:
INFO - 08:38:26:    Optimizer info:
INFO - 08:38:26:       Status: None
INFO - 08:38:26:       Message: None
INFO - 08:38:26:       Number of calls to the objective function by the optimizer: 100
INFO - 08:38:26:    Solution:
INFO - 08:38:26:       Objective: -2.6379682068246657
INFO - 08:38:26:       Design space:
INFO - 08:38:26:          +------+-------------------------+
INFO - 08:38:26:          | Name |       Distribution      |
INFO - 08:38:26:          +------+-------------------------+
INFO - 08:38:26:          |  y   | norm(mu=0.0, sigma=1.0) |
INFO - 08:38:26:          +------+-------------------------+
INFO - 08:38:26: *** End DOEScenario execution (time: 0:00:00.057132) ***

Finally, we build a dataset from the disciplinary cache and visualize it. We can see that the deterministic variable 'x' is set to its default value for all evaluations, contrary to the previous case where we were considering the whole parameter space.

dataset = scenario.to_dataset(opt_naming=False)
dataset
GROUP inputs outputs
VARIABLE y z
COMPONENT 0 0
0 -0.640726 -0.640726
1 -0.393653 -0.393653
2 0.550565 0.550565
3 0.944369 0.944369
4 -2.115275 -2.115275
... ... ...
95 0.081947 0.081947
96 -1.085812 -1.085812
97 -0.761651 -0.761651
98 -0.042932 -0.042932
99 -0.813354 -0.813354

100 rows × 2 columns



Total running time of the script: (0 minutes 0.634 seconds)

Gallery generated by Sphinx-Gallery