gemseo / problems / sellar

Show inherited members

sellar module

The disciplines for the MDO problem proposed by Sellar et al. in.

Sellar, R., Batill, S., & Renaud, J. (1996). Response surface based, concurrent subspace optimization for multidisciplinary system design. In 34th aerospace sciences meeting and exhibit (p. 714).

The MDO problem is written as follows:

\[\begin{split}\begin{aligned} \text{minimize the objective function }&obj=x_{local}^2 + x_{shared,2} +y_1^2+e^{-y_2} \\ \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,1} \leq 10\\ & 0 \leq x_{shared,2} \leq 10\\ & 0 \leq x_{local} \leq 10. \end{aligned}\end{split}\]

where the coupling variables are

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

and

\[\text{Discipline 2: }y_2 = |y_1| + x_{shared,1} + x_{shared,2}.\]

and where the general constraints are

\[ \begin{align}\begin{aligned}c_1 = 3.16 - y_1^2\\c_2 = y_2 - 24\end{aligned}\end{align} \]

This module implements three disciplines to compute the different coupling variables, constraints and objective:

  • Sellar1: this MDODiscipline computes \(y_1\) from \(y_2\), \(x_{shared,1}\), \(x_{shared,2}\) and \(x_{local}\).

  • Sellar2: this MDODiscipline computes \(y_2\) from \(y_1\), \(x_{shared,1}\) and \(x_{shared,2}\).

  • SellarSystem: this MDODiscipline computes both objective and constraints from \(y_1\), \(y_2\), \(x_{local}\) and \(x_{shared,2}\).

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

Bases: MDODiscipline

The discipline to compute the coupling variable \(y_1\).

static compute_y_1(x_local, x_shared, y_2)[source]

Evaluate the first coupling equation in functional form.

Parameters:
  • x_local (complex) – The design variables local to first discipline.

  • x_shared (ndarray) – The shared design variables.

  • y_2 (complex) – The coupling variable coming from the second discipline.

Returns:

The value of the coupling variable \(y_1\).

Return type:

complex

cache: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.

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

Bases: MDODiscipline

The discipline to compute the coupling variable \(y_2\).

static compute_y_2(x_shared, y_1)[source]

Evaluate the second coupling equation in functional form.

Parameters:
  • x_shared (ndarray) – The shared design variables.

  • y_1 (complex) – The coupling variable coming from the first discipline.

Returns:

The value of the coupling variable \(y_2\).

Return type:

complex

cache: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.

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

Bases: MDODiscipline

The discipline to compute the objective and constraints of the Sellar problem.

static compute_c_1(y_1)[source]

Evaluate the constraint \(c_1\).

Parameters:

y_1 (complex) – The coupling variable coming from the first discipline.

Returns:

The value of the constraint \(c_1\).

Return type:

complex

static compute_c_2(y_2)[source]

Evaluate the constraint \(c_2\).

Parameters:

y_2 (complex) – The coupling variable coming from the second discipline.

Returns:

The value of the constraint \(c_2\).

Return type:

complex

static compute_obj(x_local, x_shared, y_1, y_2)[source]

Evaluate the objective \(obj\).

Parameters:
  • x_local (complex) – The design variables local to the first discipline.

  • x_shared (ndarray) – The shared design variables.

  • y_1 (complex) – The coupling variable coming from the first discipline.

  • y_2 (complex) – The coupling variable coming from the second discipline.

Returns:

The value of the objective \(obj\).

Return type:

complex

cache: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.

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

Generate an initial solution for the MDO problem.

Parameters:

names (Iterable[str] | None) – The names of the discipline inputs.

Returns:

The default values of the discipline inputs.

Return type:

dict[str, ndarray | complex]

gemseo.problems.sellar.sellar.get_y_opt(mda)[source]

Return the optimal y array.

Parameters:

mda (MDA) – The mda.

Returns:

The optimal y array.

Return type:

ndarray