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 DesignSpace.add_variable()) or uncertain variables from their distribution names and parameters (use add_random_variable())

parameter_space.add_variable("x", l_b=-2.0, u_b=2.0)
parameter_space.add_random_variable("y", "SPNormalDistribution", mu=0.0, sigma=1.0)
print(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 deterministic and uncertain variables are implemented as deterministic and deterministic variables respectively:

print("x is deterministic: ", parameter_space.is_deterministic("x"))
print("y is deterministic: ", parameter_space.is_deterministic("y"))
print("x is uncertain: ", parameter_space.is_uncertain("x"))
print("y is uncertain: ", parameter_space.is_uncertain("y"))
x is deterministic:  True
y is deterministic:  False
x is uncertain:  False
y is uncertain:  True

Sample from the parameter space

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

sample = parameter_space.compute_samples(n_samples=2, as_dict=True)
print(sample)
sample = parameter_space.compute_samples(n_samples=4)
print(sample)
[{'y': array([-0.22455908])}, {'y': array([0.96599831])}]
[[-0.94119273]
 [ 0.71294261]
 [ 0.82955208]
 [ 1.40263977]]

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 consider as uniformly distributed.

scenario = create_scenario(
    [discipline], "DisciplinaryOpt", "z", parameter_space, scenario_type="DOE"
)
scenario.execute({"algo": "lhs", "n_samples": 100})
    INFO - 16:29:50:
    INFO - 16:29:50: *** Start DOEScenario execution ***
    INFO - 16:29:50: DOEScenario
    INFO - 16:29:50:    Disciplines: AnalyticDiscipline
    INFO - 16:29:50:    MDO formulation: DisciplinaryOpt
    INFO - 16:29:50: Optimization problem:
    INFO - 16:29:50:    minimize z(x, y)
    INFO - 16:29:50:    with respect to x, y
    INFO - 16:29:50:    over the design space:
    INFO - 16:29:50:    |                              Parameter space                               |
    INFO - 16:29:50:    +------+-------------+-------+-------------+-------+-------------------------+
    INFO - 16:29:50:    | name | lower_bound | value | upper_bound | type  |   Initial distribution  |
    INFO - 16:29:50:    +------+-------------+-------+-------------+-------+-------------------------+
    INFO - 16:29:50:    | x    |      -2     |  None |      2      | float |                         |
    INFO - 16:29:50:    | y    |     -inf    |   0   |     inf     | float | norm(mu=0.0, sigma=1.0) |
    INFO - 16:29:50:    +------+-------------+-------+-------------+-------+-------------------------+
    INFO - 16:29:50: Solving optimization problem with algorithm lhs:
    INFO - 16:29:50: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 16:29:50: ...   1%|          | 1/100 [00:00<00:00, 342.56 it/sec, obj=3.12]
    INFO - 16:29:50: ...   2%|▏         | 2/100 [00:00<00:00, 551.30 it/sec, obj=1.72]
    INFO - 16:29:50: ...   3%|▎         | 3/100 [00:00<00:00, 705.00 it/sec, obj=0.181]
    INFO - 16:29:50: ...   4%|▍         | 4/100 [00:00<00:00, 820.88 it/sec, obj=3.76]
    INFO - 16:29:50: ...   5%|▌         | 5/100 [00:00<00:00, 910.93 it/sec, obj=2.15]
    INFO - 16:29:50: ...   6%|▌         | 6/100 [00:00<00:00, 983.73 it/sec, obj=-.666]
    INFO - 16:29:50: ...   7%|▋         | 7/100 [00:00<00:00, 1038.89 it/sec, obj=1.53]
    INFO - 16:29:50: ...   8%|▊         | 8/100 [00:00<00:00, 1087.56 it/sec, obj=1.7]
    INFO - 16:29:50: ...   9%|▉         | 9/100 [00:00<00:00, 1125.85 it/sec, obj=-2.27]
    INFO - 16:29:50: ...  10%|█         | 10/100 [00:00<00:00, 1161.09 it/sec, obj=-2.08]
    INFO - 16:29:50: ...  11%|█         | 11/100 [00:00<00:00, 1192.24 it/sec, obj=-2.8]
    INFO - 16:29:50: ...  12%|█▏        | 12/100 [00:00<00:00, 1219.19 it/sec, obj=-1.31]
    INFO - 16:29:50: ...  13%|█▎        | 13/100 [00:00<00:00, 1240.47 it/sec, obj=1.1]
    INFO - 16:29:50: ...  14%|█▍        | 14/100 [00:00<00:00, 1261.34 it/sec, obj=0.38]
    INFO - 16:29:50: ...  15%|█▌        | 15/100 [00:00<00:00, 1277.50 it/sec, obj=1.68]
    INFO - 16:29:50: ...  16%|█▌        | 16/100 [00:00<00:00, 1294.26 it/sec, obj=0.672]
    INFO - 16:29:50: ...  17%|█▋        | 17/100 [00:00<00:00, 1309.83 it/sec, obj=0.643]
    INFO - 16:29:50: ...  18%|█▊        | 18/100 [00:00<00:00, 1324.22 it/sec, obj=0.568]
    INFO - 16:29:50: ...  19%|█▉        | 19/100 [00:00<00:00, 1337.18 it/sec, obj=-.277]
    INFO - 16:29:50: ...  20%|██        | 20/100 [00:00<00:00, 1346.70 it/sec, obj=1.51]
    INFO - 16:29:50: ...  21%|██        | 21/100 [00:00<00:00, 1356.79 it/sec, obj=1.83]
    INFO - 16:29:50: ...  22%|██▏       | 22/100 [00:00<00:00, 1366.69 it/sec, obj=2.12]
    INFO - 16:29:50: ...  23%|██▎       | 23/100 [00:00<00:00, 1376.28 it/sec, obj=0.526]
    INFO - 16:29:50: ...  24%|██▍       | 24/100 [00:00<00:00, 1385.48 it/sec, obj=1.47]
    INFO - 16:29:50: ...  25%|██▌       | 25/100 [00:00<00:00, 1393.85 it/sec, obj=-1.49]
    INFO - 16:29:50: ...  26%|██▌       | 26/100 [00:00<00:00, 1391.11 it/sec, obj=-1.58]
    INFO - 16:29:50: ...  27%|██▋       | 27/100 [00:00<00:00, 1397.62 it/sec, obj=1.59]
    INFO - 16:29:50: ...  28%|██▊       | 28/100 [00:00<00:00, 1402.91 it/sec, obj=0.329]
    INFO - 16:29:50: ...  29%|██▉       | 29/100 [00:00<00:00, 1409.38 it/sec, obj=-1.46]
    INFO - 16:29:50: ...  30%|███       | 30/100 [00:00<00:00, 1415.43 it/sec, obj=-.045]
    INFO - 16:29:50: ...  31%|███       | 31/100 [00:00<00:00, 1421.49 it/sec, obj=-.736]
    INFO - 16:29:50: ...  32%|███▏      | 32/100 [00:00<00:00, 1425.59 it/sec, obj=0.867]
    INFO - 16:29:50: ...  33%|███▎      | 33/100 [00:00<00:00, 1428.96 it/sec, obj=-3.12]
    INFO - 16:29:50: ...  34%|███▍      | 34/100 [00:00<00:00, 1432.39 it/sec, obj=-.252]
    INFO - 16:29:50: ...  35%|███▌      | 35/100 [00:00<00:00, 1437.18 it/sec, obj=1.46]
    INFO - 16:29:50: ...  36%|███▌      | 36/100 [00:00<00:00, 1441.59 it/sec, obj=-2.02]
    INFO - 16:29:50: ...  37%|███▋      | 37/100 [00:00<00:00, 1446.18 it/sec, obj=-1.68]
    INFO - 16:29:50: ...  38%|███▊      | 38/100 [00:00<00:00, 1450.38 it/sec, obj=-.913]
    INFO - 16:29:50: ...  39%|███▉      | 39/100 [00:00<00:00, 1452.31 it/sec, obj=-2.38]
    INFO - 16:29:50: ...  40%|████      | 40/100 [00:00<00:00, 1455.40 it/sec, obj=1.07]
    INFO - 16:29:50: ...  41%|████      | 41/100 [00:00<00:00, 1458.97 it/sec, obj=3.77]
    INFO - 16:29:50: ...  42%|████▏     | 42/100 [00:00<00:00, 1460.06 it/sec, obj=-1.88]
    INFO - 16:29:50: ...  43%|████▎     | 43/100 [00:00<00:00, 1452.38 it/sec, obj=0.116]
    INFO - 16:29:50: ...  44%|████▍     | 44/100 [00:00<00:00, 1454.94 it/sec, obj=-1.51]
    INFO - 16:29:50: ...  45%|████▌     | 45/100 [00:00<00:00, 1456.01 it/sec, obj=-.0194]
    INFO - 16:29:50: ...  46%|████▌     | 46/100 [00:00<00:00, 1458.26 it/sec, obj=0.984]
    INFO - 16:29:50: ...  47%|████▋     | 47/100 [00:00<00:00, 1461.19 it/sec, obj=-.34]
    INFO - 16:29:50: ...  48%|████▊     | 48/100 [00:00<00:00, 1464.13 it/sec, obj=-.941]
    INFO - 16:29:50: ...  49%|████▉     | 49/100 [00:00<00:00, 1467.09 it/sec, obj=0.363]
    INFO - 16:29:50: ...  50%|█████     | 50/100 [00:00<00:00, 1469.91 it/sec, obj=-1.01]
    INFO - 16:29:50: ...  51%|█████     | 51/100 [00:00<00:00, 1471.41 it/sec, obj=-.359]
    INFO - 16:29:50: ...  52%|█████▏    | 52/100 [00:00<00:00, 1473.78 it/sec, obj=-3.06]
    INFO - 16:29:50: ...  53%|█████▎    | 53/100 [00:00<00:00, 1475.48 it/sec, obj=2.34]
    INFO - 16:29:50: ...  54%|█████▍    | 54/100 [00:00<00:00, 1477.94 it/sec, obj=-.262]
    INFO - 16:29:50: ...  55%|█████▌    | 55/100 [00:00<00:00, 1480.25 it/sec, obj=0.812]
    INFO - 16:29:50: ...  56%|█████▌    | 56/100 [00:00<00:00, 1482.48 it/sec, obj=-2.47]
    INFO - 16:29:50: ...  57%|█████▋    | 57/100 [00:00<00:00, 1483.92 it/sec, obj=1.49]
    INFO - 16:29:50: ...  58%|█████▊    | 58/100 [00:00<00:00, 1486.11 it/sec, obj=0.268]
    INFO - 16:29:50: ...  59%|█████▉    | 59/100 [00:00<00:00, 1487.52 it/sec, obj=0.559]
    INFO - 16:29:50: ...  60%|██████    | 60/100 [00:00<00:00, 1489.46 it/sec, obj=-2.01]
    INFO - 16:29:50: ...  61%|██████    | 61/100 [00:00<00:00, 1485.02 it/sec, obj=-.854]
    INFO - 16:29:50: ...  62%|██████▏   | 62/100 [00:00<00:00, 1485.09 it/sec, obj=1.61]
    INFO - 16:29:50: ...  63%|██████▎   | 63/100 [00:00<00:00, 1485.93 it/sec, obj=-2.64]
    INFO - 16:29:50: ...  64%|██████▍   | 64/100 [00:00<00:00, 1487.76 it/sec, obj=0.818]
    INFO - 16:29:50: ...  65%|██████▌   | 65/100 [00:00<00:00, 1489.15 it/sec, obj=1.04]
    INFO - 16:29:50: ...  66%|██████▌   | 66/100 [00:00<00:00, 1490.98 it/sec, obj=-.832]
    INFO - 16:29:50: ...  67%|██████▋   | 67/100 [00:00<00:00, 1492.84 it/sec, obj=0.692]
    INFO - 16:29:50: ...  68%|██████▊   | 68/100 [00:00<00:00, 1494.56 it/sec, obj=-3.33]
    INFO - 16:29:50: ...  69%|██████▉   | 69/100 [00:00<00:00, 1496.32 it/sec, obj=0.47]
    INFO - 16:29:50: ...  70%|███████   | 70/100 [00:00<00:00, 1497.16 it/sec, obj=0.445]
    INFO - 16:29:50: ...  71%|███████   | 71/100 [00:00<00:00, 1498.76 it/sec, obj=0.402]
    INFO - 16:29:50: ...  72%|███████▏  | 72/100 [00:00<00:00, 1499.79 it/sec, obj=2.77]
    INFO - 16:29:50: ...  73%|███████▎  | 73/100 [00:00<00:00, 1501.29 it/sec, obj=-.256]
    INFO - 16:29:50: ...  74%|███████▍  | 74/100 [00:00<00:00, 1502.83 it/sec, obj=3.36]
    INFO - 16:29:50: ...  75%|███████▌  | 75/100 [00:00<00:00, 1504.43 it/sec, obj=-.229]
    INFO - 16:29:50: ...  76%|███████▌  | 76/100 [00:00<00:00, 1505.10 it/sec, obj=-.739]
    INFO - 16:29:50: ...  77%|███████▋  | 77/100 [00:00<00:00, 1505.67 it/sec, obj=0.808]
    INFO - 16:29:50: ...  78%|███████▊  | 78/100 [00:00<00:00, 1506.58 it/sec, obj=-.377]
    INFO - 16:29:50: ...  79%|███████▉  | 79/100 [00:00<00:00, 1507.95 it/sec, obj=0.708]
    INFO - 16:29:50: ...  80%|████████  | 80/100 [00:00<00:00, 1509.31 it/sec, obj=-.874]
    INFO - 16:29:50: ...  81%|████████  | 81/100 [00:00<00:00, 1510.59 it/sec, obj=-1.29]
    INFO - 16:29:50: ...  82%|████████▏ | 82/100 [00:00<00:00, 1511.87 it/sec, obj=0.505]
    INFO - 16:29:50: ...  83%|████████▎ | 83/100 [00:00<00:00, 1512.27 it/sec, obj=1.99]
    INFO - 16:29:50: ...  84%|████████▍ | 84/100 [00:00<00:00, 1513.07 it/sec, obj=0.574]
    INFO - 16:29:50: ...  85%|████████▌ | 85/100 [00:00<00:00, 1514.25 it/sec, obj=-2.06]
    INFO - 16:29:50: ...  86%|████████▌ | 86/100 [00:00<00:00, 1515.40 it/sec, obj=-1.49]
    INFO - 16:29:50: ...  87%|████████▋ | 87/100 [00:00<00:00, 1515.53 it/sec, obj=0.61]
    INFO - 16:29:50: ...  88%|████████▊ | 88/100 [00:00<00:00, 1516.53 it/sec, obj=0.542]
    INFO - 16:29:50: ...  89%|████████▉ | 89/100 [00:00<00:00, 1516.96 it/sec, obj=-1.5]
    INFO - 16:29:50: ...  90%|█████████ | 90/100 [00:00<00:00, 1518.02 it/sec, obj=0.201]
    INFO - 16:29:50: ...  91%|█████████ | 91/100 [00:00<00:00, 1518.54 it/sec, obj=0.949]
    INFO - 16:29:50: ...  92%|█████████▏| 92/100 [00:00<00:00, 1519.64 it/sec, obj=-1.86]
    INFO - 16:29:50: ...  93%|█████████▎| 93/100 [00:00<00:00, 1520.69 it/sec, obj=-.0722]
    INFO - 16:29:50: ...  94%|█████████▍| 94/100 [00:00<00:00, 1521.77 it/sec, obj=-.407]
    INFO - 16:29:50: ...  95%|█████████▌| 95/100 [00:00<00:00, 1521.86 it/sec, obj=0.194]
    INFO - 16:29:50: ...  96%|█████████▌| 96/100 [00:00<00:00, 1522.69 it/sec, obj=-.207]
    INFO - 16:29:50: ...  97%|█████████▋| 97/100 [00:00<00:00, 1523.19 it/sec, obj=0.462]
    INFO - 16:29:50: ...  98%|█████████▊| 98/100 [00:00<00:00, 1523.95 it/sec, obj=-2.37]
    INFO - 16:29:50: ...  99%|█████████▉| 99/100 [00:00<00:00, 1524.88 it/sec, obj=1.32]
    INFO - 16:29:50: ... 100%|██████████| 100/100 [00:00<00:00, 1525.88 it/sec, obj=-2.21]
    INFO - 16:29:50: Optimization result:
    INFO - 16:29:50:    Optimizer info:
    INFO - 16:29:50:       Status: None
    INFO - 16:29:50:       Message: None
    INFO - 16:29:50:       Number of calls to the objective function by the optimizer: 100
    INFO - 16:29:50:    Solution:
    INFO - 16:29:50:       Objective: -3.3284373246961634
    INFO - 16:29:50:       +-----------------------------------------------------------------------------------------+
    INFO - 16:29:50:       |                                     Parameter space                                     |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:       | x    |      -2     | -1.959995425007306 |      2      | float |                         |
    INFO - 16:29:50:       | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50: *** End DOEScenario execution (time: 0:00:00.093302) ***

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

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:

print(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 x 3 columns]

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

ScatterMatrix(dataset).execute(save=False, show=True)
plot parameter space
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/5.0.0/lib/python3.9/site-packages/gemseo/post/dataset/scatter_plot_matrix.py:137: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared.
  sub_axes = scatter_matrix(

[<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)
<gemseo.algos.parameter_space.ParameterSpace object at 0x7fea3a03f190>

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

scenario = create_scenario(
    [discipline], "DisciplinaryOpt", "z", parameter_space, scenario_type="DOE"
)
scenario.execute({"algo": "lhs", "n_samples": 100})
    INFO - 16:29:50:
    INFO - 16:29:50: *** Start DOEScenario execution ***
    INFO - 16:29:50: DOEScenario
    INFO - 16:29:50:    Disciplines: AnalyticDiscipline
    INFO - 16:29:50:    MDO formulation: DisciplinaryOpt
    INFO - 16:29:50: Optimization problem:
    INFO - 16:29:50:    minimize z(y)
    INFO - 16:29:50:    with respect to y
    INFO - 16:29:50:    over the design space:
    INFO - 16:29:50:    |                                     Parameter space                                     |
    INFO - 16:29:50:    +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:    | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
    INFO - 16:29:50:    +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:    | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
    INFO - 16:29:50:    +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50: Solving optimization problem with algorithm lhs:
    INFO - 16:29:50: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 16:29:50: ...   1%|          | 1/100 [00:00<00:00, 1528.54 it/sec, obj=-.641]
    INFO - 16:29:50: ...   2%|▏         | 2/100 [00:00<00:00, 1496.36 it/sec, obj=-.394]
    INFO - 16:29:50: ...   3%|▎         | 3/100 [00:00<00:00, 1519.86 it/sec, obj=0.551]
    INFO - 16:29:50: ...   4%|▍         | 4/100 [00:00<00:00, 1537.08 it/sec, obj=0.944]
    INFO - 16:29:50: ...   5%|▌         | 5/100 [00:00<00:00, 1549.20 it/sec, obj=-2.12]
    INFO - 16:29:50: ...   6%|▌         | 6/100 [00:00<00:00, 1545.15 it/sec, obj=-1.64]
    INFO - 16:29:50: ...   7%|▋         | 7/100 [00:00<00:00, 1541.21 it/sec, obj=0.656]
    INFO - 16:29:50: ...   8%|▊         | 8/100 [00:00<00:00, 1539.83 it/sec, obj=-.612]
    INFO - 16:29:50: ...   9%|▉         | 9/100 [00:00<00:00, 1546.00 it/sec, obj=0.736]
    INFO - 16:29:50: ...  10%|█         | 10/100 [00:00<00:00, 1550.92 it/sec, obj=0.36]
    INFO - 16:29:50: ...  11%|█         | 11/100 [00:00<00:00, 1555.12 it/sec, obj=-.31]
    INFO - 16:29:50: ...  12%|█▏        | 12/100 [00:00<00:00, 1553.45 it/sec, obj=0.324]
    INFO - 16:29:50: ...  13%|█▎        | 13/100 [00:00<00:00, 1556.86 it/sec, obj=-1.73]
    INFO - 16:29:50: ...  14%|█▍        | 14/100 [00:00<00:00, 1556.78 it/sec, obj=0.494]
    INFO - 16:29:50: ...  15%|█▌        | 15/100 [00:00<00:00, 1558.83 it/sec, obj=-.148]
    INFO - 16:29:50: ...  16%|█▌        | 16/100 [00:00<00:00, 1561.32 it/sec, obj=1.1]
    INFO - 16:29:50: ...  17%|█▋        | 17/100 [00:00<00:00, 1563.46 it/sec, obj=-.716]
    INFO - 16:29:50: ...  18%|█▊        | 18/100 [00:00<00:00, 1561.80 it/sec, obj=0.0421]
    INFO - 16:29:50: ...  19%|█▉        | 19/100 [00:00<00:00, 1562.55 it/sec, obj=0.256]
    INFO - 16:29:50: ...  20%|██        | 20/100 [00:00<00:00, 1562.21 it/sec, obj=-1.45]
    INFO - 16:29:50: ...  21%|██        | 21/100 [00:00<00:00, 1562.93 it/sec, obj=0.637]
    INFO - 16:29:50: ...  22%|██▏       | 22/100 [00:00<00:00, 1564.53 it/sec, obj=1.97]
    INFO - 16:29:50: ...  23%|██▎       | 23/100 [00:00<00:00, 1566.06 it/sec, obj=-.208]
    INFO - 16:29:50: ...  24%|██▍       | 24/100 [00:00<00:00, 1567.21 it/sec, obj=0.18]
    INFO - 16:29:50: ...  25%|██▌       | 25/100 [00:00<00:00, 1565.37 it/sec, obj=0.000485]
    INFO - 16:29:50: ...  26%|██▌       | 26/100 [00:00<00:00, 1566.37 it/sec, obj=1.17]
    INFO - 16:29:50: ...  27%|██▋       | 27/100 [00:00<00:00, 1565.84 it/sec, obj=-.305]
    INFO - 16:29:50: ...  28%|██▊       | 28/100 [00:00<00:00, 1566.86 it/sec, obj=0.68]
    INFO - 16:29:50: ...  29%|██▉       | 29/100 [00:00<00:00, 1567.92 it/sec, obj=-.932]
    INFO - 16:29:50: ...  30%|███       | 30/100 [00:00<00:00, 1568.80 it/sec, obj=0.901]
    INFO - 16:29:50: ...  31%|███       | 31/100 [00:00<00:00, 1566.57 it/sec, obj=0.454]
    INFO - 16:29:50: ...  32%|███▏      | 32/100 [00:00<00:00, 1566.98 it/sec, obj=-1.16]
    INFO - 16:29:50: ...  33%|███▎      | 33/100 [00:00<00:00, 1566.33 it/sec, obj=1.44]
    INFO - 16:29:50: ...  34%|███▍      | 34/100 [00:00<00:00, 1566.98 it/sec, obj=0.798]
    INFO - 16:29:50: ...  35%|███▌      | 35/100 [00:00<00:00, 1555.70 it/sec, obj=1.59]
    INFO - 16:29:50: ...  36%|███▌      | 36/100 [00:00<00:00, 1555.93 it/sec, obj=2.05]
    INFO - 16:29:50: ...  37%|███▋      | 37/100 [00:00<00:00, 1555.19 it/sec, obj=-.26]
    INFO - 16:29:50: ...  38%|███▊      | 38/100 [00:00<00:00, 1556.18 it/sec, obj=0.874]
    INFO - 16:29:50: ...  39%|███▉      | 39/100 [00:00<00:00, 1555.88 it/sec, obj=0.832]
    INFO - 16:29:50: ...  40%|████      | 40/100 [00:00<00:00, 1556.78 it/sec, obj=-1.38]
    INFO - 16:29:50: ...  41%|████      | 41/100 [00:00<00:00, 1557.71 it/sec, obj=1.52]
    INFO - 16:29:50: ...  42%|████▏     | 42/100 [00:00<00:00, 1558.53 it/sec, obj=-.522]
    INFO - 16:29:50: ...  43%|████▎     | 43/100 [00:00<00:00, 1557.83 it/sec, obj=1.4]
    INFO - 16:29:50: ...  44%|████▍     | 44/100 [00:00<00:00, 1558.39 it/sec, obj=-.484]
    INFO - 16:29:50: ...  45%|████▌     | 45/100 [00:00<00:00, 1558.14 it/sec, obj=-.91]
    INFO - 16:29:50: ...  46%|████▌     | 46/100 [00:00<00:00, 1558.83 it/sec, obj=0.343]
    INFO - 16:29:50: ...  47%|████▋     | 47/100 [00:00<00:00, 1559.57 it/sec, obj=-.441]
    INFO - 16:29:50: ...  48%|████▊     | 48/100 [00:00<00:00, 1560.37 it/sec, obj=-.871]
    INFO - 16:29:50: ...  49%|████▉     | 49/100 [00:00<00:00, 1561.23 it/sec, obj=2.67]
    INFO - 16:29:50: ...  50%|█████     | 50/100 [00:00<00:00, 1560.68 it/sec, obj=0.217]
    INFO - 16:29:50: ...  51%|█████     | 51/100 [00:00<00:00, 1560.54 it/sec, obj=-.425]
    INFO - 16:29:50: ...  52%|█████▏    | 52/100 [00:00<00:00, 1561.13 it/sec, obj=0.113]
    INFO - 16:29:50: ...  53%|█████▎    | 53/100 [00:00<00:00, 1561.78 it/sec, obj=-.377]
    INFO - 16:29:50: ...  54%|█████▍    | 54/100 [00:00<00:00, 1562.34 it/sec, obj=-1.19]
    INFO - 16:29:50: ...  55%|█████▌    | 55/100 [00:00<00:00, 1563.06 it/sec, obj=-.528]
    INFO - 16:29:50: ...  56%|█████▌    | 56/100 [00:00<00:00, 1561.67 it/sec, obj=-2.64]
    INFO - 16:29:50: ...  57%|█████▋    | 57/100 [00:00<00:00, 1562.03 it/sec, obj=-.0776]
    INFO - 16:29:50: ...  58%|█████▊    | 58/100 [00:00<00:00, 1561.56 it/sec, obj=1.08]
    INFO - 16:29:50: ...  59%|█████▉    | 59/100 [00:00<00:00, 1561.97 it/sec, obj=-2.05]
    INFO - 16:29:50: ...  60%|██████    | 60/100 [00:00<00:00, 1562.36 it/sec, obj=0.0555]
    INFO - 16:29:50: ...  61%|██████    | 61/100 [00:00<00:00, 1562.65 it/sec, obj=-1.84]
    INFO - 16:29:50: ...  62%|██████▏   | 62/100 [00:00<00:00, 1562.02 it/sec, obj=0.4]
    INFO - 16:29:50: ...  63%|██████▎   | 63/100 [00:00<00:00, 1562.35 it/sec, obj=-.195]
    INFO - 16:29:50: ...  64%|██████▍   | 64/100 [00:00<00:00, 1562.17 it/sec, obj=-.578]
    INFO - 16:29:50: ...  65%|██████▌   | 65/100 [00:00<00:00, 1562.52 it/sec, obj=-.977]
    INFO - 16:29:50: ...  66%|██████▌   | 66/100 [00:00<00:00, 1562.99 it/sec, obj=-.114]
    INFO - 16:29:50: ...  67%|██████▋   | 67/100 [00:00<00:00, 1563.32 it/sec, obj=0.587]
    INFO - 16:29:50: ...  68%|██████▊   | 68/100 [00:00<00:00, 1563.01 it/sec, obj=-.0679]
    INFO - 16:29:50: ...  69%|██████▉   | 69/100 [00:00<00:00, 1563.14 it/sec, obj=-.0218]
    INFO - 16:29:50: ...  70%|███████   | 70/100 [00:00<00:00, 1558.58 it/sec, obj=-.228]
    INFO - 16:29:50: ...  71%|███████   | 71/100 [00:00<00:00, 1553.69 it/sec, obj=1.21]
    INFO - 16:29:50: ...  72%|███████▏  | 72/100 [00:00<00:00, 1553.61 it/sec, obj=-.34]
    INFO - 16:29:50: ...  73%|███████▎  | 73/100 [00:00<00:00, 1554.01 it/sec, obj=0.513]
    INFO - 16:29:50: ...  74%|███████▍  | 74/100 [00:00<00:00, 1553.58 it/sec, obj=1.67]
    INFO - 16:29:50: ...  75%|███████▌  | 75/100 [00:00<00:00, 1553.87 it/sec, obj=0.557]
    INFO - 16:29:50: ...  76%|███████▌  | 76/100 [00:00<00:00, 1553.76 it/sec, obj=0.431]
    INFO - 16:29:50: ...  77%|███████▋  | 77/100 [00:00<00:00, 1554.05 it/sec, obj=-1.31]
    INFO - 16:29:50: ...  78%|███████▊  | 78/100 [00:00<00:00, 1554.63 it/sec, obj=-.678]
    INFO - 16:29:50: ...  79%|███████▉  | 79/100 [00:00<00:00, 1555.00 it/sec, obj=-1.01]
    INFO - 16:29:50: ...  80%|████████  | 80/100 [00:00<00:00, 1555.42 it/sec, obj=0.246]
    INFO - 16:29:50: ...  81%|████████  | 81/100 [00:00<00:00, 1554.96 it/sec, obj=1.29]
    INFO - 16:29:50: ...  82%|████████▏ | 82/100 [00:00<00:00, 1554.91 it/sec, obj=0.75]
    INFO - 16:29:50: ...  83%|████████▎ | 83/100 [00:00<00:00, 1555.25 it/sec, obj=-1.54]
    INFO - 16:29:50: ...  84%|████████▍ | 84/100 [00:00<00:00, 1555.75 it/sec, obj=-.156]
    INFO - 16:29:50: ...  85%|████████▌ | 85/100 [00:00<00:00, 1556.25 it/sec, obj=1.87]
    INFO - 16:29:50: ...  86%|████████▌ | 86/100 [00:00<00:00, 1556.60 it/sec, obj=-1.08]
    INFO - 16:29:50: ...  87%|████████▋ | 87/100 [00:00<00:00, 1555.99 it/sec, obj=-.647]
    INFO - 16:29:50: ...  88%|████████▊ | 88/100 [00:00<00:00, 1556.24 it/sec, obj=0.968]
    INFO - 16:29:50: ...  89%|████████▉ | 89/100 [00:00<00:00, 1555.89 it/sec, obj=-.773]
    INFO - 16:29:50: ...  90%|█████████ | 90/100 [00:00<00:00, 1556.17 it/sec, obj=1.26]
    INFO - 16:29:50: ...  91%|█████████ | 91/100 [00:00<00:00, 1556.60 it/sec, obj=0.166]
    INFO - 16:29:50: ...  92%|█████████▏| 92/100 [00:00<00:00, 1557.03 it/sec, obj=0.29]
    INFO - 16:29:50: ...  93%|█████████▎| 93/100 [00:00<00:00, 1555.79 it/sec, obj=0.127]
    INFO - 16:29:50: ...  94%|█████████▍| 94/100 [00:00<00:00, 1556.00 it/sec, obj=-1.26]
    INFO - 16:29:50: ...  95%|█████████▌| 95/100 [00:00<00:00, 1555.80 it/sec, obj=1.01]
    INFO - 16:29:50: ...  96%|█████████▌| 96/100 [00:00<00:00, 1556.12 it/sec, obj=0.0819]
    INFO - 16:29:50: ...  97%|█████████▋| 97/100 [00:00<00:00, 1556.49 it/sec, obj=-1.09]
    INFO - 16:29:50: ...  98%|█████████▊| 98/100 [00:00<00:00, 1556.82 it/sec, obj=-.762]
    INFO - 16:29:50: ...  99%|█████████▉| 99/100 [00:00<00:00, 1556.52 it/sec, obj=-.0429]
    INFO - 16:29:50: ... 100%|██████████| 100/100 [00:00<00:00, 1556.77 it/sec, obj=-.813]
    INFO - 16:29:50: Optimization result:
    INFO - 16:29:50:    Optimizer info:
    INFO - 16:29:50:       Status: None
    INFO - 16:29:50:       Message: None
    INFO - 16:29:50:       Number of calls to the objective function by the optimizer: 100
    INFO - 16:29:50:    Solution:
    INFO - 16:29:50:       Objective: -2.6379682068246657
    INFO - 16:29:50:       +-----------------------------------------------------------------------------------------+
    INFO - 16:29:50:       |                                     Parameter space                                     |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50:       | y    |     -inf    | -2.637968206824666 |     inf     | float | norm(mu=0.0, sigma=1.0) |
    INFO - 16:29:50:       +------+-------------+--------------------+-------------+-------+-------------------------+
    INFO - 16:29:50: *** End DOEScenario execution (time: 0:00:00.089201) ***

{'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(opt_naming=False)
print(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 x 2 columns]

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

Gallery generated by Sphinx-Gallery