gemseo.disciplines.taylor module#

A discipline to create Taylor polynomials from another discipline.

class TaylorDiscipline(discipline, input_data=mappingproxy({}), input_names=(), output_names=(), name='')[source]#

Bases: Discipline

The first-order Taylor polynomial of a discipline.

The first-order Taylor 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)\).

The default output values of this discipline correspond to the first term \(f(a)\) of this polynomial and can be accessed using taylor_discipline.io.output_grammar.defaults.

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • discipline (Discipline) -- 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 {}.

  • input_names (Iterable[str]) --

    The names of the input variables of interest. If empty, use all the input variables of discipline.

    By default it is set to ().

  • output_names (Iterable[str]) --

    The names of the output variables of interest. If empty, use all the output variables of discipline.

    By default it is set to ().

  • name (str) --

    The name of the discipline. If empty, use the name of the class.

    By default it is set to "".

Raises:
  • ValueError -- If neither input_data nor

  • discipline.io.input_grammar.defaults` is specified --