linopy.piecewise.PiecewiseFormulation#

class linopy.piecewise.PiecewiseFormulation(name, method, variable_names, constraint_names, model, convexity=None)#

Result of add_piecewise_formulation.

Groups all auxiliary variables and constraints created by a single piecewise formulation. Stores only names internally; variables and constraints properties return live views from the model.

name#

Formulation name (used as prefix for auxiliary variables and constraints).

Type:

str

method#

Resolved method actually used. Never "auto"; if the caller passed method="auto", this holds the method that was chosen.

Type:

PWL_METHOD

convexity#

Shape of the piecewise curve along the breakpoint axis when it is well-defined (exactly two expressions, non-disjunctive, strictly monotonic x breakpoints). None otherwise.

Type:

PWL_CONVEXITY or None

__init__(name, method, variable_names, constraint_names, model, convexity=None)#

Methods

__init__(name, method, variable_names, ...)

Attributes

name

method

Resolved formulation method (see PWL_METHOD).

variable_names

constraint_names

model

convexity

Shape of the piecewise curve when well-defined (see PWL_CONVEXITY), else None.

constraints

View of the auxiliary constraints in this formulation.

variables

View of the auxiliary variables in this formulation.