gemseo / problems / scalable / parametric / core

Hide inherited members

scalable_problem module

The scalable problem.

class gemseo.problems.scalable.parametric.core.scalable_problem.ScalableProblem(discipline_settings=(ScalableDisciplineSettings(d_i=1, p_i=1), ScalableDisciplineSettings(d_i=1, p_i=1)), d_0=1, add_random_variables=False, alpha=0.5, seed=1)[source]

Bases: object

The scalable problem.

It builds a set of strongly coupled scalable disciplines completed by a system discipline computing the objective function and the constraints.

These disciplines are defined on a unit design space, i.e. design variables belongs to \([0, 1]\).

Parameters:
  • discipline_settings (Sequence[ScalableDisciplineSettings]) –

    The configurations of the different scalable disciplines.

    By default it is set to (ScalableDisciplineSettings(d_i=1, p_i=1), ScalableDisciplineSettings(d_i=1, p_i=1)).

  • d_0 (int) –

    The size of the shared design variable \(x_0\).

    By default it is set to 1.

  • add_random_variables (bool) –

    Whether to add a centered random variable \(u_i\) on the output of the \(i\)-th scalable discipline.

    By default it is set to False.

  • alpha (float) –

    The proportion of feasible design points.

    By default it is set to 0.5.

  • seed (int) –

    The seed for reproducibility.

    By default it is set to 1.

compute_y(x)[source]

Compute the coupling vector \(y\).

Parameters:

x (ndarray[Any, dtype[float]]) – A design point.

Returns:

The coupling vector associated with the design point \(x\).

Return type:

ndarray[Any, dtype[float]]

design_space: _DESIGN_SPACE_CLASS

The design space.

disciplines: list[_MAIN_DISCIPLINE_CLASS | _SCALABLE_DISCIPLINE_CLASS]

The disciplines.

property main_discipline: _MAIN_DISCIPLINE_CLASS

The main discipline.

qp_problem: QuadraticProgrammingProblem

The quadratic programming problem.

property scalable_disciplines: list[_SCALABLE_DISCIPLINE_CLASS]

The scalable disciplines.

gemseo.problems.scalable.parametric.core.scalable_problem.rand(d0, d1, ..., dn)

Random values in a given shape.

Note

This is a convenience function for users porting code from Matlab, and wraps random_sample. That function takes a tuple to specify the size of the output, which is consistent with other NumPy functions like numpy.zeros and numpy.ones.

Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).

Parameters:
  • d0 (int, optional) – The dimensions of the returned array, must be non-negative. If no argument is given a single Python float is returned.

  • d1 (int, optional) – The dimensions of the returned array, must be non-negative. If no argument is given a single Python float is returned.

  • ... (int, optional) – The dimensions of the returned array, must be non-negative. If no argument is given a single Python float is returned.

  • dn (int, optional) – The dimensions of the returned array, must be non-negative. If no argument is given a single Python float is returned.

Returns:

out – Random values.

Return type:

ndarray, shape (d0, d1, ..., dn)

See also

random

Examples

>>> np.random.rand(3,2)
array([[ 0.14022471,  0.96360618],  #random
       [ 0.37601032,  0.25528411],  #random
       [ 0.49313049,  0.94909878]]) #random

Examples using ScalableProblem

Parametric scalable MDO problem - MDF

Parametric scalable MDO problem - MDF