picos.expressions.exp_extremum

Implements MaximumConvex and MinimumConcave.

Classes

class picos.expressions.exp_extremum.Extremum(expressions)[source]

Bases: picos.expressions.exp_extremum.ExtremumBase, picos.expressions.expression.Expression

Base class for MaximumConvex and MinimumConcave.

Note

This can represent the maximum (minimum) over convex (concave) uncertain expressions as long as the uncertainty is not of stochastic nature. In this case, the extremum implicitly goes over the perturbation parameters as well.

__init__(expressions)[source]

Construct a MaximumConvex or MinimumConcave.

Parameters

expressions – A collection of all convex or all concave expressions.

property expressions

The expressions under the extremum.

class picos.expressions.exp_extremum.ExtremumBase[source]

Bases: abc.ABC

Base class for Extremum and similar classes.

In particular, this is also used by the uncertain RandomExtremumAffine.

Must be inherited with priority with respect to Expression.

property argnum

Number of expressions under the extremum.

abstract property expressions

The expressions under the extremum.

class picos.expressions.exp_extremum.MaximumBase[source]

Bases: object

Base implementation of ExtremumBase for maximums.

class picos.expressions.exp_extremum.MaximumConvex(expressions)[source]

Bases: picos.expressions.exp_extremum.MaximumBase, picos.expressions.exp_extremum.Extremum

The maximum over a set of convex scalar expressions.

Example

>>> import picos
>>> x = picos.RealVariable("x", 4)
>>> a = abs(x)
>>> b = picos.sum(x)
>>> c = picos.max([a, b]); c
<Maximum of Convex Functions: max(‖x‖, ∑(x))>
>>> 2*c
<Scaled Maximum of Convex Functions: 2·max(‖x‖, ∑(x))>
>>> c <= 5
<Maximum of Convex Functions Constraint: max(‖x‖, ∑(x)) ≤ 5>
class picos.expressions.exp_extremum.MinimumBase[source]

Bases: object

Base implementation of ExtremumBase for minimums.

class picos.expressions.exp_extremum.MinimumConcave(expressions)[source]

Bases: picos.expressions.exp_extremum.MinimumBase, picos.expressions.exp_extremum.Extremum

The minimum over a set of concave scalar expressions.

Example

>>> import picos
>>> x = picos.RealVariable("x", 4)
>>> a = picos.sum(x)
>>> b = 2*a
>>> c = picos.min([a, b]); c
<Minimum of Concave Functions: min(∑(x), 2·∑(x))>
>>> -1*c
<Maximum of Convex Functions: max(-∑(x), -2·∑(x))>
>>> C = 5 <= c; C
<Minimum of Concave Functions Constraint: min(∑(x), 2·∑(x)) ≥ 5>
>>> x.value = 1
>>> C.slack
-1.0