gemseo / problems / sellar

sellar module

Sellar MDO problem

The sellar module implements all MDODiscipline included in the Sellar problem:

\[\begin{split}\begin{aligned} \text{minimize the objective function }&obj=x_{local}^2 + x_{shared,1} +y_0+e^{-y_1} \\ \text{with respect to the design variables }&x_{shared},\,x_{local} \\ \text{subject to the general constraints } & c_1 \leq 0\\ & c_2 \leq 0\\ \text{subject to the bound constraints } & -10 \leq x_{shared,0} \leq 10\\ & 0 \leq x_{shared,1} \leq 10\\ & 0 \leq x_{local} \leq 10. \end{aligned}\end{split}\]

where the coupling variables are

\[\text{Discipline 0: } y_0 = x_{shared,0}^2 + x_{shared,1} + x_{local} - 0.2\,y_1,\]

and

\[\text{Discipline 1: }y_1 = \sqrt{y_0} + x_{shared,0} + x_{shared,1}.\]

and where the general constraints are

\[ \begin{align}\begin{aligned}c_0 = 1-y_0/{3.16}\\c_1 = y_1/{24.} - 1\end{aligned}\end{align} \]
class gemseo.problems.sellar.sellar.Sellar1(residual_form=False)[source]

Bases: gemseo.core.discipline.MDODiscipline

Sellar1 is the MDODiscipline implementing the 1st set of equations: y_0.

Constructor

Parameters

residual_form (bool) – if True only residuals are computed, no Ys

static compute_r_0(x_local, x_shared, y_0, y_1)[source]

Evaluate the first coupling equation in residual form.

Parameters
  • x_local (ndarray) – vector of design variables local to discipline 1

  • x_shared (ndarray) – vector of shared design variables

  • y_0 (ndarray) – coupling variable of discipline 1

  • y_1 (ndarray) – coupling variable of discipline 2

Returns

coupling variable y_0

Return type

float

static compute_y_0(x_local, x_shared, y_1)[source]

Solve the first coupling equation in functional form.

Parameters
  • x_local (ndarray) – vector of design variables local to discipline 1

  • x_shared (ndarray) – vector of shared design variables

  • y_1 (ndarray) – coupling variable of discipline 2

Returns

coupling variable y_0 of discipline 1

Return type

float

get_attributes_to_serialize()[source]

Defines the attributes to be serialized Can be overloaded by disciplines

Returns

the list of attributes names

Return type

list(str)

class gemseo.problems.sellar.sellar.Sellar2(residual_form=False)[source]

Bases: gemseo.core.discipline.MDODiscipline

Sellar1 is the MDODiscipline implementing the 2nd set of equations: y_1

Constructor

Parameters

residual_form (bool) – if True only residuals are computed, no Ys

static compute_r_1(x_shared, y_0, y_1)[source]

Evaluate the second coupling equation in residual form.

Parameters
  • x_shared (ndarray) – vector of shared design variables

  • y_0 (ndarray) – coupling variable of discipline 1

  • y_1 (ndarray) – coupling variable of discipline 2

Returns

coupling variable y_0

Return type

float

static compute_y1(x_shared, y_0)[source]

Solve the second coupling equation in functional form.

Parameters
  • x_shared (ndarray) – vector of shared design variables

  • y_0 (ndarray) – coupling variable of discipline 1

Returns

coupling variable y_1

Return type

float

get_attributes_to_serialize()[source]

Defines the attributes to be serialized Can be overloaded by disciplines

Returns

the list of attributes names

Return type

list(str)

class gemseo.problems.sellar.sellar.SellarSystem[source]

Bases: gemseo.core.discipline.MDODiscipline

SellarSystem is the MDODiscipline implementing the computation of the Sellar’s objective and constraints discipline.

Constructor

static c_1(y_0)[source]

First constraint on system level

Parameters

y_0 (ndarray) – coupling variable from discipline 1

Returns

Value of the constraint

Return type

float

static c_2(y_1)[source]

Second constraint on system level

Parameters

y_1 (ndarray) – coupling variable from discipline 2

Returns

Value of the constraint

Return type

float

static obj(x_local, x_shared, y_0, y_1)[source]

Objective function

Parameters
  • x_local (ndarray) – local design variables

  • x_shared (ndarray) – shared design variables

  • y_0 (ndarray) – coupling variable from discipline 1

  • y_1 (ndarray) – coupling variable from discipline 2

Returns

Objective value

Return type

float

gemseo.problems.sellar.sellar.get_inputs(names=None)[source]

Generate initial solution

Parameters

names (list(str)) – input names (default: None)

Returns

input values

Return type

dict