Parameter space¶

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

from __future__ import annotations

from gemseo.algos.parameter_space import ParameterSpace
from gemseo.api import configure_logger
from gemseo.api import create_discipline
from gemseo.api import create_scenario

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)
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 a NumPy array (by default) or as a dictionary of NumPy arrays indexed by the names of the variables:

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.29202523])}, {'y': array([0.62106936])}]
[[-0.05989239]
[-0.31236041]
[ 0.48944185]
[-1.33652064]]


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 - 09:07:22:
INFO - 09:07:22: *** Start DOEScenario execution ***
INFO - 09:07:22: DOEScenario
INFO - 09:07:22:    Disciplines: AnalyticDiscipline
INFO - 09:07:22:    MDO formulation: DisciplinaryOpt
INFO - 09:07:22: Optimization problem:
INFO - 09:07:22:    minimize z(x, y)
INFO - 09:07:22:    with respect to x, y
INFO - 09:07:22:    over the design space:
INFO - 09:07:22:    |                              Parameter space                               |
INFO - 09:07:22:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 09:07:22:    | name | lower_bound | value | upper_bound | type  |   Initial distribution  |
INFO - 09:07:22:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 09:07:22:    | x    |      -2     |  None |      2      | float |                         |
INFO - 09:07:22:    | y    |     -inf    |   0   |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 09:07:22:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 09:07:22: Solving optimization problem with algorithm lhs:
INFO - 09:07:22: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 09:07:22: ...   1%|          | 1/100 [00:00<00:00, 376.64 it/sec, obj=3.12]
INFO - 09:07:22: ...   2%|▏         | 2/100 [00:00<00:00, 610.70 it/sec, obj=1.72]
INFO - 09:07:22: ...   3%|▎         | 3/100 [00:00<00:00, 776.10 it/sec, obj=0.181]
INFO - 09:07:22: ...   4%|▍         | 4/100 [00:00<00:00, 900.21 it/sec, obj=3.76]
INFO - 09:07:22: ...   5%|▌         | 5/100 [00:00<00:00, 996.46 it/sec, obj=2.15]
INFO - 09:07:22: ...   6%|▌         | 6/100 [00:00<00:00, 1058.32 it/sec, obj=-.666]
INFO - 09:07:22: ...   7%|▋         | 7/100 [00:00<00:00, 1118.61 it/sec, obj=1.53]
INFO - 09:07:22: ...   8%|▊         | 8/100 [00:00<00:00, 1170.37 it/sec, obj=1.7]
INFO - 09:07:22: ...   9%|▉         | 9/100 [00:00<00:00, 1214.14 it/sec, obj=-2.27]
INFO - 09:07:22: ...  10%|█         | 10/100 [00:00<00:00, 1252.07 it/sec, obj=-2.08]
INFO - 09:07:22: ...  11%|█         | 11/100 [00:00<00:00, 1284.59 it/sec, obj=-2.8]
INFO - 09:07:22: ...  12%|█▏        | 12/100 [00:00<00:00, 1313.18 it/sec, obj=-1.31]
INFO - 09:07:22: ...  13%|█▎        | 13/100 [00:00<00:00, 1332.47 it/sec, obj=1.1]
INFO - 09:07:22: ...  14%|█▍        | 14/100 [00:00<00:00, 1354.16 it/sec, obj=0.38]
INFO - 09:07:22: ...  15%|█▌        | 15/100 [00:00<00:00, 1374.76 it/sec, obj=1.68]
INFO - 09:07:22: ...  16%|█▌        | 16/100 [00:00<00:00, 1393.11 it/sec, obj=0.672]
INFO - 09:07:22: ...  17%|█▋        | 17/100 [00:00<00:00, 1409.57 it/sec, obj=0.643]
INFO - 09:07:22: ...  18%|█▊        | 18/100 [00:00<00:00, 1424.64 it/sec, obj=0.568]
INFO - 09:07:22: ...  19%|█▉        | 19/100 [00:00<00:00, 1438.30 it/sec, obj=-.277]
INFO - 09:07:22: ...  20%|██        | 20/100 [00:00<00:00, 1445.46 it/sec, obj=1.51]
INFO - 09:07:22: ...  21%|██        | 21/100 [00:00<00:00, 1456.45 it/sec, obj=1.83]
INFO - 09:07:22: ...  22%|██▏       | 22/100 [00:00<00:00, 1467.22 it/sec, obj=2.12]
INFO - 09:07:22: ...  23%|██▎       | 23/100 [00:00<00:00, 1477.37 it/sec, obj=0.526]
INFO - 09:07:22: ...  24%|██▍       | 24/100 [00:00<00:00, 1486.86 it/sec, obj=1.47]
INFO - 09:07:22: ...  25%|██▌       | 25/100 [00:00<00:00, 1495.64 it/sec, obj=-1.49]
INFO - 09:07:22: ...  26%|██▌       | 26/100 [00:00<00:00, 1503.77 it/sec, obj=-1.58]
INFO - 09:07:22: ...  27%|██▋       | 27/100 [00:00<00:00, 1506.33 it/sec, obj=1.59]
INFO - 09:07:22: ...  28%|██▊       | 28/100 [00:00<00:00, 1513.16 it/sec, obj=0.329]
INFO - 09:07:22: ...  29%|██▉       | 29/100 [00:00<00:00, 1519.81 it/sec, obj=-1.46]
INFO - 09:07:22: ...  30%|███       | 30/100 [00:00<00:00, 1526.18 it/sec, obj=-.045]
INFO - 09:07:22: ...  31%|███       | 31/100 [00:00<00:00, 1532.37 it/sec, obj=-.736]
INFO - 09:07:22: ...  32%|███▏      | 32/100 [00:00<00:00, 1537.89 it/sec, obj=0.867]
INFO - 09:07:22: ...  33%|███▎      | 33/100 [00:00<00:00, 1541.49 it/sec, obj=-3.12]
INFO - 09:07:22: ...  34%|███▍      | 34/100 [00:00<00:00, 1545.11 it/sec, obj=-.252]
INFO - 09:07:22: ...  35%|███▌      | 35/100 [00:00<00:00, 1533.97 it/sec, obj=1.46]
INFO - 09:07:22: ...  36%|███▌      | 36/100 [00:00<00:00, 1537.67 it/sec, obj=-2.02]
INFO - 09:07:22: ...  37%|███▋      | 37/100 [00:00<00:00, 1530.41 it/sec, obj=-1.68]
INFO - 09:07:22: ...  38%|███▊      | 38/100 [00:00<00:00, 1530.83 it/sec, obj=-.913]
INFO - 09:07:22: ...  39%|███▉      | 39/100 [00:00<00:00, 1533.02 it/sec, obj=-2.38]
INFO - 09:07:22: ...  40%|████      | 40/100 [00:00<00:00, 1535.85 it/sec, obj=1.07]
INFO - 09:07:22: ...  41%|████      | 41/100 [00:00<00:00, 1540.06 it/sec, obj=3.77]
INFO - 09:07:22: ...  42%|████▏     | 42/100 [00:00<00:00, 1544.21 it/sec, obj=-1.88]
INFO - 09:07:22: ...  43%|████▎     | 43/100 [00:00<00:00, 1547.90 it/sec, obj=0.116]
INFO - 09:07:22: ...  44%|████▍     | 44/100 [00:00<00:00, 1551.64 it/sec, obj=-1.51]
INFO - 09:07:22: ...  45%|████▌     | 45/100 [00:00<00:00, 1555.31 it/sec, obj=-.0194]
INFO - 09:07:22: ...  46%|████▌     | 46/100 [00:00<00:00, 1557.41 it/sec, obj=0.984]
INFO - 09:07:22: ...  47%|████▋     | 47/100 [00:00<00:00, 1559.71 it/sec, obj=-.34]
INFO - 09:07:22: ...  48%|████▊     | 48/100 [00:00<00:00, 1562.82 it/sec, obj=-.941]
INFO - 09:07:22: ...  49%|████▉     | 49/100 [00:00<00:00, 1565.90 it/sec, obj=0.363]
INFO - 09:07:22: ...  50%|█████     | 50/100 [00:00<00:00, 1569.20 it/sec, obj=-1.01]
INFO - 09:07:22: ...  51%|█████     | 51/100 [00:00<00:00, 1572.29 it/sec, obj=-.359]
INFO - 09:07:22: ...  52%|█████▏    | 52/100 [00:00<00:00, 1575.20 it/sec, obj=-3.06]
INFO - 09:07:22: ...  53%|█████▎    | 53/100 [00:00<00:00, 1576.12 it/sec, obj=2.34]
INFO - 09:07:22: ...  54%|█████▍    | 54/100 [00:00<00:00, 1578.38 it/sec, obj=-.262]
INFO - 09:07:22: ...  55%|█████▌    | 55/100 [00:00<00:00, 1580.67 it/sec, obj=0.812]
INFO - 09:07:22: ...  56%|█████▌    | 56/100 [00:00<00:00, 1583.24 it/sec, obj=-2.47]
INFO - 09:07:22: ...  57%|█████▋    | 57/100 [00:00<00:00, 1585.87 it/sec, obj=1.49]
INFO - 09:07:22: ...  58%|█████▊    | 58/100 [00:00<00:00, 1582.08 it/sec, obj=0.268]
INFO - 09:07:22: ...  59%|█████▉    | 59/100 [00:00<00:00, 1584.34 it/sec, obj=0.559]
INFO - 09:07:22: ...  60%|██████    | 60/100 [00:00<00:00, 1584.41 it/sec, obj=-2.01]
INFO - 09:07:22: ...  61%|██████    | 61/100 [00:00<00:00, 1586.36 it/sec, obj=-.854]
INFO - 09:07:22: ...  62%|██████▏   | 62/100 [00:00<00:00, 1588.37 it/sec, obj=1.61]
INFO - 09:07:22: ...  63%|██████▎   | 63/100 [00:00<00:00, 1590.44 it/sec, obj=-2.64]
INFO - 09:07:22: ...  64%|██████▍   | 64/100 [00:00<00:00, 1592.49 it/sec, obj=0.818]
INFO - 09:07:22: ...  65%|██████▌   | 65/100 [00:00<00:00, 1594.56 it/sec, obj=1.04]
INFO - 09:07:22: ...  66%|██████▌   | 66/100 [00:00<00:00, 1594.41 it/sec, obj=-.832]
INFO - 09:07:22: ...  67%|██████▋   | 67/100 [00:00<00:00, 1582.94 it/sec, obj=0.692]
INFO - 09:07:22: ...  68%|██████▊   | 68/100 [00:00<00:00, 1582.19 it/sec, obj=-3.33]
INFO - 09:07:22: ...  69%|██████▉   | 69/100 [00:00<00:00, 1581.30 it/sec, obj=0.47]
INFO - 09:07:22: ...  70%|███████   | 70/100 [00:00<00:00, 1576.87 it/sec, obj=0.445]
INFO - 09:07:22: ...  71%|███████   | 71/100 [00:00<00:00, 1574.90 it/sec, obj=0.402]
INFO - 09:07:22: ...  72%|███████▏  | 72/100 [00:00<00:00, 1574.91 it/sec, obj=2.77]
INFO - 09:07:22: ...  73%|███████▎  | 73/100 [00:00<00:00, 1576.55 it/sec, obj=-.256]
INFO - 09:07:22: ...  74%|███████▍  | 74/100 [00:00<00:00, 1578.46 it/sec, obj=3.36]
INFO - 09:07:22: ...  75%|███████▌  | 75/100 [00:00<00:00, 1580.29 it/sec, obj=-.229]
INFO - 09:07:22: ...  76%|███████▌  | 76/100 [00:00<00:00, 1582.07 it/sec, obj=-.739]
INFO - 09:07:22: ...  77%|███████▋  | 77/100 [00:00<00:00, 1583.10 it/sec, obj=0.808]
INFO - 09:07:22: ...  78%|███████▊  | 78/100 [00:00<00:00, 1583.99 it/sec, obj=-.377]
INFO - 09:07:22: ...  79%|███████▉  | 79/100 [00:00<00:00, 1582.95 it/sec, obj=0.708]
INFO - 09:07:22: ...  80%|████████  | 80/100 [00:00<00:00, 1584.18 it/sec, obj=-.874]
INFO - 09:07:22: ...  81%|████████  | 81/100 [00:00<00:00, 1585.80 it/sec, obj=-1.29]
INFO - 09:07:22: ...  82%|████████▏ | 82/100 [00:00<00:00, 1586.64 it/sec, obj=0.505]
INFO - 09:07:22: ...  83%|████████▎ | 83/100 [00:00<00:00, 1588.24 it/sec, obj=1.99]
INFO - 09:07:22: ...  84%|████████▍ | 84/100 [00:00<00:00, 1589.88 it/sec, obj=0.574]
INFO - 09:07:22: ...  85%|████████▌ | 85/100 [00:00<00:00, 1590.29 it/sec, obj=-2.06]
INFO - 09:07:22: ...  86%|████████▌ | 86/100 [00:00<00:00, 1590.91 it/sec, obj=-1.49]
INFO - 09:07:22: ...  87%|████████▋ | 87/100 [00:00<00:00, 1592.36 it/sec, obj=0.61]
INFO - 09:07:22: ...  88%|████████▊ | 88/100 [00:00<00:00, 1593.74 it/sec, obj=0.542]
INFO - 09:07:22: ...  89%|████████▉ | 89/100 [00:00<00:00, 1595.21 it/sec, obj=-1.5]
INFO - 09:07:22: ...  90%|█████████ | 90/100 [00:00<00:00, 1596.57 it/sec, obj=0.201]
INFO - 09:07:22: ...  91%|█████████ | 91/100 [00:00<00:00, 1597.96 it/sec, obj=0.949]
INFO - 09:07:22: ...  92%|█████████▏| 92/100 [00:00<00:00, 1597.88 it/sec, obj=-1.86]
INFO - 09:07:22: ...  93%|█████████▎| 93/100 [00:00<00:00, 1598.41 it/sec, obj=-.0722]
INFO - 09:07:22: ...  94%|█████████▍| 94/100 [00:00<00:00, 1599.56 it/sec, obj=-.407]
INFO - 09:07:22: ...  95%|█████████▌| 95/100 [00:00<00:00, 1600.15 it/sec, obj=0.194]
INFO - 09:07:22: ...  96%|█████████▌| 96/100 [00:00<00:00, 1601.25 it/sec, obj=-.207]
INFO - 09:07:22: ...  97%|█████████▋| 97/100 [00:00<00:00, 1602.37 it/sec, obj=0.462]
INFO - 09:07:22: ...  98%|█████████▊| 98/100 [00:00<00:00, 1603.53 it/sec, obj=-2.37]
INFO - 09:07:22: ...  99%|█████████▉| 99/100 [00:00<00:00, 1603.59 it/sec, obj=1.32]
INFO - 09:07:22: ... 100%|██████████| 100/100 [00:00<00:00, 1604.63 it/sec, obj=-2.21]
INFO - 09:07:22: Optimization result:
INFO - 09:07:22:    Optimizer info:
INFO - 09:07:22:       Status: None
INFO - 09:07:22:       Message: None
INFO - 09:07:22:       Number of calls to the objective function by the optimizer: 100
INFO - 09:07:22:    Solution:
INFO - 09:07:22:       Objective: -3.3284373246961634
INFO - 09:07:22:       +-----------------------------------------------------------------------------------------+
INFO - 09:07:22:       |                                     Parameter space                                     |
INFO - 09:07:22:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:22:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 09:07:22:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:22:       | x    |      -2     | -1.959995425007306 |      2      | float |                         |
INFO - 09:07:22:       | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 09:07:22:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:22: *** End DOEScenario execution (time: 0:00:00.086492) ***

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


We can export the optimization problem to a Dataset:

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


and visualize it in a tabular way:

print(dataset.export_to_dataframe())

   design_parameters           functions
x         y         z
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 with a graphical post-processing, e.g. a scatter plot matrix:

dataset.plot("ScatterMatrix")

/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0/lib/python3.9/site-packages/gemseo/post/dataset/scatter_plot_matrix.py:135: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared.
sub_axes = scatter_matrix(

<gemseo.post.dataset.scatter_plot_matrix.ScatterMatrix object at 0x7fd3831f3730>


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 - 09:07:23:
INFO - 09:07:23: *** Start DOEScenario execution ***
INFO - 09:07:23: DOEScenario
INFO - 09:07:23:    Disciplines: AnalyticDiscipline
INFO - 09:07:23:    MDO formulation: DisciplinaryOpt
INFO - 09:07:23: Optimization problem:
INFO - 09:07:23:    minimize z(y)
INFO - 09:07:23:    with respect to y
INFO - 09:07:23:    over the design space:
INFO - 09:07:23:    |                                     Parameter space                                     |
INFO - 09:07:23:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23:    | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 09:07:23:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23:    | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 09:07:23:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23: Solving optimization problem with algorithm lhs:
INFO - 09:07:23: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 09:07:23: ...   1%|          | 1/100 [00:00<00:00, 1701.54 it/sec, obj=-.641]
INFO - 09:07:23: ...   2%|▏         | 2/100 [00:00<00:00, 1602.41 it/sec, obj=-.394]
INFO - 09:07:23: ...   3%|▎         | 3/100 [00:00<00:00, 1599.86 it/sec, obj=0.551]
INFO - 09:07:23: ...   4%|▍         | 4/100 [00:00<00:00, 1615.21 it/sec, obj=0.944]
INFO - 09:07:23: ...   5%|▌         | 5/100 [00:00<00:00, 1627.34 it/sec, obj=-2.12]
INFO - 09:07:23: ...   6%|▌         | 6/100 [00:00<00:00, 1636.27 it/sec, obj=-1.64]
INFO - 09:07:23: ...   7%|▋         | 7/100 [00:00<00:00, 1627.86 it/sec, obj=0.656]
INFO - 09:07:23: ...   8%|▊         | 8/100 [00:00<00:00, 1631.39 it/sec, obj=-.612]
INFO - 09:07:23: ...   9%|▉         | 9/100 [00:00<00:00, 1613.47 it/sec, obj=0.736]
INFO - 09:07:23: ...  10%|█         | 10/100 [00:00<00:00, 1618.05 it/sec, obj=0.36]
INFO - 09:07:23: ...  11%|█         | 11/100 [00:00<00:00, 1623.30 it/sec, obj=-.31]
INFO - 09:07:23: ...  12%|█▏        | 12/100 [00:00<00:00, 1628.65 it/sec, obj=0.324]
INFO - 09:07:23: ...  13%|█▎        | 13/100 [00:00<00:00, 1633.05 it/sec, obj=-1.73]
INFO - 09:07:23: ...  14%|█▍        | 14/100 [00:00<00:00, 1636.98 it/sec, obj=0.494]
INFO - 09:07:23: ...  15%|█▌        | 15/100 [00:00<00:00, 1640.19 it/sec, obj=-.148]
INFO - 09:07:23: ...  16%|█▌        | 16/100 [00:00<00:00, 1635.84 it/sec, obj=1.1]
INFO - 09:07:23: ...  17%|█▋        | 17/100 [00:00<00:00, 1637.80 it/sec, obj=-.716]
INFO - 09:07:23: ...  18%|█▊        | 18/100 [00:00<00:00, 1640.54 it/sec, obj=0.0421]
INFO - 09:07:23: ...  19%|█▉        | 19/100 [00:00<00:00, 1643.20 it/sec, obj=0.256]
INFO - 09:07:23: ...  20%|██        | 20/100 [00:00<00:00, 1646.12 it/sec, obj=-1.45]
INFO - 09:07:23: ...  21%|██        | 21/100 [00:00<00:00, 1648.24 it/sec, obj=0.637]
INFO - 09:07:23: ...  22%|██▏       | 22/100 [00:00<00:00, 1646.97 it/sec, obj=1.97]
INFO - 09:07:23: ...  23%|██▎       | 23/100 [00:00<00:00, 1646.68 it/sec, obj=-.208]
INFO - 09:07:23: ...  24%|██▍       | 24/100 [00:00<00:00, 1646.17 it/sec, obj=0.18]
INFO - 09:07:23: ...  25%|██▌       | 25/100 [00:00<00:00, 1647.10 it/sec, obj=0.000485]
INFO - 09:07:23: ...  26%|██▌       | 26/100 [00:00<00:00, 1648.83 it/sec, obj=1.17]
INFO - 09:07:23: ...  27%|██▋       | 27/100 [00:00<00:00, 1650.31 it/sec, obj=-.305]
INFO - 09:07:23: ...  28%|██▊       | 28/100 [00:00<00:00, 1651.39 it/sec, obj=0.68]
INFO - 09:07:23: ...  29%|██▉       | 29/100 [00:00<00:00, 1648.88 it/sec, obj=-.932]
INFO - 09:07:23: ...  30%|███       | 30/100 [00:00<00:00, 1649.59 it/sec, obj=0.901]
INFO - 09:07:23: ...  31%|███       | 31/100 [00:00<00:00, 1651.01 it/sec, obj=0.454]
INFO - 09:07:23: ...  32%|███▏      | 32/100 [00:00<00:00, 1652.26 it/sec, obj=-1.16]
INFO - 09:07:23: ...  33%|███▎      | 33/100 [00:00<00:00, 1653.37 it/sec, obj=1.44]
INFO - 09:07:23: ...  34%|███▍      | 34/100 [00:00<00:00, 1654.40 it/sec, obj=0.798]
INFO - 09:07:23: ...  35%|███▌      | 35/100 [00:00<00:00, 1655.25 it/sec, obj=1.59]
INFO - 09:07:23: ...  36%|███▌      | 36/100 [00:00<00:00, 1652.91 it/sec, obj=2.05]
INFO - 09:07:23: ...  37%|███▋      | 37/100 [00:00<00:00, 1653.64 it/sec, obj=-.26]
INFO - 09:07:23: ...  38%|███▊      | 38/100 [00:00<00:00, 1654.66 it/sec, obj=0.874]
INFO - 09:07:23: ...  39%|███▉      | 39/100 [00:00<00:00, 1642.46 it/sec, obj=0.832]
INFO - 09:07:23: ...  40%|████      | 40/100 [00:00<00:00, 1643.02 it/sec, obj=-1.38]
INFO - 09:07:23: ...  41%|████      | 41/100 [00:00<00:00, 1644.05 it/sec, obj=1.52]
INFO - 09:07:23: ...  42%|████▏     | 42/100 [00:00<00:00, 1642.45 it/sec, obj=-.522]
INFO - 09:07:23: ...  43%|████▎     | 43/100 [00:00<00:00, 1642.68 it/sec, obj=1.4]
INFO - 09:07:23: ...  44%|████▍     | 44/100 [00:00<00:00, 1643.74 it/sec, obj=-.484]
INFO - 09:07:23: ...  45%|████▌     | 45/100 [00:00<00:00, 1644.61 it/sec, obj=-.91]
INFO - 09:07:23: ...  46%|████▌     | 46/100 [00:00<00:00, 1645.40 it/sec, obj=0.343]
INFO - 09:07:23: ...  47%|████▋     | 47/100 [00:00<00:00, 1646.27 it/sec, obj=-.441]
INFO - 09:07:23: ...  48%|████▊     | 48/100 [00:00<00:00, 1647.27 it/sec, obj=-.871]
INFO - 09:07:23: ...  49%|████▉     | 49/100 [00:00<00:00, 1645.00 it/sec, obj=2.67]
INFO - 09:07:23: ...  50%|█████     | 50/100 [00:00<00:00, 1645.70 it/sec, obj=0.217]
INFO - 09:07:23: ...  51%|█████     | 51/100 [00:00<00:00, 1646.29 it/sec, obj=-.425]
INFO - 09:07:23: ...  52%|█████▏    | 52/100 [00:00<00:00, 1647.07 it/sec, obj=0.113]
INFO - 09:07:23: ...  53%|█████▎    | 53/100 [00:00<00:00, 1647.80 it/sec, obj=-.377]
INFO - 09:07:23: ...  54%|█████▍    | 54/100 [00:00<00:00, 1648.69 it/sec, obj=-1.19]
INFO - 09:07:23: ...  55%|█████▌    | 55/100 [00:00<00:00, 1647.94 it/sec, obj=-.528]
INFO - 09:07:23: ...  56%|█████▌    | 56/100 [00:00<00:00, 1647.66 it/sec, obj=-2.64]
INFO - 09:07:23: ...  57%|█████▋    | 57/100 [00:00<00:00, 1648.17 it/sec, obj=-.0776]
INFO - 09:07:23: ...  58%|█████▊    | 58/100 [00:00<00:00, 1648.64 it/sec, obj=1.08]
INFO - 09:07:23: ...  59%|█████▉    | 59/100 [00:00<00:00, 1649.07 it/sec, obj=-2.05]
INFO - 09:07:23: ...  60%|██████    | 60/100 [00:00<00:00, 1648.45 it/sec, obj=0.0555]
INFO - 09:07:23: ...  61%|██████    | 61/100 [00:00<00:00, 1648.57 it/sec, obj=-1.84]
INFO - 09:07:23: ...  62%|██████▏   | 62/100 [00:00<00:00, 1647.24 it/sec, obj=0.4]
INFO - 09:07:23: ...  63%|██████▎   | 63/100 [00:00<00:00, 1647.54 it/sec, obj=-.195]
INFO - 09:07:23: ...  64%|██████▍   | 64/100 [00:00<00:00, 1647.97 it/sec, obj=-.578]
INFO - 09:07:23: ...  65%|██████▌   | 65/100 [00:00<00:00, 1648.38 it/sec, obj=-.977]
INFO - 09:07:23: ...  66%|██████▌   | 66/100 [00:00<00:00, 1648.83 it/sec, obj=-.114]
INFO - 09:07:23: ...  67%|██████▋   | 67/100 [00:00<00:00, 1649.26 it/sec, obj=0.587]
INFO - 09:07:23: ...  68%|██████▊   | 68/100 [00:00<00:00, 1648.89 it/sec, obj=-.0679]
INFO - 09:07:23: ...  69%|██████▉   | 69/100 [00:00<00:00, 1648.29 it/sec, obj=-.0218]
INFO - 09:07:23: ...  70%|███████   | 70/100 [00:00<00:00, 1648.37 it/sec, obj=-.228]
INFO - 09:07:23: ...  71%|███████   | 71/100 [00:00<00:00, 1648.67 it/sec, obj=1.21]
INFO - 09:07:23: ...  72%|███████▏  | 72/100 [00:00<00:00, 1648.99 it/sec, obj=-.34]
INFO - 09:07:23: ...  73%|███████▎  | 73/100 [00:00<00:00, 1649.40 it/sec, obj=0.513]
INFO - 09:07:23: ...  74%|███████▍  | 74/100 [00:00<00:00, 1649.97 it/sec, obj=1.67]
INFO - 09:07:23: ...  75%|███████▌  | 75/100 [00:00<00:00, 1649.62 it/sec, obj=0.557]
INFO - 09:07:23: ...  76%|███████▌  | 76/100 [00:00<00:00, 1649.30 it/sec, obj=0.431]
INFO - 09:07:23: ...  77%|███████▋  | 77/100 [00:00<00:00, 1649.66 it/sec, obj=-1.31]
INFO - 09:07:23: ...  78%|███████▊  | 78/100 [00:00<00:00, 1650.12 it/sec, obj=-.678]
INFO - 09:07:23: ...  79%|███████▉  | 79/100 [00:00<00:00, 1650.49 it/sec, obj=-1.01]
INFO - 09:07:23: ...  80%|████████  | 80/100 [00:00<00:00, 1650.83 it/sec, obj=0.246]
INFO - 09:07:23: ...  81%|████████  | 81/100 [00:00<00:00, 1651.14 it/sec, obj=1.29]
INFO - 09:07:23: ...  82%|████████▏ | 82/100 [00:00<00:00, 1649.83 it/sec, obj=0.75]
INFO - 09:07:23: ...  83%|████████▎ | 83/100 [00:00<00:00, 1650.08 it/sec, obj=-1.54]
INFO - 09:07:23: ...  84%|████████▍ | 84/100 [00:00<00:00, 1650.55 it/sec, obj=-.156]
INFO - 09:07:23: ...  85%|████████▌ | 85/100 [00:00<00:00, 1650.76 it/sec, obj=1.87]
INFO - 09:07:23: ...  86%|████████▌ | 86/100 [00:00<00:00, 1650.92 it/sec, obj=-1.08]
INFO - 09:07:23: ...  87%|████████▋ | 87/100 [00:00<00:00, 1651.20 it/sec, obj=-.647]
INFO - 09:07:23: ...  88%|████████▊ | 88/100 [00:00<00:00, 1650.84 it/sec, obj=0.968]
INFO - 09:07:23: ...  89%|████████▉ | 89/100 [00:00<00:00, 1650.63 it/sec, obj=-.773]
INFO - 09:07:23: ...  90%|█████████ | 90/100 [00:00<00:00, 1650.97 it/sec, obj=1.26]
INFO - 09:07:23: ...  91%|█████████ | 91/100 [00:00<00:00, 1651.38 it/sec, obj=0.166]
INFO - 09:07:23: ...  92%|█████████▏| 92/100 [00:00<00:00, 1651.46 it/sec, obj=0.29]
INFO - 09:07:23: ...  93%|█████████▎| 93/100 [00:00<00:00, 1651.69 it/sec, obj=0.127]
INFO - 09:07:23: ...  94%|█████████▍| 94/100 [00:00<00:00, 1651.97 it/sec, obj=-1.26]
INFO - 09:07:23: ...  95%|█████████▌| 95/100 [00:00<00:00, 1651.28 it/sec, obj=1.01]
INFO - 09:07:23: ...  96%|█████████▌| 96/100 [00:00<00:00, 1651.36 it/sec, obj=0.0819]
INFO - 09:07:23: ...  97%|█████████▋| 97/100 [00:00<00:00, 1651.64 it/sec, obj=-1.09]
INFO - 09:07:23: ...  98%|█████████▊| 98/100 [00:00<00:00, 1651.89 it/sec, obj=-.762]
INFO - 09:07:23: ...  99%|█████████▉| 99/100 [00:00<00:00, 1652.15 it/sec, obj=-.0429]
INFO - 09:07:23: ... 100%|██████████| 100/100 [00:00<00:00, 1652.46 it/sec, obj=-.813]
INFO - 09:07:23: Optimization result:
INFO - 09:07:23:    Optimizer info:
INFO - 09:07:23:       Status: None
INFO - 09:07:23:       Message: None
INFO - 09:07:23:       Number of calls to the objective function by the optimizer: 100
INFO - 09:07:23:    Solution:
INFO - 09:07:23:       Objective: -2.6379682068246657
INFO - 09:07:23:       +-----------------------------------------------------------------------------------------+
INFO - 09:07:23:       |                                     Parameter space                                     |
INFO - 09:07:23:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 09:07:23:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23:       | y    |     -inf    | -2.637968206824666 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 09:07:23:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 09:07:23: *** End DOEScenario execution (time: 0:00:00.083193) ***

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


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.export_to_dataset(name="samples")
print(dataset.export_to_dataframe())

   design_parameters functions
y         z
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.682 seconds)

Gallery generated by Sphinx-Gallery