taylor module¶
A discipline to create Taylor polynomials from another discipline.
- class gemseo.disciplines.taylor.TaylorDiscipline(discipline, input_data=mappingproxy({}), name='')[source]
Bases:
MDODiscipline
The first-order polynomial of a discipline.
The first-order polynomial of a function \(f\) at an expansion point \(a\) is \(f(a)+\sum_{i=1}^d\frac{\partial f(a)}{\partial x_i}(x_i-a_i)\).
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
discipline (MDODiscipline) – The discipline to be approximated by a Taylor polynomial.
input_data (Mapping[str, NDArray[float]]) –
The point of expansion. If empty, use the default inputs of
discipline
.By default it is set to {}.
name (str) –
The name of the discipline. If
None
, use the class name.By default it is set to “”.
- Raises:
ValueError – If neither
input_data
nordiscipline.default_inputs
is specified.
- 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.