Note
Go to the end to download the full example code
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()
):
parameter_space.add_variable("x", l_b=-2.0, u_b=2.0)
or uncertain variables from their distribution names and parameters
(use ParameterSpace.add_random_variable()
):
parameter_space.add_random_variable("y", "SPNormalDistribution", mu=0.0, sigma=1.0)
parameter_space
Warning
We cannot mix probability distributions from different families,
e.g. an OTDistribution
and a SPDistribution
.
We can check that the variables x and y are implemented as deterministic and uncertain variables respectively:
parameter_space.is_deterministic("x"), parameter_space.is_uncertain("y")
(True, True)
Note that when GEMSEO does not offer a class for the SciPy distribution,
we can use the generic GEMSEO class SPDistribution
to create any SciPy distribution
by setting interfaced_distribution
to its SciPy name
and parameters
as a dictionary of SciPy parameter names and values
(see the documentation of SciPy).
# parameter_space.add_random_variable(
# "y",
# "SPDistribution",
# interfaced_distribution="norm",
# parameters={"loc": 1.0, "scale": 2.0},
# )
A similar procedure can be followed
for OpenTURNS distributions for which
GEMSEO does not offer a class directly.
We can use the generic GEMSEO class OTDistribution
to create any OpenTURNS distribution
by setting interfaced_distribution
to its OpenTURNS name
and parameters
as a tuple of OpenTURNS parameter values
(see the documentation of OpenTURNS).
# parameter_space.add_random_variable(
# "y",
# "OTDistribution",
# interfaced_distribution="Normal",
# parameters=(1.0, 2.0),
# )
Sample from the parameter space¶
We can sample the uncertain variables from the ParameterSpace
and get values either as a NumPy array (by default)
sample = parameter_space.compute_samples(n_samples=2, as_dict=True)
sample
[{'y': array([-2.60787598])}, {'y': array([1.14744016])}]
or as a dictionary of NumPy arrays indexed by the names of the variables:
sample = parameter_space.compute_samples(n_samples=4)
sample
array([[ 1.41359989],
[ 0.20286313],
[-0.1256262 ],
[-0.57901273]])
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:58:07:
INFO - 08:58:07: *** Start DOEScenario execution ***
INFO - 08:58:07: DOEScenario
INFO - 08:58:07: Disciplines: AnalyticDiscipline
INFO - 08:58:07: MDO formulation: DisciplinaryOpt
INFO - 08:58:07: Optimization problem:
INFO - 08:58:07: minimize z(x, y)
INFO - 08:58:07: with respect to x, y
INFO - 08:58:07: over the design space:
INFO - 08:58:07: +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:58:07: | Name | Lower bound | Value | Upper bound | Type | Distribution |
INFO - 08:58:07: +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:58:07: | x | -2 | None | 2 | float | |
INFO - 08:58:07: | y | -inf | 0 | inf | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:58:07: +------+-------------+-------+-------------+-------+-------------------------+
INFO - 08:58:07: Solving optimization problem with algorithm lhs:
INFO - 08:58:07: 1%| | 1/100 [00:00<00:00, 342.53 it/sec, obj=3.12]
INFO - 08:58:07: 2%|▏ | 2/100 [00:00<00:00, 539.50 it/sec, obj=1.72]
INFO - 08:58:07: 3%|▎ | 3/100 [00:00<00:00, 688.68 it/sec, obj=0.181]
INFO - 08:58:07: 4%|▍ | 4/100 [00:00<00:00, 806.13 it/sec, obj=3.76]
INFO - 08:58:07: 5%|▌ | 5/100 [00:00<00:00, 890.85 it/sec, obj=2.15]
INFO - 08:58:07: 6%|▌ | 6/100 [00:00<00:00, 965.50 it/sec, obj=-0.666]
INFO - 08:58:07: 7%|▋ | 7/100 [00:00<00:00, 1028.09 it/sec, obj=1.53]
INFO - 08:58:07: 8%|▊ | 8/100 [00:00<00:00, 1081.22 it/sec, obj=1.7]
INFO - 08:58:07: 9%|▉ | 9/100 [00:00<00:00, 1123.21 it/sec, obj=-2.27]
INFO - 08:58:07: 10%|█ | 10/100 [00:00<00:00, 1161.34 it/sec, obj=-2.08]
INFO - 08:58:07: 11%|█ | 11/100 [00:00<00:00, 1191.16 it/sec, obj=-2.8]
INFO - 08:58:07: 12%|█▏ | 12/100 [00:00<00:00, 1219.78 it/sec, obj=-1.31]
INFO - 08:58:07: 13%|█▎ | 13/100 [00:00<00:00, 1245.60 it/sec, obj=1.1]
INFO - 08:58:07: 14%|█▍ | 14/100 [00:00<00:00, 1268.89 it/sec, obj=0.38]
INFO - 08:58:07: 15%|█▌ | 15/100 [00:00<00:00, 1289.79 it/sec, obj=1.68]
INFO - 08:58:07: 16%|█▌ | 16/100 [00:00<00:00, 1306.94 it/sec, obj=0.672]
INFO - 08:58:07: 17%|█▋ | 17/100 [00:00<00:00, 1324.06 it/sec, obj=0.643]
INFO - 08:58:07: 18%|█▊ | 18/100 [00:00<00:00, 1336.90 it/sec, obj=0.568]
INFO - 08:58:07: 19%|█▉ | 19/100 [00:00<00:00, 1351.28 it/sec, obj=-0.277]
INFO - 08:58:07: 20%|██ | 20/100 [00:00<00:00, 1364.89 it/sec, obj=1.51]
INFO - 08:58:07: 21%|██ | 21/100 [00:00<00:00, 1377.31 it/sec, obj=1.83]
INFO - 08:58:07: 22%|██▏ | 22/100 [00:00<00:00, 1387.07 it/sec, obj=2.12]
INFO - 08:58:07: 23%|██▎ | 23/100 [00:00<00:00, 1397.53 it/sec, obj=0.526]
INFO - 08:58:07: 24%|██▍ | 24/100 [00:00<00:00, 1407.35 it/sec, obj=1.47]
INFO - 08:58:07: 25%|██▌ | 25/100 [00:00<00:00, 1413.58 it/sec, obj=-1.49]
INFO - 08:58:07: 26%|██▌ | 26/100 [00:00<00:00, 1422.28 it/sec, obj=-1.58]
INFO - 08:58:07: 27%|██▋ | 27/100 [00:00<00:00, 1430.51 it/sec, obj=1.59]
INFO - 08:58:07: 28%|██▊ | 28/100 [00:00<00:00, 1438.18 it/sec, obj=0.329]
INFO - 08:58:07: 29%|██▉ | 29/100 [00:00<00:00, 1441.85 it/sec, obj=-1.46]
INFO - 08:58:07: 30%|███ | 30/100 [00:00<00:00, 1448.16 it/sec, obj=-0.045]
INFO - 08:58:07: 31%|███ | 31/100 [00:00<00:00, 1452.47 it/sec, obj=-0.736]
INFO - 08:58:07: 32%|███▏ | 32/100 [00:00<00:00, 1458.40 it/sec, obj=0.867]
INFO - 08:58:07: 33%|███▎ | 33/100 [00:00<00:00, 1464.14 it/sec, obj=-3.12]
INFO - 08:58:07: 34%|███▍ | 34/100 [00:00<00:00, 1469.71 it/sec, obj=-0.252]
INFO - 08:58:07: 35%|███▌ | 35/100 [00:00<00:00, 1475.19 it/sec, obj=1.46]
INFO - 08:58:07: 36%|███▌ | 36/100 [00:00<00:00, 1478.92 it/sec, obj=-2.02]
INFO - 08:58:07: 37%|███▋ | 37/100 [00:00<00:00, 1483.84 it/sec, obj=-1.68]
INFO - 08:58:07: 38%|███▊ | 38/100 [00:00<00:00, 1486.79 it/sec, obj=-0.913]
INFO - 08:58:07: 39%|███▉ | 39/100 [00:00<00:00, 1490.91 it/sec, obj=-2.38]
INFO - 08:58:07: 40%|████ | 40/100 [00:00<00:00, 1494.99 it/sec, obj=1.07]
INFO - 08:58:07: 41%|████ | 41/100 [00:00<00:00, 1498.96 it/sec, obj=3.77]
INFO - 08:58:07: 42%|████▏ | 42/100 [00:00<00:00, 1501.92 it/sec, obj=-1.88]
INFO - 08:58:07: 43%|████▎ | 43/100 [00:00<00:00, 1505.58 it/sec, obj=0.116]
INFO - 08:58:07: 44%|████▍ | 44/100 [00:00<00:00, 1508.03 it/sec, obj=-1.51]
INFO - 08:58:07: 45%|████▌ | 45/100 [00:00<00:00, 1511.26 it/sec, obj=-0.0194]
INFO - 08:58:07: 46%|████▌ | 46/100 [00:00<00:00, 1514.81 it/sec, obj=0.984]
INFO - 08:58:07: 47%|████▋ | 47/100 [00:00<00:00, 1518.06 it/sec, obj=-0.34]
INFO - 08:58:07: 48%|████▊ | 48/100 [00:00<00:00, 1512.41 it/sec, obj=-0.941]
INFO - 08:58:07: 49%|████▉ | 49/100 [00:00<00:00, 1513.94 it/sec, obj=0.363]
INFO - 08:58:07: 50%|█████ | 50/100 [00:00<00:00, 1516.88 it/sec, obj=-1.01]
INFO - 08:58:07: 51%|█████ | 51/100 [00:00<00:00, 1518.41 it/sec, obj=-0.359]
INFO - 08:58:07: 52%|█████▏ | 52/100 [00:00<00:00, 1521.08 it/sec, obj=-3.06]
INFO - 08:58:07: 53%|█████▎ | 53/100 [00:00<00:00, 1523.85 it/sec, obj=2.34]
INFO - 08:58:07: 54%|█████▍ | 54/100 [00:00<00:00, 1526.61 it/sec, obj=-0.262]
INFO - 08:58:07: 55%|█████▌ | 55/100 [00:00<00:00, 1528.30 it/sec, obj=0.812]
INFO - 08:58:07: 56%|█████▌ | 56/100 [00:00<00:00, 1530.64 it/sec, obj=-2.47]
INFO - 08:58:07: 57%|█████▋ | 57/100 [00:00<00:00, 1531.77 it/sec, obj=1.49]
INFO - 08:58:07: 58%|█████▊ | 58/100 [00:00<00:00, 1534.01 it/sec, obj=0.268]
INFO - 08:58:07: 59%|█████▉ | 59/100 [00:00<00:00, 1536.26 it/sec, obj=0.559]
INFO - 08:58:07: 60%|██████ | 60/100 [00:00<00:00, 1538.56 it/sec, obj=-2.01]
INFO - 08:58:07: 61%|██████ | 61/100 [00:00<00:00, 1540.61 it/sec, obj=-0.854]
INFO - 08:58:07: 62%|██████▏ | 62/100 [00:00<00:00, 1541.76 it/sec, obj=1.61]
INFO - 08:58:07: 63%|██████▎ | 63/100 [00:00<00:00, 1543.57 it/sec, obj=-2.64]
INFO - 08:58:07: 64%|██████▍ | 64/100 [00:00<00:00, 1543.91 it/sec, obj=0.818]
INFO - 08:58:07: 65%|██████▌ | 65/100 [00:00<00:00, 1545.65 it/sec, obj=1.04]
INFO - 08:58:07: 66%|██████▌ | 66/100 [00:00<00:00, 1547.67 it/sec, obj=-0.832]
INFO - 08:58:07: 67%|██████▋ | 67/100 [00:00<00:00, 1549.63 it/sec, obj=0.692]
INFO - 08:58:07: 68%|██████▊ | 68/100 [00:00<00:00, 1550.93 it/sec, obj=-3.33]
INFO - 08:58:07: 69%|██████▉ | 69/100 [00:00<00:00, 1552.43 it/sec, obj=0.47]
INFO - 08:58:07: 70%|███████ | 70/100 [00:00<00:00, 1554.00 it/sec, obj=0.445]
INFO - 08:58:07: 71%|███████ | 71/100 [00:00<00:00, 1554.44 it/sec, obj=0.402]
INFO - 08:58:07: 72%|███████▏ | 72/100 [00:00<00:00, 1555.92 it/sec, obj=2.77]
INFO - 08:58:07: 73%|███████▎ | 73/100 [00:00<00:00, 1557.46 it/sec, obj=-0.256]
INFO - 08:58:07: 74%|███████▍ | 74/100 [00:00<00:00, 1558.98 it/sec, obj=3.36]
INFO - 08:58:07: 75%|███████▌ | 75/100 [00:00<00:00, 1559.83 it/sec, obj=-0.229]
INFO - 08:58:07: 76%|███████▌ | 76/100 [00:00<00:00, 1561.12 it/sec, obj=-0.739]
INFO - 08:58:07: 77%|███████▋ | 77/100 [00:00<00:00, 1561.45 it/sec, obj=0.808]
INFO - 08:58:07: 78%|███████▊ | 78/100 [00:00<00:00, 1562.67 it/sec, obj=-0.377]
INFO - 08:58:07: 79%|███████▉ | 79/100 [00:00<00:00, 1564.12 it/sec, obj=0.708]
INFO - 08:58:07: 80%|████████ | 80/100 [00:00<00:00, 1565.47 it/sec, obj=-0.874]
INFO - 08:58:07: 81%|████████ | 81/100 [00:00<00:00, 1566.81 it/sec, obj=-1.29]
INFO - 08:58:07: 82%|████████▏ | 82/100 [00:00<00:00, 1567.31 it/sec, obj=0.505]
INFO - 08:58:07: 83%|████████▎ | 83/100 [00:00<00:00, 1568.54 it/sec, obj=1.99]
INFO - 08:58:07: 84%|████████▍ | 84/100 [00:00<00:00, 1568.73 it/sec, obj=0.574]
INFO - 08:58:07: 85%|████████▌ | 85/100 [00:00<00:00, 1569.70 it/sec, obj=-2.06]
INFO - 08:58:07: 86%|████████▌ | 86/100 [00:00<00:00, 1570.80 it/sec, obj=-1.49]
INFO - 08:58:07: 87%|████████▋ | 87/100 [00:00<00:00, 1571.96 it/sec, obj=0.61]
INFO - 08:58:07: 88%|████████▊ | 88/100 [00:00<00:00, 1572.49 it/sec, obj=0.542]
INFO - 08:58:07: 89%|████████▉ | 89/100 [00:00<00:00, 1573.49 it/sec, obj=-1.5]
INFO - 08:58:07: 90%|█████████ | 90/100 [00:00<00:00, 1573.84 it/sec, obj=0.201]
INFO - 08:58:07: 91%|█████████ | 91/100 [00:00<00:00, 1574.80 it/sec, obj=0.949]
INFO - 08:58:07: 92%|█████████▏| 92/100 [00:00<00:00, 1576.02 it/sec, obj=-1.86]
INFO - 08:58:07: 93%|█████████▎| 93/100 [00:00<00:00, 1577.09 it/sec, obj=-0.0722]
INFO - 08:58:07: 94%|█████████▍| 94/100 [00:00<00:00, 1578.09 it/sec, obj=-0.407]
INFO - 08:58:07: 95%|█████████▌| 95/100 [00:00<00:00, 1578.67 it/sec, obj=0.194]
INFO - 08:58:07: 96%|█████████▌| 96/100 [00:00<00:00, 1579.63 it/sec, obj=-0.207]
INFO - 08:58:07: 97%|█████████▋| 97/100 [00:00<00:00, 1579.78 it/sec, obj=0.462]
INFO - 08:58:07: 98%|█████████▊| 98/100 [00:00<00:00, 1580.67 it/sec, obj=-2.37]
INFO - 08:58:07: 99%|█████████▉| 99/100 [00:00<00:00, 1581.70 it/sec, obj=1.32]
INFO - 08:58:07: 100%|██████████| 100/100 [00:00<00:00, 1582.62 it/sec, obj=-2.21]
INFO - 08:58:07: Optimization result:
INFO - 08:58:07: Optimizer info:
INFO - 08:58:07: Status: None
INFO - 08:58:07: Message: None
INFO - 08:58:07: Number of calls to the objective function by the optimizer: 100
INFO - 08:58:07: Solution:
INFO - 08:58:07: Objective: -3.3284373246961634
INFO - 08:58:07: Design space:
INFO - 08:58:07: +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:58:07: | Name | Lower bound | Value | Upper bound | Type | Distribution |
INFO - 08:58:07: +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:58:07: | x | -2 | -1.959995425007306 | 2 | float | |
INFO - 08:58:07: | y | -inf | -1.368441899688857 | inf | float | norm(mu=0.0, sigma=1.0) |
INFO - 08:58:07: +------+-------------+--------------------+-------------+-------+-------------------------+
INFO - 08:58:07: *** End DOEScenario execution (time: 0:00:00.090346) ***
{'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
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:58:08:
INFO - 08:58:08: *** Start DOEScenario execution ***
INFO - 08:58:08: DOEScenario
INFO - 08:58:08: Disciplines: AnalyticDiscipline
INFO - 08:58:08: MDO formulation: DisciplinaryOpt
INFO - 08:58:08: Optimization problem:
INFO - 08:58:08: minimize z(y)
INFO - 08:58:08: with respect to y
INFO - 08:58:08: over the design space:
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: | Name | Distribution |
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: | y | norm(mu=0.0, sigma=1.0) |
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: Solving optimization problem with algorithm lhs:
INFO - 08:58:08: 1%| | 1/100 [00:00<00:00, 942.12 it/sec, obj=-0.641]
INFO - 08:58:08: 2%|▏ | 2/100 [00:00<00:00, 1098.70 it/sec, obj=-0.394]
INFO - 08:58:08: 3%|▎ | 3/100 [00:00<00:00, 1227.96 it/sec, obj=0.551]
INFO - 08:58:08: 4%|▍ | 4/100 [00:00<00:00, 1311.13 it/sec, obj=0.944]
INFO - 08:58:08: 5%|▌ | 5/100 [00:00<00:00, 1360.11 it/sec, obj=-2.12]
INFO - 08:58:08: 6%|▌ | 6/100 [00:00<00:00, 1402.62 it/sec, obj=-1.64]
INFO - 08:58:08: 7%|▋ | 7/100 [00:00<00:00, 1421.66 it/sec, obj=0.656]
INFO - 08:58:08: 8%|▊ | 8/100 [00:00<00:00, 1446.94 it/sec, obj=-0.612]
INFO - 08:58:08: 9%|▉ | 9/100 [00:00<00:00, 1468.94 it/sec, obj=0.736]
INFO - 08:58:08: 10%|█ | 10/100 [00:00<00:00, 1451.27 it/sec, obj=0.36]
INFO - 08:58:08: 11%|█ | 11/100 [00:00<00:00, 1437.52 it/sec, obj=-0.31]
INFO - 08:58:08: 12%|█▏ | 12/100 [00:00<00:00, 1451.86 it/sec, obj=0.324]
INFO - 08:58:08: 13%|█▎ | 13/100 [00:00<00:00, 1461.31 it/sec, obj=-1.73]
INFO - 08:58:08: 14%|█▍ | 14/100 [00:00<00:00, 1474.16 it/sec, obj=0.494]
INFO - 08:58:08: 15%|█▌ | 15/100 [00:00<00:00, 1485.62 it/sec, obj=-0.148]
INFO - 08:58:08: 16%|█▌ | 16/100 [00:00<00:00, 1495.50 it/sec, obj=1.1]
INFO - 08:58:08: 17%|█▋ | 17/100 [00:00<00:00, 1502.10 it/sec, obj=-0.716]
INFO - 08:58:08: 18%|█▊ | 18/100 [00:00<00:00, 1509.56 it/sec, obj=0.0421]
INFO - 08:58:08: 19%|█▉ | 19/100 [00:00<00:00, 1513.67 it/sec, obj=0.256]
INFO - 08:58:08: 20%|██ | 20/100 [00:00<00:00, 1520.20 it/sec, obj=-1.45]
INFO - 08:58:08: 21%|██ | 21/100 [00:00<00:00, 1526.63 it/sec, obj=0.637]
INFO - 08:58:08: 22%|██▏ | 22/100 [00:00<00:00, 1532.62 it/sec, obj=1.97]
INFO - 08:58:08: 23%|██▎ | 23/100 [00:00<00:00, 1514.93 it/sec, obj=-0.208]
INFO - 08:58:08: 24%|██▍ | 24/100 [00:00<00:00, 1509.49 it/sec, obj=0.18]
INFO - 08:58:08: 25%|██▌ | 25/100 [00:00<00:00, 1511.98 it/sec, obj=0.000485]
INFO - 08:58:08: 26%|██▌ | 26/100 [00:00<00:00, 1516.72 it/sec, obj=1.17]
INFO - 08:58:08: 27%|██▋ | 27/100 [00:00<00:00, 1521.55 it/sec, obj=-0.305]
INFO - 08:58:08: 28%|██▊ | 28/100 [00:00<00:00, 1526.17 it/sec, obj=0.68]
INFO - 08:58:08: 29%|██▉ | 29/100 [00:00<00:00, 1530.42 it/sec, obj=-0.932]
INFO - 08:58:08: 30%|███ | 30/100 [00:00<00:00, 1533.04 it/sec, obj=0.901]
INFO - 08:58:08: 31%|███ | 31/100 [00:00<00:00, 1536.74 it/sec, obj=0.454]
INFO - 08:58:08: 32%|███▏ | 32/100 [00:00<00:00, 1538.28 it/sec, obj=-1.16]
INFO - 08:58:08: 33%|███▎ | 33/100 [00:00<00:00, 1541.65 it/sec, obj=1.44]
INFO - 08:58:08: 34%|███▍ | 34/100 [00:00<00:00, 1544.83 it/sec, obj=0.798]
INFO - 08:58:08: 35%|███▌ | 35/100 [00:00<00:00, 1547.97 it/sec, obj=1.59]
INFO - 08:58:08: 36%|███▌ | 36/100 [00:00<00:00, 1549.97 it/sec, obj=2.05]
INFO - 08:58:08: 37%|███▋ | 37/100 [00:00<00:00, 1552.82 it/sec, obj=-0.26]
INFO - 08:58:08: 38%|███▊ | 38/100 [00:00<00:00, 1552.11 it/sec, obj=0.874]
INFO - 08:58:08: 39%|███▉ | 39/100 [00:00<00:00, 1553.45 it/sec, obj=0.832]
INFO - 08:58:08: 40%|████ | 40/100 [00:00<00:00, 1555.85 it/sec, obj=-1.38]
INFO - 08:58:08: 41%|████ | 41/100 [00:00<00:00, 1558.18 it/sec, obj=1.52]
INFO - 08:58:08: 42%|████▏ | 42/100 [00:00<00:00, 1560.51 it/sec, obj=-0.522]
INFO - 08:58:08: 43%|████▎ | 43/100 [00:00<00:00, 1561.16 it/sec, obj=1.4]
INFO - 08:58:08: 44%|████▍ | 44/100 [00:00<00:00, 1563.08 it/sec, obj=-0.484]
INFO - 08:58:08: 45%|████▌ | 45/100 [00:00<00:00, 1563.37 it/sec, obj=-0.91]
INFO - 08:58:08: 46%|████▌ | 46/100 [00:00<00:00, 1565.20 it/sec, obj=0.343]
INFO - 08:58:08: 47%|████▋ | 47/100 [00:00<00:00, 1567.08 it/sec, obj=-0.441]
INFO - 08:58:08: 48%|████▊ | 48/100 [00:00<00:00, 1569.20 it/sec, obj=-0.871]
INFO - 08:58:08: 49%|████▉ | 49/100 [00:00<00:00, 1570.07 it/sec, obj=2.67]
INFO - 08:58:08: 50%|█████ | 50/100 [00:00<00:00, 1571.55 it/sec, obj=0.217]
INFO - 08:58:08: 51%|█████ | 51/100 [00:00<00:00, 1573.20 it/sec, obj=-0.425]
INFO - 08:58:08: 52%|█████▏ | 52/100 [00:00<00:00, 1572.86 it/sec, obj=0.113]
INFO - 08:58:08: 53%|█████▎ | 53/100 [00:00<00:00, 1574.44 it/sec, obj=-0.377]
INFO - 08:58:08: 54%|█████▍ | 54/100 [00:00<00:00, 1576.17 it/sec, obj=-1.19]
INFO - 08:58:08: 55%|█████▌ | 55/100 [00:00<00:00, 1577.86 it/sec, obj=-0.528]
INFO - 08:58:08: 56%|█████▌ | 56/100 [00:00<00:00, 1578.61 it/sec, obj=-2.64]
INFO - 08:58:08: 57%|█████▋ | 57/100 [00:00<00:00, 1580.10 it/sec, obj=-0.0776]
INFO - 08:58:08: 58%|█████▊ | 58/100 [00:00<00:00, 1580.22 it/sec, obj=1.08]
INFO - 08:58:08: 59%|█████▉ | 59/100 [00:00<00:00, 1581.42 it/sec, obj=-2.05]
INFO - 08:58:08: 60%|██████ | 60/100 [00:00<00:00, 1582.75 it/sec, obj=0.0555]
INFO - 08:58:08: 61%|██████ | 61/100 [00:00<00:00, 1577.03 it/sec, obj=-1.84]
INFO - 08:58:08: 62%|██████▏ | 62/100 [00:00<00:00, 1577.18 it/sec, obj=0.4]
INFO - 08:58:08: 63%|██████▎ | 63/100 [00:00<00:00, 1578.19 it/sec, obj=-0.195]
INFO - 08:58:08: 64%|██████▍ | 64/100 [00:00<00:00, 1578.16 it/sec, obj=-0.578]
INFO - 08:58:08: 65%|██████▌ | 65/100 [00:00<00:00, 1579.14 it/sec, obj=-0.977]
INFO - 08:58:08: 66%|██████▌ | 66/100 [00:00<00:00, 1580.15 it/sec, obj=-0.114]
INFO - 08:58:08: 67%|██████▋ | 67/100 [00:00<00:00, 1581.26 it/sec, obj=0.587]
INFO - 08:58:08: 68%|██████▊ | 68/100 [00:00<00:00, 1582.38 it/sec, obj=-0.0679]
INFO - 08:58:08: 69%|██████▉ | 69/100 [00:00<00:00, 1582.67 it/sec, obj=-0.0218]
INFO - 08:58:08: 70%|███████ | 70/100 [00:00<00:00, 1583.60 it/sec, obj=-0.228]
INFO - 08:58:08: 71%|███████ | 71/100 [00:00<00:00, 1583.36 it/sec, obj=1.21]
INFO - 08:58:08: 72%|███████▏ | 72/100 [00:00<00:00, 1584.20 it/sec, obj=-0.34]
INFO - 08:58:08: 73%|███████▎ | 73/100 [00:00<00:00, 1585.11 it/sec, obj=0.513]
INFO - 08:58:08: 74%|███████▍ | 74/100 [00:00<00:00, 1586.18 it/sec, obj=1.67]
INFO - 08:58:08: 75%|███████▌ | 75/100 [00:00<00:00, 1586.59 it/sec, obj=0.557]
INFO - 08:58:08: 76%|███████▌ | 76/100 [00:00<00:00, 1587.45 it/sec, obj=0.431]
INFO - 08:58:08: 77%|███████▋ | 77/100 [00:00<00:00, 1587.60 it/sec, obj=-1.31]
INFO - 08:58:08: 78%|███████▊ | 78/100 [00:00<00:00, 1588.31 it/sec, obj=-0.678]
INFO - 08:58:08: 79%|███████▉ | 79/100 [00:00<00:00, 1589.18 it/sec, obj=-1.01]
INFO - 08:58:08: 80%|████████ | 80/100 [00:00<00:00, 1590.11 it/sec, obj=0.246]
INFO - 08:58:08: 81%|████████ | 81/100 [00:00<00:00, 1590.92 it/sec, obj=1.29]
INFO - 08:58:08: 82%|████████▏ | 82/100 [00:00<00:00, 1591.05 it/sec, obj=0.75]
INFO - 08:58:08: 83%|████████▎ | 83/100 [00:00<00:00, 1591.74 it/sec, obj=-1.54]
INFO - 08:58:08: 84%|████████▍ | 84/100 [00:00<00:00, 1591.64 it/sec, obj=-0.156]
INFO - 08:58:08: 85%|████████▌ | 85/100 [00:00<00:00, 1592.26 it/sec, obj=1.87]
INFO - 08:58:08: 86%|████████▌ | 86/100 [00:00<00:00, 1592.96 it/sec, obj=-1.08]
INFO - 08:58:08: 87%|████████▋ | 87/100 [00:00<00:00, 1593.79 it/sec, obj=-0.647]
INFO - 08:58:08: 88%|████████▊ | 88/100 [00:00<00:00, 1594.09 it/sec, obj=0.968]
INFO - 08:58:08: 89%|████████▉ | 89/100 [00:00<00:00, 1594.76 it/sec, obj=-0.773]
INFO - 08:58:08: 90%|█████████ | 90/100 [00:00<00:00, 1595.45 it/sec, obj=1.26]
INFO - 08:58:08: 91%|█████████ | 91/100 [00:00<00:00, 1593.67 it/sec, obj=0.166]
INFO - 08:58:08: 92%|█████████▏| 92/100 [00:00<00:00, 1594.30 it/sec, obj=0.29]
INFO - 08:58:08: 93%|█████████▎| 93/100 [00:00<00:00, 1594.94 it/sec, obj=0.127]
INFO - 08:58:08: 94%|█████████▍| 94/100 [00:00<00:00, 1595.57 it/sec, obj=-1.26]
INFO - 08:58:08: 95%|█████████▌| 95/100 [00:00<00:00, 1595.76 it/sec, obj=1.01]
INFO - 08:58:08: 96%|█████████▌| 96/100 [00:00<00:00, 1596.40 it/sec, obj=0.0819]
INFO - 08:58:08: 97%|█████████▋| 97/100 [00:00<00:00, 1595.96 it/sec, obj=-1.09]
INFO - 08:58:08: 98%|█████████▊| 98/100 [00:00<00:00, 1596.42 it/sec, obj=-0.762]
INFO - 08:58:08: 99%|█████████▉| 99/100 [00:00<00:00, 1597.04 it/sec, obj=-0.0429]
INFO - 08:58:08: 100%|██████████| 100/100 [00:00<00:00, 1597.79 it/sec, obj=-0.813]
INFO - 08:58:08: Optimization result:
INFO - 08:58:08: Optimizer info:
INFO - 08:58:08: Status: None
INFO - 08:58:08: Message: None
INFO - 08:58:08: Number of calls to the objective function by the optimizer: 100
INFO - 08:58:08: Solution:
INFO - 08:58:08: Objective: -2.6379682068246657
INFO - 08:58:08: Design space:
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: | Name | Distribution |
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: | y | norm(mu=0.0, sigma=1.0) |
INFO - 08:58:08: +------+-------------------------+
INFO - 08:58:08: *** End DOEScenario execution (time: 0:00:00.087752) ***
{'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
Total running time of the script: (0 minutes 0.720 seconds)