# 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)>


## Create a parameter space¶

Firstly, the creation of a ParameterSpace does not require any mandatory argument:

parameter_space = ParameterSpace()


Then, we can add either deterministic variables from their lower and upper bounds (use ParameterSpace.add_variable()) or uncertain variables from their distribution names and parameters (use ParameterSpace.add_random_variable())

parameter_space.add_variable("x", l_b=-2.0, u_b=2.0)
parameter_space

Parameter space:
name lower_bound value upper_bound type Initial distribution
x -2 None 2 float
y -inf 0 inf float norm(mu=0.0, sigma=1.0)

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

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

(True, True)


## Sample from the parameter space¶

We can sample the uncertain variables from the ParameterSpace and get values either as a NumPy array (by default)

sample = parameter_space.compute_samples(n_samples=2, as_dict=True)
sample

[{'y': array([0.80969516])}, {'y': array([2.46015528])}]


or as a dictionary of NumPy arrays indexed by the names of the variables:

sample = parameter_space.compute_samples(n_samples=4)
sample

array([[0.36250283],
[0.70154774],
[0.34327059],
[0.39628863]])


## 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 DOEScenario considers all the variables available in its DesignSpace. By inheritance, in the special case of a ParameterSpace, a DOEScenario considers all the variables available in this ParameterSpace. Thus, if we do not filter the uncertain variables, the DOEScenario will consider both the deterministic variables as uniformly distributed variables and the uncertain variables with their specified probability distributions.

scenario = create_scenario(
[discipline], "DisciplinaryOpt", "z", parameter_space, scenario_type="DOE"
)
scenario.execute({"algo": "lhs", "n_samples": 100})

    INFO - 08:22:41:
INFO - 08:22:41: *** Start DOEScenario execution ***
INFO - 08:22:41: DOEScenario
INFO - 08:22:41:    Disciplines: AnalyticDiscipline
INFO - 08:22:41:    MDO formulation: DisciplinaryOpt
INFO - 08:22:41: Optimization problem:
INFO - 08:22:41:    minimize z(x, y)
INFO - 08:22:41:    with respect to x, y
INFO - 08:22:41:    over the design space:
INFO - 08:22:41:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:22:41:    | name | lower_bound | value | upper_bound | type  |   Initial distribution  |
INFO - 08:22:41:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:22:41:    | x    |      -2     |  None |      2      | float |                         |
INFO - 08:22:41:    | y    |     -inf    |   0   |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:22:41:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:22:41: Solving optimization problem with algorithm lhs:
INFO - 08:22:41: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 08:22:41: ...   1%|          | 1/100 [00:00<00:00, 368.41 it/sec, obj=3.12]
INFO - 08:22:41: ...   2%|▏         | 2/100 [00:00<00:00, 567.80 it/sec, obj=1.72]
INFO - 08:22:41: ...   3%|▎         | 3/100 [00:00<00:00, 721.46 it/sec, obj=0.181]
INFO - 08:22:41: ...   4%|▍         | 4/100 [00:00<00:00, 838.32 it/sec, obj=3.76]
INFO - 08:22:41: ...   5%|▌         | 5/100 [00:00<00:00, 929.55 it/sec, obj=2.15]
INFO - 08:22:41: ...   6%|▌         | 6/100 [00:00<00:00, 996.39 it/sec, obj=-.666]
INFO - 08:22:41: ...   7%|▋         | 7/100 [00:00<00:00, 1052.71 it/sec, obj=1.53]
INFO - 08:22:41: ...   8%|▊         | 8/100 [00:00<00:00, 1101.05 it/sec, obj=1.7]
INFO - 08:22:41: ...   9%|▉         | 9/100 [00:00<00:00, 1141.86 it/sec, obj=-2.27]
INFO - 08:22:41: ...  10%|█         | 10/100 [00:00<00:00, 1177.41 it/sec, obj=-2.08]
INFO - 08:22:41: ...  11%|█         | 11/100 [00:00<00:00, 1208.26 it/sec, obj=-2.8]
INFO - 08:22:41: ...  12%|█▏        | 12/100 [00:00<00:00, 1231.60 it/sec, obj=-1.31]
INFO - 08:22:41: ...  13%|█▎        | 13/100 [00:00<00:00, 1255.46 it/sec, obj=1.1]
INFO - 08:22:41: ...  14%|█▍        | 14/100 [00:00<00:00, 1271.28 it/sec, obj=0.38]
INFO - 08:22:41: ...  15%|█▌        | 15/100 [00:00<00:00, 1289.58 it/sec, obj=1.68]
INFO - 08:22:41: ...  16%|█▌        | 16/100 [00:00<00:00, 1307.09 it/sec, obj=0.672]
INFO - 08:22:41: ...  17%|█▋        | 17/100 [00:00<00:00, 1322.93 it/sec, obj=0.643]
INFO - 08:22:41: ...  18%|█▊        | 18/100 [00:00<00:00, 1335.08 it/sec, obj=0.568]
INFO - 08:22:41: ...  19%|█▉        | 19/100 [00:00<00:00, 1347.76 it/sec, obj=-.277]
INFO - 08:22:41: ...  20%|██        | 20/100 [00:00<00:00, 1358.28 it/sec, obj=1.51]
INFO - 08:22:41: ...  21%|██        | 21/100 [00:00<00:00, 1369.54 it/sec, obj=1.83]
INFO - 08:22:41: ...  22%|██▏       | 22/100 [00:00<00:00, 1380.12 it/sec, obj=2.12]
INFO - 08:22:41: ...  23%|██▎       | 23/100 [00:00<00:00, 1389.84 it/sec, obj=0.526]
INFO - 08:22:41: ...  24%|██▍       | 24/100 [00:00<00:00, 1398.72 it/sec, obj=1.47]
INFO - 08:22:41: ...  25%|██▌       | 25/100 [00:00<00:00, 1405.13 it/sec, obj=-1.49]
INFO - 08:22:41: ...  26%|██▌       | 26/100 [00:00<00:00, 1412.94 it/sec, obj=-1.58]
INFO - 08:22:41: ...  27%|██▋       | 27/100 [00:00<00:00, 1418.97 it/sec, obj=1.59]
INFO - 08:22:41: ...  28%|██▊       | 28/100 [00:00<00:00, 1425.65 it/sec, obj=0.329]
INFO - 08:22:41: ...  29%|██▉       | 29/100 [00:00<00:00, 1432.14 it/sec, obj=-1.46]
INFO - 08:22:41: ...  30%|███       | 30/100 [00:00<00:00, 1438.08 it/sec, obj=-.045]
INFO - 08:22:41: ...  31%|███       | 31/100 [00:00<00:00, 1442.24 it/sec, obj=-.736]
INFO - 08:22:41: ...  32%|███▏      | 32/100 [00:00<00:00, 1447.54 it/sec, obj=0.867]
INFO - 08:22:41: ...  33%|███▎      | 33/100 [00:00<00:00, 1451.58 it/sec, obj=-3.12]
INFO - 08:22:41: ...  34%|███▍      | 34/100 [00:00<00:00, 1456.39 it/sec, obj=-.252]
INFO - 08:22:41: ...  35%|███▌      | 35/100 [00:00<00:00, 1461.36 it/sec, obj=1.46]
INFO - 08:22:41: ...  36%|███▌      | 36/100 [00:00<00:00, 1466.20 it/sec, obj=-2.02]
INFO - 08:22:41: ...  37%|███▋      | 37/100 [00:00<00:00, 1470.43 it/sec, obj=-1.68]
INFO - 08:22:41: ...  38%|███▊      | 38/100 [00:00<00:00, 1472.88 it/sec, obj=-.913]
INFO - 08:22:41: ...  39%|███▉      | 39/100 [00:00<00:00, 1476.71 it/sec, obj=-2.38]
INFO - 08:22:41: ...  40%|████      | 40/100 [00:00<00:00, 1479.39 it/sec, obj=1.07]
INFO - 08:22:41: ...  41%|████      | 41/100 [00:00<00:00, 1483.01 it/sec, obj=3.77]
INFO - 08:22:41: ...  42%|████▏     | 42/100 [00:00<00:00, 1486.55 it/sec, obj=-1.88]
INFO - 08:22:41: ...  43%|████▎     | 43/100 [00:00<00:00, 1489.65 it/sec, obj=0.116]
INFO - 08:22:41: ...  44%|████▍     | 44/100 [00:00<00:00, 1490.96 it/sec, obj=-1.51]
INFO - 08:22:41: ...  45%|████▌     | 45/100 [00:00<00:00, 1493.71 it/sec, obj=-.0194]
INFO - 08:22:41: ...  46%|████▌     | 46/100 [00:00<00:00, 1495.75 it/sec, obj=0.984]
INFO - 08:22:41: ...  47%|████▋     | 47/100 [00:00<00:00, 1498.49 it/sec, obj=-.34]
INFO - 08:22:41: ...  48%|████▊     | 48/100 [00:00<00:00, 1501.26 it/sec, obj=-.941]
INFO - 08:22:41: ...  49%|████▉     | 49/100 [00:00<00:00, 1503.94 it/sec, obj=0.363]
INFO - 08:22:41: ...  50%|█████     | 50/100 [00:00<00:00, 1506.69 it/sec, obj=-1.01]
INFO - 08:22:41: ...  51%|█████     | 51/100 [00:00<00:00, 1508.20 it/sec, obj=-.359]
INFO - 08:22:41: ...  52%|█████▏    | 52/100 [00:00<00:00, 1509.87 it/sec, obj=-3.06]
INFO - 08:22:41: ...  53%|█████▎    | 53/100 [00:00<00:00, 1511.96 it/sec, obj=2.34]
INFO - 08:22:41: ...  54%|█████▍    | 54/100 [00:00<00:00, 1514.22 it/sec, obj=-.262]
INFO - 08:22:41: ...  55%|█████▌    | 55/100 [00:00<00:00, 1516.34 it/sec, obj=0.812]
INFO - 08:22:41: ...  56%|█████▌    | 56/100 [00:00<00:00, 1518.70 it/sec, obj=-2.47]
INFO - 08:22:41: ...  57%|█████▋    | 57/100 [00:00<00:00, 1519.93 it/sec, obj=1.49]
INFO - 08:22:41: ...  58%|█████▊    | 58/100 [00:00<00:00, 1521.94 it/sec, obj=0.268]
INFO - 08:22:41: ...  59%|█████▉    | 59/100 [00:00<00:00, 1523.00 it/sec, obj=0.559]
INFO - 08:22:41: ...  60%|██████    | 60/100 [00:00<00:00, 1524.82 it/sec, obj=-2.01]
INFO - 08:22:41: ...  61%|██████    | 61/100 [00:00<00:00, 1526.50 it/sec, obj=-.854]
INFO - 08:22:41: ...  62%|██████▏   | 62/100 [00:00<00:00, 1528.34 it/sec, obj=1.61]
INFO - 08:22:41: ...  63%|██████▎   | 63/100 [00:00<00:00, 1530.24 it/sec, obj=-2.64]
INFO - 08:22:41: ...  64%|██████▍   | 64/100 [00:00<00:00, 1531.06 it/sec, obj=0.818]
INFO - 08:22:41: ...  65%|██████▌   | 65/100 [00:00<00:00, 1532.68 it/sec, obj=1.04]
INFO - 08:22:41: ...  66%|██████▌   | 66/100 [00:00<00:00, 1533.50 it/sec, obj=-.832]
INFO - 08:22:41: ...  67%|██████▋   | 67/100 [00:00<00:00, 1535.01 it/sec, obj=0.692]
INFO - 08:22:41: ...  68%|██████▊   | 68/100 [00:00<00:00, 1536.55 it/sec, obj=-3.33]
INFO - 08:22:41: ...  69%|██████▉   | 69/100 [00:00<00:00, 1538.18 it/sec, obj=0.47]
INFO - 08:22:41: ...  70%|███████   | 70/100 [00:00<00:00, 1538.97 it/sec, obj=0.445]
INFO - 08:22:41: ...  71%|███████   | 71/100 [00:00<00:00, 1540.30 it/sec, obj=0.402]
INFO - 08:22:41: ...  72%|███████▏  | 72/100 [00:00<00:00, 1541.10 it/sec, obj=2.77]
INFO - 08:22:41: ...  73%|███████▎  | 73/100 [00:00<00:00, 1541.81 it/sec, obj=-.256]
INFO - 08:22:41: ...  74%|███████▍  | 74/100 [00:00<00:00, 1533.89 it/sec, obj=3.36]
INFO - 08:22:41: ...  75%|███████▌  | 75/100 [00:00<00:00, 1534.76 it/sec, obj=-.229]
INFO - 08:22:41: ...  76%|███████▌  | 76/100 [00:00<00:00, 1535.29 it/sec, obj=-.739]
INFO - 08:22:41: ...  77%|███████▋  | 77/100 [00:00<00:00, 1536.34 it/sec, obj=0.808]
INFO - 08:22:41: ...  78%|███████▊  | 78/100 [00:00<00:00, 1536.32 it/sec, obj=-.377]
INFO - 08:22:41: ...  79%|███████▉  | 79/100 [00:00<00:00, 1537.48 it/sec, obj=0.708]
INFO - 08:22:41: ...  80%|████████  | 80/100 [00:00<00:00, 1538.71 it/sec, obj=-.874]
INFO - 08:22:41: ...  81%|████████  | 81/100 [00:00<00:00, 1540.02 it/sec, obj=-1.29]
INFO - 08:22:41: ...  82%|████████▏ | 82/100 [00:00<00:00, 1541.26 it/sec, obj=0.505]
INFO - 08:22:41: ...  83%|████████▎ | 83/100 [00:00<00:00, 1541.63 it/sec, obj=1.99]
INFO - 08:22:41: ...  84%|████████▍ | 84/100 [00:00<00:00, 1542.37 it/sec, obj=0.574]
INFO - 08:22:41: ...  85%|████████▌ | 85/100 [00:00<00:00, 1543.39 it/sec, obj=-2.06]
INFO - 08:22:41: ...  86%|████████▌ | 86/100 [00:00<00:00, 1544.37 it/sec, obj=-1.49]
INFO - 08:22:41: ...  87%|████████▋ | 87/100 [00:00<00:00, 1545.54 it/sec, obj=0.61]
INFO - 08:22:41: ...  88%|████████▊ | 88/100 [00:00<00:00, 1546.62 it/sec, obj=0.542]
INFO - 08:22:41: ...  89%|████████▉ | 89/100 [00:00<00:00, 1547.10 it/sec, obj=-1.5]
INFO - 08:22:41: ...  90%|█████████ | 90/100 [00:00<00:00, 1547.96 it/sec, obj=0.201]
INFO - 08:22:41: ...  91%|█████████ | 91/100 [00:00<00:00, 1548.48 it/sec, obj=0.949]
INFO - 08:22:41: ...  92%|█████████▏| 92/100 [00:00<00:00, 1547.01 it/sec, obj=-1.86]
INFO - 08:22:41: ...  93%|█████████▎| 93/100 [00:00<00:00, 1547.71 it/sec, obj=-.0722]
INFO - 08:22:41: ...  94%|█████████▍| 94/100 [00:00<00:00, 1548.60 it/sec, obj=-.407]
INFO - 08:22:41: ...  95%|█████████▌| 95/100 [00:00<00:00, 1549.49 it/sec, obj=0.194]
INFO - 08:22:41: ...  96%|█████████▌| 96/100 [00:00<00:00, 1549.67 it/sec, obj=-.207]
INFO - 08:22:41: ...  97%|█████████▋| 97/100 [00:00<00:00, 1550.09 it/sec, obj=0.462]
INFO - 08:22:41: ...  98%|█████████▊| 98/100 [00:00<00:00, 1550.96 it/sec, obj=-2.37]
INFO - 08:22:41: ...  99%|█████████▉| 99/100 [00:00<00:00, 1551.91 it/sec, obj=1.32]
INFO - 08:22:41: ... 100%|██████████| 100/100 [00:00<00:00, 1552.82 it/sec, obj=-2.21]
INFO - 08:22:41: Optimization result:
INFO - 08:22:41:    Optimizer info:
INFO - 08:22:41:       Status: None
INFO - 08:22:41:       Message: None
INFO - 08:22:41:       Number of calls to the objective function by the optimizer: 100
INFO - 08:22:41:    Solution:
INFO - 08:22:41:       Objective: -3.3284373246961634
INFO - 08:22:41:       Parameter space:
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:       | x    |      -2     | -1.959995425007306 |      2      | float |                         |
INFO - 08:22:41:       | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41: *** End DOEScenario execution (time: 0:00:00.089111) ***

{'eval_jac': False, 'n_samples': 100, 'algo': 'lhs'}


We can export the optimization problem to a Dataset:

dataset = scenario.to_dataset(name="samples")


and visualize it in a tabular way:

dataset

GROUP designs functions
VARIABLE x y z
COMPONENT 0 0 0
1 1.869403 1.246453 3.115855
2 -1.567970 3.285041 1.717071
3 0.282640 -0.101706 0.180934
4 1.916313 1.848317 3.764630
5 1.562653 0.586038 2.148691
... ... ... ...
6 0.120633 -0.327477 -0.206844
7 -0.999225 1.461403 0.462178
8 -1.396066 -0.972779 -2.368845
9 1.090093 0.225565 1.315658
10 -1.433207 -0.779330 -2.212536

100 rows × 3 columns

or with a graphical post-processing, e.g. a scatter plot matrix:

ScatterMatrix(dataset).execute(save=False, show=True)

[<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 extract it:

uncertain_space = parameter_space.extract_uncertain_space()


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

scenario = create_scenario(
[discipline], "DisciplinaryOpt", "z", uncertain_space, scenario_type="DOE"
)
scenario.execute({"algo": "lhs", "n_samples": 100})

    INFO - 08:22:41:
INFO - 08:22:41: *** Start DOEScenario execution ***
INFO - 08:22:41: DOEScenario
INFO - 08:22:41:    Disciplines: AnalyticDiscipline
INFO - 08:22:41:    MDO formulation: DisciplinaryOpt
INFO - 08:22:41: Optimization problem:
INFO - 08:22:41:    minimize z(y)
INFO - 08:22:41:    with respect to y
INFO - 08:22:41:    over the design space:
INFO - 08:22:41:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:    | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 08:22:41:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:    | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:22:41:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41: Solving optimization problem with algorithm lhs:
INFO - 08:22:41: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 08:22:41: ...   1%|          | 1/100 [00:00<00:00, 1786.33 it/sec, obj=-.641]
INFO - 08:22:41: ...   2%|▏         | 2/100 [00:00<00:00, 1656.52 it/sec, obj=-.394]
INFO - 08:22:41: ...   3%|▎         | 3/100 [00:00<00:00, 1640.32 it/sec, obj=0.551]
INFO - 08:22:41: ...   4%|▍         | 4/100 [00:00<00:00, 1634.73 it/sec, obj=0.944]
INFO - 08:22:41: ...   5%|▌         | 5/100 [00:00<00:00, 1591.77 it/sec, obj=-2.12]
INFO - 08:22:41: ...   6%|▌         | 6/100 [00:00<00:00, 1585.75 it/sec, obj=-1.64]
INFO - 08:22:41: ...   7%|▋         | 7/100 [00:00<00:00, 1589.27 it/sec, obj=0.656]
INFO - 08:22:41: ...   8%|▊         | 8/100 [00:00<00:00, 1593.13 it/sec, obj=-.612]
INFO - 08:22:41: ...   9%|▉         | 9/100 [00:00<00:00, 1597.15 it/sec, obj=0.736]
INFO - 08:22:41: ...  10%|█         | 10/100 [00:00<00:00, 1599.90 it/sec, obj=0.36]
INFO - 08:22:41: ...  11%|█         | 11/100 [00:00<00:00, 1595.67 it/sec, obj=-.31]
INFO - 08:22:41: ...  12%|█▏        | 12/100 [00:00<00:00, 1596.92 it/sec, obj=0.324]
INFO - 08:22:41: ...  13%|█▎        | 13/100 [00:00<00:00, 1595.35 it/sec, obj=-1.73]
INFO - 08:22:41: ...  14%|█▍        | 14/100 [00:00<00:00, 1570.56 it/sec, obj=0.494]
INFO - 08:22:41: ...  15%|█▌        | 15/100 [00:00<00:00, 1572.43 it/sec, obj=-.148]
INFO - 08:22:41: ...  16%|█▌        | 16/100 [00:00<00:00, 1575.03 it/sec, obj=1.1]
INFO - 08:22:41: ...  17%|█▋        | 17/100 [00:00<00:00, 1572.98 it/sec, obj=-.716]
INFO - 08:22:41: ...  18%|█▊        | 18/100 [00:00<00:00, 1574.90 it/sec, obj=0.0421]
INFO - 08:22:41: ...  19%|█▉        | 19/100 [00:00<00:00, 1574.00 it/sec, obj=0.256]
INFO - 08:22:41: ...  20%|██        | 20/100 [00:00<00:00, 1575.80 it/sec, obj=-1.45]
INFO - 08:22:41: ...  21%|██        | 21/100 [00:00<00:00, 1577.37 it/sec, obj=0.637]
INFO - 08:22:41: ...  22%|██▏       | 22/100 [00:00<00:00, 1578.86 it/sec, obj=1.97]
INFO - 08:22:41: ...  23%|██▎       | 23/100 [00:00<00:00, 1577.99 it/sec, obj=-.208]
INFO - 08:22:41: ...  24%|██▍       | 24/100 [00:00<00:00, 1579.03 it/sec, obj=0.18]
INFO - 08:22:41: ...  25%|██▌       | 25/100 [00:00<00:00, 1578.47 it/sec, obj=0.000485]
INFO - 08:22:41: ...  26%|██▌       | 26/100 [00:00<00:00, 1579.30 it/sec, obj=1.17]
INFO - 08:22:41: ...  27%|██▋       | 27/100 [00:00<00:00, 1580.48 it/sec, obj=-.305]
INFO - 08:22:41: ...  28%|██▊       | 28/100 [00:00<00:00, 1581.48 it/sec, obj=0.68]
INFO - 08:22:41: ...  29%|██▉       | 29/100 [00:00<00:00, 1582.49 it/sec, obj=-.932]
INFO - 08:22:41: ...  30%|███       | 30/100 [00:00<00:00, 1581.30 it/sec, obj=0.901]
INFO - 08:22:41: ...  31%|███       | 31/100 [00:00<00:00, 1580.76 it/sec, obj=0.454]
INFO - 08:22:41: ...  32%|███▏      | 32/100 [00:00<00:00, 1581.21 it/sec, obj=-1.16]
INFO - 08:22:41: ...  33%|███▎      | 33/100 [00:00<00:00, 1582.25 it/sec, obj=1.44]
INFO - 08:22:41: ...  34%|███▍      | 34/100 [00:00<00:00, 1583.09 it/sec, obj=0.798]
INFO - 08:22:41: ...  35%|███▌      | 35/100 [00:00<00:00, 1583.51 it/sec, obj=1.59]
INFO - 08:22:41: ...  36%|███▌      | 36/100 [00:00<00:00, 1582.18 it/sec, obj=2.05]
INFO - 08:22:41: ...  37%|███▋      | 37/100 [00:00<00:00, 1582.74 it/sec, obj=-.26]
INFO - 08:22:41: ...  38%|███▊      | 38/100 [00:00<00:00, 1582.35 it/sec, obj=0.874]
INFO - 08:22:41: ...  39%|███▉      | 39/100 [00:00<00:00, 1581.39 it/sec, obj=0.832]
INFO - 08:22:41: ...  40%|████      | 40/100 [00:00<00:00, 1580.56 it/sec, obj=-1.38]
INFO - 08:22:41: ...  41%|████      | 41/100 [00:00<00:00, 1578.56 it/sec, obj=1.52]
INFO - 08:22:41: ...  42%|████▏     | 42/100 [00:00<00:00, 1577.61 it/sec, obj=-.522]
INFO - 08:22:41: ...  43%|████▎     | 43/100 [00:00<00:00, 1578.09 it/sec, obj=1.4]
INFO - 08:22:41: ...  44%|████▍     | 44/100 [00:00<00:00, 1577.78 it/sec, obj=-.484]
INFO - 08:22:41: ...  45%|████▌     | 45/100 [00:00<00:00, 1578.43 it/sec, obj=-.91]
INFO - 08:22:41: ...  46%|████▌     | 46/100 [00:00<00:00, 1579.10 it/sec, obj=0.343]
INFO - 08:22:41: ...  47%|████▋     | 47/100 [00:00<00:00, 1579.88 it/sec, obj=-.441]
INFO - 08:22:41: ...  48%|████▊     | 48/100 [00:00<00:00, 1580.74 it/sec, obj=-.871]
INFO - 08:22:41: ...  49%|████▉     | 49/100 [00:00<00:00, 1579.92 it/sec, obj=2.67]
INFO - 08:22:41: ...  50%|█████     | 50/100 [00:00<00:00, 1579.60 it/sec, obj=0.217]
INFO - 08:22:41: ...  51%|█████     | 51/100 [00:00<00:00, 1580.06 it/sec, obj=-.425]
INFO - 08:22:41: ...  52%|█████▏    | 52/100 [00:00<00:00, 1580.74 it/sec, obj=0.113]
INFO - 08:22:41: ...  53%|█████▎    | 53/100 [00:00<00:00, 1581.39 it/sec, obj=-.377]
INFO - 08:22:41: ...  54%|█████▍    | 54/100 [00:00<00:00, 1581.97 it/sec, obj=-1.19]
INFO - 08:22:41: ...  55%|█████▌    | 55/100 [00:00<00:00, 1581.31 it/sec, obj=-.528]
INFO - 08:22:41: ...  56%|█████▌    | 56/100 [00:00<00:00, 1580.42 it/sec, obj=-2.64]
INFO - 08:22:41: ...  57%|█████▋    | 57/100 [00:00<00:00, 1579.87 it/sec, obj=-.0776]
INFO - 08:22:41: ...  58%|█████▊    | 58/100 [00:00<00:00, 1580.42 it/sec, obj=1.08]
INFO - 08:22:41: ...  59%|█████▉    | 59/100 [00:00<00:00, 1581.07 it/sec, obj=-2.05]
INFO - 08:22:41: ...  60%|██████    | 60/100 [00:00<00:00, 1581.55 it/sec, obj=0.0555]
INFO - 08:22:41: ...  61%|██████    | 61/100 [00:00<00:00, 1581.29 it/sec, obj=-1.84]
INFO - 08:22:41: ...  62%|██████▏   | 62/100 [00:00<00:00, 1581.61 it/sec, obj=0.4]
INFO - 08:22:41: ...  63%|██████▎   | 63/100 [00:00<00:00, 1581.38 it/sec, obj=-.195]
INFO - 08:22:41: ...  64%|██████▍   | 64/100 [00:00<00:00, 1581.67 it/sec, obj=-.578]
INFO - 08:22:41: ...  65%|██████▌   | 65/100 [00:00<00:00, 1582.16 it/sec, obj=-.977]
INFO - 08:22:41: ...  66%|██████▌   | 66/100 [00:00<00:00, 1582.77 it/sec, obj=-.114]
INFO - 08:22:41: ...  67%|██████▋   | 67/100 [00:00<00:00, 1583.34 it/sec, obj=0.587]
INFO - 08:22:41: ...  68%|██████▊   | 68/100 [00:00<00:00, 1582.80 it/sec, obj=-.0679]
INFO - 08:22:41: ...  69%|██████▉   | 69/100 [00:00<00:00, 1582.64 it/sec, obj=-.0218]
INFO - 08:22:41: ...  70%|███████   | 70/100 [00:00<00:00, 1582.86 it/sec, obj=-.228]
INFO - 08:22:41: ...  71%|███████   | 71/100 [00:00<00:00, 1583.17 it/sec, obj=1.21]
INFO - 08:22:41: ...  72%|███████▏  | 72/100 [00:00<00:00, 1583.56 it/sec, obj=-.34]
INFO - 08:22:41: ...  73%|███████▎  | 73/100 [00:00<00:00, 1583.94 it/sec, obj=0.513]
INFO - 08:22:41: ...  74%|███████▍  | 74/100 [00:00<00:00, 1583.43 it/sec, obj=1.67]
INFO - 08:22:41: ...  75%|███████▌  | 75/100 [00:00<00:00, 1583.82 it/sec, obj=0.557]
INFO - 08:22:41: ...  76%|███████▌  | 76/100 [00:00<00:00, 1583.79 it/sec, obj=0.431]
INFO - 08:22:41: ...  77%|███████▋  | 77/100 [00:00<00:00, 1584.15 it/sec, obj=-1.31]
INFO - 08:22:41: ...  78%|███████▊  | 78/100 [00:00<00:00, 1584.57 it/sec, obj=-.678]
INFO - 08:22:41: ...  79%|███████▉  | 79/100 [00:00<00:00, 1585.00 it/sec, obj=-1.01]
INFO - 08:22:41: ...  80%|████████  | 80/100 [00:00<00:00, 1585.38 it/sec, obj=0.246]
INFO - 08:22:41: ...  81%|████████  | 81/100 [00:00<00:00, 1584.84 it/sec, obj=1.29]
INFO - 08:22:41: ...  82%|████████▏ | 82/100 [00:00<00:00, 1584.67 it/sec, obj=0.75]
INFO - 08:22:41: ...  83%|████████▎ | 83/100 [00:00<00:00, 1584.93 it/sec, obj=-1.54]
INFO - 08:22:41: ...  84%|████████▍ | 84/100 [00:00<00:00, 1585.41 it/sec, obj=-.156]
INFO - 08:22:41: ...  85%|████████▌ | 85/100 [00:00<00:00, 1585.88 it/sec, obj=1.87]
INFO - 08:22:41: ...  86%|████████▌ | 86/100 [00:00<00:00, 1586.29 it/sec, obj=-1.08]
INFO - 08:22:41: ...  87%|████████▋ | 87/100 [00:00<00:00, 1585.82 it/sec, obj=-.647]
INFO - 08:22:41: ...  88%|████████▊ | 88/100 [00:00<00:00, 1586.16 it/sec, obj=0.968]
INFO - 08:22:41: ...  89%|████████▉ | 89/100 [00:00<00:00, 1585.88 it/sec, obj=-.773]
INFO - 08:22:41: ...  90%|█████████ | 90/100 [00:00<00:00, 1586.24 it/sec, obj=1.26]
INFO - 08:22:41: ...  91%|█████████ | 91/100 [00:00<00:00, 1586.56 it/sec, obj=0.166]
INFO - 08:22:41: ...  92%|█████████▏| 92/100 [00:00<00:00, 1585.71 it/sec, obj=0.29]
INFO - 08:22:41: ...  93%|█████████▎| 93/100 [00:00<00:00, 1584.81 it/sec, obj=0.127]
INFO - 08:22:41: ...  94%|█████████▍| 94/100 [00:00<00:00, 1584.94 it/sec, obj=-1.26]
INFO - 08:22:41: ...  95%|█████████▌| 95/100 [00:00<00:00, 1584.77 it/sec, obj=1.01]
INFO - 08:22:41: ...  96%|█████████▌| 96/100 [00:00<00:00, 1585.01 it/sec, obj=0.0819]
INFO - 08:22:41: ...  97%|█████████▋| 97/100 [00:00<00:00, 1585.38 it/sec, obj=-1.09]
INFO - 08:22:41: ...  98%|█████████▊| 98/100 [00:00<00:00, 1585.59 it/sec, obj=-.762]
INFO - 08:22:41: ...  99%|█████████▉| 99/100 [00:00<00:00, 1585.86 it/sec, obj=-.0429]
INFO - 08:22:41: ... 100%|██████████| 100/100 [00:00<00:00, 1585.35 it/sec, obj=-.813]
INFO - 08:22:41: Optimization result:
INFO - 08:22:41:    Optimizer info:
INFO - 08:22:41:       Status: None
INFO - 08:22:41:       Message: None
INFO - 08:22:41:       Number of calls to the objective function by the optimizer: 100
INFO - 08:22:41:    Solution:
INFO - 08:22:41:       Objective: -2.6379682068246657
INFO - 08:22:41:       Parameter space:
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41:       | y    |     -inf    | -2.637968206824666 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:22:41:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:22:41: *** End DOEScenario execution (time: 0:00:00.086681) ***

{'eval_jac': False, 'n_samples': 100, 'algo': 'lhs'}


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(name="samples")
dataset

GROUP designs functions
VARIABLE y z
COMPONENT 0 0
1 -0.640726 -0.640726
2 -0.393653 -0.393653
3 0.550565 0.550565
4 0.944369 0.944369
5 -2.115275 -2.115275
... ... ...
6 0.081947 0.081947
7 -1.085812 -1.085812
8 -0.761651 -0.761651
9 -0.042932 -0.042932
10 -0.813354 -0.813354

100 rows × 2 columns

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

Gallery generated by Sphinx-Gallery