stormvogel.parametric

Attributes

Classes

Polynomial

Represents polynomials, to be used as values for parametric models.

RationalFunction

Represents rational functions, to be used as values for parametric models

Module Contents

stormvogel.parametric.Number
class stormvogel.parametric.Polynomial(variables: list[str])

Represents polynomials, to be used as values for parametric models. Polynomials are represented as a dictionary with n-dimensional tuples as keys.

Args:

terms: terms of the polynomial (dictionary that relates exponents to coefficients) variables: variables of the polynomial as a list of strings

terms: dict[tuple, float]
variables: list[str]
add_term(exponents: tuple[int, Ellipsis], coefficient: float)

adds a term to the polynomial example: add_term((1,2,3,4), 5) means we add 5*(x1^1*x2^2*x3^3*x4^4)

get_dimension() int

returns the number of different variables present

get_variables() set[str]

returns the set of parameters

get_degree() int | None

returns the degree of the polynomial

evaluate(values: dict[str, Number]) float

evaluates the polynomial with the given values for the variables

__str__() str
__lt__(other) bool
__eq__(other) bool
__iter__()
class stormvogel.parametric.RationalFunction(numerator: Polynomial, denominator: Polynomial)

Represents rational functions, to be used as values for parametric models Rational functions are represented as a pair of polynomials.

Args:

numerator: Polynomial in the numerator denominator: Polynomial in the denominator

numerator: Polynomial
denominator: Polynomial
get_dimension() int

returns the number of different variables present

get_variables() set[str]

returns the total set of variables of this rational function

evaluate(values: dict[str, Number]) float

evaluates the rational function with the given values

__str__() str
__lt__(other) bool
stormvogel.parametric.Parametric