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


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)
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 - 17:00:13:
INFO - 17:00:13: *** Start DOEScenario execution ***
INFO - 17:00:13: DOEScenario
INFO - 17:00:13:    Disciplines: AnalyticDiscipline
INFO - 17:00:13:    MDO formulation: DisciplinaryOpt
INFO - 17:00:13: Optimization problem:
INFO - 17:00:13:    minimize z(x, y)
INFO - 17:00:13:    with respect to x, y
INFO - 17:00:13:    over the design space:
INFO - 17:00:13:    |                              Parameter space                               |
INFO - 17:00:13:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 17:00:13:    | name | lower_bound | value | upper_bound | type  |   Initial distribution  |
INFO - 17:00:13:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 17:00:13:    | x    |      -2     |  None |      2      | float |                         |
INFO - 17:00:13:    | y    |     -inf    |   0   |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 17:00:13:    +------+-------------+-------+-------------+-------+-------------------------+
INFO - 17:00:13: Solving optimization problem with algorithm lhs:
INFO - 17:00:13: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 17:00:13: ...   1%|          | 1/100 [00:00<00:00, 392.54 it/sec, obj=3.12]
INFO - 17:00:13: ...   2%|▏         | 2/100 [00:00<00:00, 643.05 it/sec, obj=1.72]
INFO - 17:00:13: ...   3%|▎         | 3/100 [00:00<00:00, 829.02 it/sec, obj=0.181]
INFO - 17:00:13: ...   4%|▍         | 4/100 [00:00<00:00, 972.48 it/sec, obj=3.76]
INFO - 17:00:13: ...   5%|▌         | 5/100 [00:00<00:00, 1062.93 it/sec, obj=2.15]
INFO - 17:00:13: ...   6%|▌         | 6/100 [00:00<00:00, 1136.51 it/sec, obj=-.666]
INFO - 17:00:13: ...   7%|▋         | 7/100 [00:00<00:00, 1197.30 it/sec, obj=1.53]
INFO - 17:00:13: ...   8%|▊         | 8/100 [00:00<00:00, 1261.87 it/sec, obj=1.7]
INFO - 17:00:13: ...   9%|▉         | 9/100 [00:00<00:00, 1317.40 it/sec, obj=-2.27]
INFO - 17:00:13: ...  10%|█         | 10/100 [00:00<00:00, 1365.47 it/sec, obj=-2.08]
INFO - 17:00:13: ...  11%|█         | 11/100 [00:00<00:00, 1407.91 it/sec, obj=-2.8]
INFO - 17:00:13: ...  12%|█▏        | 12/100 [00:00<00:00, 1438.33 it/sec, obj=-1.31]
INFO - 17:00:13: ...  13%|█▎        | 13/100 [00:00<00:00, 1457.72 it/sec, obj=1.1]
INFO - 17:00:13: ...  14%|█▍        | 14/100 [00:00<00:00, 1471.28 it/sec, obj=0.38]
INFO - 17:00:13: ...  15%|█▌        | 15/100 [00:00<00:00, 1497.97 it/sec, obj=1.68]
INFO - 17:00:13: ...  16%|█▌        | 16/100 [00:00<00:00, 1523.19 it/sec, obj=0.672]
INFO - 17:00:13: ...  17%|█▋        | 17/100 [00:00<00:00, 1546.10 it/sec, obj=0.643]
INFO - 17:00:13: ...  18%|█▊        | 18/100 [00:00<00:00, 1567.09 it/sec, obj=0.568]
INFO - 17:00:13: ...  19%|█▉        | 19/100 [00:00<00:00, 1586.44 it/sec, obj=-.277]
INFO - 17:00:13: ...  20%|██        | 20/100 [00:00<00:00, 1594.46 it/sec, obj=1.51]
INFO - 17:00:13: ...  21%|██        | 21/100 [00:00<00:00, 1600.76 it/sec, obj=1.83]
INFO - 17:00:13: ...  22%|██▏       | 22/100 [00:00<00:00, 1605.81 it/sec, obj=2.12]
INFO - 17:00:13: ...  23%|██▎       | 23/100 [00:00<00:00, 1620.27 it/sec, obj=0.526]
INFO - 17:00:13: ...  24%|██▍       | 24/100 [00:00<00:00, 1634.12 it/sec, obj=1.47]
INFO - 17:00:13: ...  25%|██▌       | 25/100 [00:00<00:00, 1647.05 it/sec, obj=-1.49]
INFO - 17:00:13: ...  26%|██▌       | 26/100 [00:00<00:00, 1659.19 it/sec, obj=-1.58]
INFO - 17:00:13: ...  27%|██▋       | 27/100 [00:00<00:00, 1670.67 it/sec, obj=1.59]
INFO - 17:00:13: ...  28%|██▊       | 28/100 [00:00<00:00, 1671.06 it/sec, obj=0.329]
INFO - 17:00:13: ...  29%|██▉       | 29/100 [00:00<00:00, 1673.98 it/sec, obj=-1.46]
INFO - 17:00:13: ...  30%|███       | 30/100 [00:00<00:00, 1678.64 it/sec, obj=-.045]
INFO - 17:00:13: ...  31%|███       | 31/100 [00:00<00:00, 1688.07 it/sec, obj=-.736]
INFO - 17:00:13: ...  32%|███▏      | 32/100 [00:00<00:00, 1697.05 it/sec, obj=0.867]
INFO - 17:00:13: ...  33%|███▎      | 33/100 [00:00<00:00, 1705.80 it/sec, obj=-3.12]
INFO - 17:00:13: ...  34%|███▍      | 34/100 [00:00<00:00, 1713.96 it/sec, obj=-.252]
INFO - 17:00:13: ...  35%|███▌      | 35/100 [00:00<00:00, 1717.99 it/sec, obj=1.46]
INFO - 17:00:13: ...  36%|███▌      | 36/100 [00:00<00:00, 1718.23 it/sec, obj=-2.02]
INFO - 17:00:13: ...  37%|███▋      | 37/100 [00:00<00:00, 1716.87 it/sec, obj=-1.68]
INFO - 17:00:13: ...  38%|███▊      | 38/100 [00:00<00:00, 1723.46 it/sec, obj=-.913]
INFO - 17:00:13: ...  39%|███▉      | 39/100 [00:00<00:00, 1730.23 it/sec, obj=-2.38]
INFO - 17:00:13: ...  40%|████      | 40/100 [00:00<00:00, 1736.70 it/sec, obj=1.07]
INFO - 17:00:13: ...  41%|████      | 41/100 [00:00<00:00, 1742.84 it/sec, obj=3.77]
INFO - 17:00:13: ...  42%|████▏     | 42/100 [00:00<00:00, 1748.95 it/sec, obj=-1.88]
INFO - 17:00:13: ...  43%|████▎     | 43/100 [00:00<00:00, 1748.78 it/sec, obj=0.116]
INFO - 17:00:13: ...  44%|████▍     | 44/100 [00:00<00:00, 1748.70 it/sec, obj=-1.51]
INFO - 17:00:13: ...  45%|████▌     | 45/100 [00:00<00:00, 1749.13 it/sec, obj=-.0194]
INFO - 17:00:13: ...  46%|████▌     | 46/100 [00:00<00:00, 1753.73 it/sec, obj=0.984]
INFO - 17:00:13: ...  47%|████▋     | 47/100 [00:00<00:00, 1752.15 it/sec, obj=-.34]
INFO - 17:00:13: ...  48%|████▊     | 48/100 [00:00<00:00, 1756.39 it/sec, obj=-.941]
INFO - 17:00:13: ...  49%|████▉     | 49/100 [00:00<00:00, 1761.15 it/sec, obj=0.363]
INFO - 17:00:13: ...  50%|█████     | 50/100 [00:00<00:00, 1760.55 it/sec, obj=-1.01]
INFO - 17:00:13: ...  51%|█████     | 51/100 [00:00<00:00, 1759.73 it/sec, obj=-.359]
INFO - 17:00:13: ...  52%|█████▏    | 52/100 [00:00<00:00, 1758.39 it/sec, obj=-3.06]
INFO - 17:00:13: ...  53%|█████▎    | 53/100 [00:00<00:00, 1762.58 it/sec, obj=2.34]
INFO - 17:00:13: ...  54%|█████▍    | 54/100 [00:00<00:00, 1766.82 it/sec, obj=-.262]
INFO - 17:00:13: ...  55%|█████▌    | 55/100 [00:00<00:00, 1770.93 it/sec, obj=0.812]
INFO - 17:00:13: ...  56%|█████▌    | 56/100 [00:00<00:00, 1775.04 it/sec, obj=-2.47]
INFO - 17:00:13: ...  57%|█████▋    | 57/100 [00:00<00:00, 1779.15 it/sec, obj=1.49]
INFO - 17:00:13: ...  58%|█████▊    | 58/100 [00:00<00:00, 1778.73 it/sec, obj=0.268]
INFO - 17:00:13: ...  59%|█████▉    | 59/100 [00:00<00:00, 1778.04 it/sec, obj=0.559]
INFO - 17:00:13: ...  60%|██████    | 60/100 [00:00<00:00, 1777.71 it/sec, obj=-2.01]
INFO - 17:00:13: ...  61%|██████    | 61/100 [00:00<00:00, 1781.19 it/sec, obj=-.854]
INFO - 17:00:13: ...  62%|██████▏   | 62/100 [00:00<00:00, 1784.82 it/sec, obj=1.61]
INFO - 17:00:13: ...  63%|██████▎   | 63/100 [00:00<00:00, 1788.24 it/sec, obj=-2.64]
INFO - 17:00:13: ...  64%|██████▍   | 64/100 [00:00<00:00, 1791.55 it/sec, obj=0.818]
INFO - 17:00:13: ...  65%|██████▌   | 65/100 [00:00<00:00, 1794.23 it/sec, obj=1.04]
INFO - 17:00:13: ...  66%|██████▌   | 66/100 [00:00<00:00, 1792.50 it/sec, obj=-.832]
INFO - 17:00:13: ...  67%|██████▋   | 67/100 [00:00<00:00, 1791.90 it/sec, obj=0.692]
INFO - 17:00:13: ...  68%|██████▊   | 68/100 [00:00<00:00, 1792.73 it/sec, obj=-3.33]
INFO - 17:00:13: ...  69%|██████▉   | 69/100 [00:00<00:00, 1795.79 it/sec, obj=0.47]
INFO - 17:00:13: ...  70%|███████   | 70/100 [00:00<00:00, 1798.92 it/sec, obj=0.445]
INFO - 17:00:13: ...  71%|███████   | 71/100 [00:00<00:00, 1801.95 it/sec, obj=0.402]
INFO - 17:00:13: ...  72%|███████▏  | 72/100 [00:00<00:00, 1804.89 it/sec, obj=2.77]
INFO - 17:00:13: ...  73%|███████▎  | 73/100 [00:00<00:00, 1805.32 it/sec, obj=-.256]
INFO - 17:00:13: ...  74%|███████▍  | 74/100 [00:00<00:00, 1803.34 it/sec, obj=3.36]
INFO - 17:00:13: ...  75%|███████▌  | 75/100 [00:00<00:00, 1801.05 it/sec, obj=-.229]
INFO - 17:00:13: ...  76%|███████▌  | 76/100 [00:00<00:00, 1802.06 it/sec, obj=-.739]
INFO - 17:00:13: ...  77%|███████▋  | 77/100 [00:00<00:00, 1804.39 it/sec, obj=0.808]
INFO - 17:00:13: ...  78%|███████▊  | 78/100 [00:00<00:00, 1807.02 it/sec, obj=-.377]
INFO - 17:00:13: ...  79%|███████▉  | 79/100 [00:00<00:00, 1809.65 it/sec, obj=0.708]
INFO - 17:00:13: ...  80%|████████  | 80/100 [00:00<00:00, 1811.99 it/sec, obj=-.874]
INFO - 17:00:13: ...  81%|████████  | 81/100 [00:00<00:00, 1810.18 it/sec, obj=-1.29]
INFO - 17:00:13: ...  82%|████████▏ | 82/100 [00:00<00:00, 1809.36 it/sec, obj=0.505]
INFO - 17:00:13: ...  83%|████████▎ | 83/100 [00:00<00:00, 1809.50 it/sec, obj=1.99]
INFO - 17:00:13: ...  84%|████████▍ | 84/100 [00:00<00:00, 1811.90 it/sec, obj=0.574]
INFO - 17:00:13: ...  85%|████████▌ | 85/100 [00:00<00:00, 1814.25 it/sec, obj=-2.06]
INFO - 17:00:13: ...  86%|████████▌ | 86/100 [00:00<00:00, 1816.39 it/sec, obj=-1.49]
INFO - 17:00:13: ...  87%|████████▋ | 87/100 [00:00<00:00, 1818.72 it/sec, obj=0.61]
INFO - 17:00:13: ...  88%|████████▊ | 88/100 [00:00<00:00, 1819.13 it/sec, obj=0.542]
INFO - 17:00:13: ...  89%|████████▉ | 89/100 [00:00<00:00, 1818.32 it/sec, obj=-1.5]
INFO - 17:00:13: ...  90%|█████████ | 90/100 [00:00<00:00, 1816.29 it/sec, obj=0.201]
INFO - 17:00:13: ...  91%|█████████ | 91/100 [00:00<00:00, 1818.08 it/sec, obj=0.949]
INFO - 17:00:13: ...  92%|█████████▏| 92/100 [00:00<00:00, 1820.05 it/sec, obj=-1.86]
INFO - 17:00:13: ...  93%|█████████▎| 93/100 [00:00<00:00, 1822.07 it/sec, obj=-.0722]
INFO - 17:00:13: ...  94%|█████████▍| 94/100 [00:00<00:00, 1824.11 it/sec, obj=-.407]
INFO - 17:00:13: ...  95%|█████████▌| 95/100 [00:00<00:00, 1825.14 it/sec, obj=0.194]
INFO - 17:00:13: ...  96%|█████████▌| 96/100 [00:00<00:00, 1824.10 it/sec, obj=-.207]
INFO - 17:00:13: ...  97%|█████████▋| 97/100 [00:00<00:00, 1823.19 it/sec, obj=0.462]
INFO - 17:00:13: ...  98%|█████████▊| 98/100 [00:00<00:00, 1822.73 it/sec, obj=-2.37]
INFO - 17:00:13: ...  99%|█████████▉| 99/100 [00:00<00:00, 1824.50 it/sec, obj=1.32]
INFO - 17:00:13: ... 100%|██████████| 100/100 [00:00<00:00, 1826.26 it/sec, obj=-2.21]
INFO - 17:00:13: Optimization result:
INFO - 17:00:13:    Optimizer info:
INFO - 17:00:13:       Status: None
INFO - 17:00:13:       Message: None
INFO - 17:00:13:       Number of calls to the objective function by the optimizer: 100
INFO - 17:00:13:    Solution:
INFO - 17:00:13:       Objective: -3.3284373246961634
INFO - 17:00:13:       +-----------------------------------------------------------------------------------------+
INFO - 17:00:13:       |                                     Parameter space                                     |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:       | x    |      -2     | -1.959995425007306 |      2      | float |                         |
INFO - 17:00:13:       | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13: *** End DOEScenario execution (time: 0:00:00.077072) ***

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


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

dataset = scenario.export_to_dataset(opt_naming=False)


This visualization can be tabular for example:

print(dataset.export_to_dataframe())

      inputs             outputs
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 graphical by means of a scatter plot matrix for example:

dataset.plot("ScatterMatrix")

/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/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 0x7fbc55f32670>


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 0x7fbc559a95e0>


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 - 17:00:13:
INFO - 17:00:13: *** Start DOEScenario execution ***
INFO - 17:00:13: DOEScenario
INFO - 17:00:13:    Disciplines: AnalyticDiscipline
INFO - 17:00:13:    MDO formulation: DisciplinaryOpt
INFO - 17:00:13: Optimization problem:
INFO - 17:00:13:    minimize z(y)
INFO - 17:00:13:    with respect to y
INFO - 17:00:13:    over the design space:
INFO - 17:00:13:    |                                     Parameter space                                     |
INFO - 17:00:13:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:    | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 17:00:13:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:    | y    |     -inf    | -1.368441899688857 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 17:00:13:    +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13: Solving optimization problem with algorithm lhs:
INFO - 17:00:13: ...   0%|          | 0/100 [00:00<?, ?it]
INFO - 17:00:13: ...   1%|          | 1/100 [00:00<00:00, 2229.83 it/sec, obj=-.641]
INFO - 17:00:13: ...   2%|▏         | 2/100 [00:00<00:00, 2057.04 it/sec, obj=-.394]
INFO - 17:00:13: ...   3%|▎         | 3/100 [00:00<00:00, 2025.26 it/sec, obj=0.551]
INFO - 17:00:13: ...   4%|▍         | 4/100 [00:00<00:00, 1974.02 it/sec, obj=0.944]
INFO - 17:00:13: ...   5%|▌         | 5/100 [00:00<00:00, 1912.59 it/sec, obj=-2.12]
INFO - 17:00:13: ...   6%|▌         | 6/100 [00:00<00:00, 1859.18 it/sec, obj=-1.64]
INFO - 17:00:13: ...   7%|▋         | 7/100 [00:00<00:00, 1872.22 it/sec, obj=0.656]
INFO - 17:00:13: ...   8%|▊         | 8/100 [00:00<00:00, 1883.07 it/sec, obj=-.612]
INFO - 17:00:13: ...   9%|▉         | 9/100 [00:00<00:00, 1892.93 it/sec, obj=0.736]
INFO - 17:00:13: ...  10%|█         | 10/100 [00:00<00:00, 1900.37 it/sec, obj=0.36]
INFO - 17:00:13: ...  11%|█         | 11/100 [00:00<00:00, 1907.05 it/sec, obj=-.31]
INFO - 17:00:13: ...  12%|█▏        | 12/100 [00:00<00:00, 1886.49 it/sec, obj=0.324]
INFO - 17:00:13: ...  13%|█▎        | 13/100 [00:00<00:00, 1871.11 it/sec, obj=-1.73]
INFO - 17:00:13: ...  14%|█▍        | 14/100 [00:00<00:00, 1860.06 it/sec, obj=0.494]
INFO - 17:00:13: ...  15%|█▌        | 15/100 [00:00<00:00, 1866.40 it/sec, obj=-.148]
INFO - 17:00:13: ...  16%|█▌        | 16/100 [00:00<00:00, 1872.56 it/sec, obj=1.1]
INFO - 17:00:13: ...  17%|█▋        | 17/100 [00:00<00:00, 1878.67 it/sec, obj=-.716]
INFO - 17:00:13: ...  18%|█▊        | 18/100 [00:00<00:00, 1884.37 it/sec, obj=0.0421]
INFO - 17:00:13: ...  19%|█▉        | 19/100 [00:00<00:00, 1878.19 it/sec, obj=0.256]
INFO - 17:00:13: ...  20%|██        | 20/100 [00:00<00:00, 1867.70 it/sec, obj=-1.45]
INFO - 17:00:13: ...  21%|██        | 21/100 [00:00<00:00, 1856.12 it/sec, obj=0.637]
INFO - 17:00:13: ...  22%|██▏       | 22/100 [00:00<00:00, 1860.04 it/sec, obj=1.97]
INFO - 17:00:13: ...  23%|██▎       | 23/100 [00:00<00:00, 1864.89 it/sec, obj=-.208]
INFO - 17:00:13: ...  24%|██▍       | 24/100 [00:00<00:00, 1865.69 it/sec, obj=0.18]
INFO - 17:00:13: ...  25%|██▌       | 25/100 [00:00<00:00, 1869.09 it/sec, obj=0.000485]
INFO - 17:00:13: ...  26%|██▌       | 26/100 [00:00<00:00, 1864.87 it/sec, obj=1.17]
INFO - 17:00:13: ...  27%|██▋       | 27/100 [00:00<00:00, 1854.79 it/sec, obj=-.305]
INFO - 17:00:13: ...  28%|██▊       | 28/100 [00:00<00:00, 1844.78 it/sec, obj=0.68]
INFO - 17:00:13: ...  29%|██▉       | 29/100 [00:00<00:00, 1847.85 it/sec, obj=-.932]
INFO - 17:00:13: ...  30%|███       | 30/100 [00:00<00:00, 1852.06 it/sec, obj=0.901]
INFO - 17:00:13: ...  31%|███       | 31/100 [00:00<00:00, 1855.70 it/sec, obj=0.454]
INFO - 17:00:13: ...  32%|███▏      | 32/100 [00:00<00:00, 1859.62 it/sec, obj=-1.16]
INFO - 17:00:13: ...  33%|███▎      | 33/100 [00:00<00:00, 1863.23 it/sec, obj=1.44]
INFO - 17:00:13: ...  34%|███▍      | 34/100 [00:00<00:00, 1858.43 it/sec, obj=0.798]
INFO - 17:00:13: ...  35%|███▌      | 35/100 [00:00<00:00, 1853.43 it/sec, obj=1.59]
INFO - 17:00:13: ...  36%|███▌      | 36/100 [00:00<00:00, 1849.59 it/sec, obj=2.05]
INFO - 17:00:13: ...  37%|███▋      | 37/100 [00:00<00:00, 1852.41 it/sec, obj=-.26]
INFO - 17:00:13: ...  38%|███▊      | 38/100 [00:00<00:00, 1855.37 it/sec, obj=0.874]
INFO - 17:00:13: ...  39%|███▉      | 39/100 [00:00<00:00, 1858.33 it/sec, obj=0.832]
INFO - 17:00:13: ...  40%|████      | 40/100 [00:00<00:00, 1861.32 it/sec, obj=-1.38]
INFO - 17:00:13: ...  41%|████      | 41/100 [00:00<00:00, 1860.38 it/sec, obj=1.52]
INFO - 17:00:13: ...  42%|████▏     | 42/100 [00:00<00:00, 1855.81 it/sec, obj=-.522]
INFO - 17:00:13: ...  43%|████▎     | 43/100 [00:00<00:00, 1849.76 it/sec, obj=1.4]
INFO - 17:00:13: ...  44%|████▍     | 44/100 [00:00<00:00, 1850.36 it/sec, obj=-.484]
INFO - 17:00:13: ...  45%|████▌     | 45/100 [00:00<00:00, 1852.44 it/sec, obj=-.91]
INFO - 17:00:13: ...  46%|████▌     | 46/100 [00:00<00:00, 1854.89 it/sec, obj=0.343]
INFO - 17:00:13: ...  47%|████▋     | 47/100 [00:00<00:00, 1857.34 it/sec, obj=-.441]
INFO - 17:00:13: ...  48%|████▊     | 48/100 [00:00<00:00, 1859.57 it/sec, obj=-.871]
INFO - 17:00:13: ...  49%|████▉     | 49/100 [00:00<00:00, 1854.71 it/sec, obj=2.67]
INFO - 17:00:13: ...  50%|█████     | 50/100 [00:00<00:00, 1851.17 it/sec, obj=0.217]
INFO - 17:00:13: ...  51%|█████     | 51/100 [00:00<00:00, 1849.47 it/sec, obj=-.425]
INFO - 17:00:13: ...  52%|█████▏    | 52/100 [00:00<00:00, 1851.82 it/sec, obj=0.113]
INFO - 17:00:13: ...  53%|█████▎    | 53/100 [00:00<00:00, 1854.11 it/sec, obj=-.377]
INFO - 17:00:13: ...  54%|█████▍    | 54/100 [00:00<00:00, 1856.22 it/sec, obj=-1.19]
INFO - 17:00:13: ...  55%|█████▌    | 55/100 [00:00<00:00, 1858.35 it/sec, obj=-.528]
INFO - 17:00:13: ...  56%|█████▌    | 56/100 [00:00<00:00, 1857.00 it/sec, obj=-2.64]
INFO - 17:00:13: ...  57%|█████▋    | 57/100 [00:00<00:00, 1853.87 it/sec, obj=-.0776]
INFO - 17:00:13: ...  58%|█████▊    | 58/100 [00:00<00:00, 1850.25 it/sec, obj=1.08]
INFO - 17:00:13: ...  59%|█████▉    | 59/100 [00:00<00:00, 1852.00 it/sec, obj=-2.05]
INFO - 17:00:13: ...  60%|██████    | 60/100 [00:00<00:00, 1854.00 it/sec, obj=0.0555]
INFO - 17:00:13: ...  61%|██████    | 61/100 [00:00<00:00, 1855.95 it/sec, obj=-1.84]
INFO - 17:00:13: ...  62%|██████▏   | 62/100 [00:00<00:00, 1857.92 it/sec, obj=0.4]
INFO - 17:00:13: ...  63%|██████▎   | 63/100 [00:00<00:00, 1859.84 it/sec, obj=-.195]
INFO - 17:00:13: ...  64%|██████▍   | 64/100 [00:00<00:00, 1855.95 it/sec, obj=-.578]
INFO - 17:00:13: ...  65%|██████▌   | 65/100 [00:00<00:00, 1853.38 it/sec, obj=-.977]
INFO - 17:00:13: ...  66%|██████▌   | 66/100 [00:00<00:00, 1852.57 it/sec, obj=-.114]
INFO - 17:00:13: ...  67%|██████▋   | 67/100 [00:00<00:00, 1854.17 it/sec, obj=0.587]
INFO - 17:00:13: ...  68%|██████▊   | 68/100 [00:00<00:00, 1855.92 it/sec, obj=-.0679]
INFO - 17:00:13: ...  69%|██████▉   | 69/100 [00:00<00:00, 1852.83 it/sec, obj=-.0218]
INFO - 17:00:13: ...  70%|███████   | 70/100 [00:00<00:00, 1854.21 it/sec, obj=-.228]
INFO - 17:00:13: ...  71%|███████   | 71/100 [00:00<00:00, 1851.67 it/sec, obj=1.21]
INFO - 17:00:13: ...  72%|███████▏  | 72/100 [00:00<00:00, 1849.52 it/sec, obj=-.34]
INFO - 17:00:13: ...  73%|███████▎  | 73/100 [00:00<00:00, 1847.99 it/sec, obj=0.513]
INFO - 17:00:13: ...  74%|███████▍  | 74/100 [00:00<00:00, 1849.44 it/sec, obj=1.67]
INFO - 17:00:13: ...  75%|███████▌  | 75/100 [00:00<00:00, 1850.94 it/sec, obj=0.557]
INFO - 17:00:13: ...  76%|███████▌  | 76/100 [00:00<00:00, 1852.53 it/sec, obj=0.431]
INFO - 17:00:13: ...  77%|███████▋  | 77/100 [00:00<00:00, 1853.97 it/sec, obj=-1.31]
INFO - 17:00:13: ...  78%|███████▊  | 78/100 [00:00<00:00, 1853.39 it/sec, obj=-.678]
INFO - 17:00:13: ...  79%|███████▉  | 79/100 [00:00<00:00, 1851.11 it/sec, obj=-1.01]
INFO - 17:00:13: ...  80%|████████  | 80/100 [00:00<00:00, 1847.71 it/sec, obj=0.246]
INFO - 17:00:13: ...  81%|████████  | 81/100 [00:00<00:00, 1848.83 it/sec, obj=1.29]
INFO - 17:00:13: ...  82%|████████▏ | 82/100 [00:00<00:00, 1850.11 it/sec, obj=0.75]
INFO - 17:00:13: ...  83%|████████▎ | 83/100 [00:00<00:00, 1851.45 it/sec, obj=-1.54]
INFO - 17:00:13: ...  84%|████████▍ | 84/100 [00:00<00:00, 1852.83 it/sec, obj=-.156]
INFO - 17:00:13: ...  85%|████████▌ | 85/100 [00:00<00:00, 1854.15 it/sec, obj=1.87]
INFO - 17:00:13: ...  86%|████████▌ | 86/100 [00:00<00:00, 1851.23 it/sec, obj=-1.08]
INFO - 17:00:13: ...  87%|████████▋ | 87/100 [00:00<00:00, 1849.35 it/sec, obj=-.647]
INFO - 17:00:13: ...  88%|████████▊ | 88/100 [00:00<00:00, 1848.55 it/sec, obj=0.968]
INFO - 17:00:13: ...  89%|████████▉ | 89/100 [00:00<00:00, 1849.84 it/sec, obj=-.773]
INFO - 17:00:13: ...  90%|█████████ | 90/100 [00:00<00:00, 1851.18 it/sec, obj=1.26]
INFO - 17:00:13: ...  91%|█████████ | 91/100 [00:00<00:00, 1852.54 it/sec, obj=0.166]
INFO - 17:00:13: ...  92%|█████████▏| 92/100 [00:00<00:00, 1853.87 it/sec, obj=0.29]
INFO - 17:00:13: ...  93%|█████████▎| 93/100 [00:00<00:00, 1852.72 it/sec, obj=0.127]
INFO - 17:00:13: ...  94%|█████████▍| 94/100 [00:00<00:00, 1850.83 it/sec, obj=-1.26]
INFO - 17:00:13: ...  95%|█████████▌| 95/100 [00:00<00:00, 1847.35 it/sec, obj=1.01]
INFO - 17:00:13: ...  96%|█████████▌| 96/100 [00:00<00:00, 1848.24 it/sec, obj=0.0819]
INFO - 17:00:13: ...  97%|█████████▋| 97/100 [00:00<00:00, 1849.46 it/sec, obj=-1.09]
INFO - 17:00:13: ...  98%|█████████▊| 98/100 [00:00<00:00, 1850.66 it/sec, obj=-.762]
INFO - 17:00:13: ...  99%|█████████▉| 99/100 [00:00<00:00, 1851.82 it/sec, obj=-.0429]
INFO - 17:00:13: ... 100%|██████████| 100/100 [00:00<00:00, 1851.78 it/sec, obj=-.813]
INFO - 17:00:13: Optimization result:
INFO - 17:00:13:    Optimizer info:
INFO - 17:00:13:       Status: None
INFO - 17:00:13:       Message: None
INFO - 17:00:13:       Number of calls to the objective function by the optimizer: 100
INFO - 17:00:13:    Solution:
INFO - 17:00:13:       Objective: -2.6379682068246657
INFO - 17:00:13:       +-----------------------------------------------------------------------------------------+
INFO - 17:00:13:       |                                     Parameter space                                     |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:       | name | lower_bound |       value        | upper_bound | type  |   Initial distribution  |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13:       | y    |     -inf    | -2.637968206824666 |     inf     | float | norm(mu=0.0, sigma=1.0) |
INFO - 17:00:13:       +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 17:00:13: *** End DOEScenario execution (time: 0:00:00.076428) ***

{'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(opt_naming=False)
print(dataset.export_to_dataframe())

      inputs   outputs
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.633 seconds)

Gallery generated by Sphinx-Gallery