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:
where the coupling variables are
and
and where the general constraints are
This module implements three disciplines to compute the different coupling variables, constraints and objective:
Sellar1
: thisMDODiscipline
computes \(y_1\) from \(y_2\), \(x_{shared,1}\), \(x_{shared,2}\) and \(x_{local}\).Sellar2
: thisMDODiscipline
computes \(y_2\) from \(y_1\), \(x_{shared,1}\) and \(x_{shared,2}\).SellarSystem
: thisMDODiscipline
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\).
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
name – The name of the discipline. If
None
, use the class name.input_grammar_file – The input grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_input.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the input grammar from a schema file.output_grammar_file – The output grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_output.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the output grammar from a schema file.auto_detect_grammar_files – Whether to look for
"ClassName_{input,output}.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module when{input,output}_grammar_file
isNone
.grammar_type – The type of the input and output grammars.
cache_type – The type of cache.
cache_file_path – The HDF file path when
grammar_type
isMDODiscipline.CacheType.HDF5
.
- static compute_y_1(x_local, x_shared, y_2)[source]
Evaluate the first coupling equation in functional form.
- 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: dict[str, dict[str, ndarray]]
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: Mapping[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\).
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
name – The name of the discipline. If
None
, use the class name.input_grammar_file – The input grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_input.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the input grammar from a schema file.output_grammar_file – The output grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_output.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the output grammar from a schema file.auto_detect_grammar_files – Whether to look for
"ClassName_{input,output}.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module when{input,output}_grammar_file
isNone
.grammar_type – The type of the input and output grammars.
cache_type – The type of cache.
cache_file_path – The HDF file path when
grammar_type
isMDODiscipline.CacheType.HDF5
.
- static compute_y_2(x_shared, y_1)[source]
Evaluate the second coupling equation in functional form.
- 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: dict[str, dict[str, ndarray]]
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: Mapping[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.
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
name – The name of the discipline. If
None
, use the class name.input_grammar_file – The input grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_input.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the input grammar from a schema file.output_grammar_file – The output grammar file path. If
None
andauto_detect_grammar_files=True
, look for"ClassName_output.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module. IfNone
andauto_detect_grammar_files=False
, do not initialize the output grammar from a schema file.auto_detect_grammar_files – Whether to look for
"ClassName_{input,output}.json"
in theGRAMMAR_DIRECTORY
if any or in the directory of the discipline class module when{input,output}_grammar_file
isNone
.grammar_type – The type of the input and output grammars.
cache_type – The type of cache.
cache_file_path – The HDF file path when
grammar_type
isMDODiscipline.CacheType.HDF5
.
- static compute_c_1(y_1)[source]
Evaluate the constraint \(c_1\).
- static compute_c_2(y_2)[source]
Evaluate the constraint \(c_2\).
- static compute_obj(x_local, x_shared, y_1, y_2)[source]
Evaluate the objective \(obj\).
- Parameters:
- Returns:
The value of the objective \(obj\).
- Return type:
- 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: dict[str, dict[str, ndarray]]
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: Mapping[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.