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 — one of {"sos2", "incremental", "lp"}. Never "auto"; if the caller passed method="auto", this holds the method actually chosen.

Type:

str

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:

{"convex", "concave", "linear", "mixed"} or None

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

Methods

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

Attributes

name

method

variable_names

constraint_names

model

convexity

constraints

View of the auxiliary constraints in this formulation.

variables

View of the auxiliary variables in this formulation.