convex_function#

class ConvexTerm(operand, deg_quad, quadrature_scheme='default', parameters=None)[source]#
add_conic_constraint(expr, cone: Cone, name='')[source]#

Add a conic constraint \(expr \in \mathcal{K}\).

Parameters:
  • expr (UFL expression) – a UFL affine combination of variables

  • cone (dolfinx_optim.cones.Cone) – The cone \(\mathcal{K}\) in which to constrain the expression

  • name (str, optional) – Name of the constraint

add_eq_constraint(expr, b=0.0, name=None)[source]#

Add an equality constraint \(expr=b\).

expr can contain an affine combination of optimization variables.

Parameters:
  • expr (UFL expression) – a UFL affine combination of variables

  • b (float, expression) – corresponding right-hand side

  • name (str, optional) – Lagrange-multiplier name for later retrieval.

add_ineq_constraint(expr, bu=None, bl=None, name=None)[source]#

Add an inequality constraint \(b_l \leq expr \leq b_u\).

Parameters:
  • expr (UFL expression) – a UFL affine combination of variables

  • b_l (float, expression) – corresponding lower bound. Ignored if None.

  • b_u (float, expression) – corresponding upper bound. Ignored if None

  • name (str, optional) – Lagrange-multiplier name for later retrieval.

add_linear_term(expr)[source]#

Add a linear expression of variables.

Parameters:

expr (UFL expression) – a UFL linear combination of variables defining the linear objective.

add_var(dim=0, cone=None, ux=None, lx=None, name=None)[source]#

Add a (list of) auxiliary optimization variable.

These variables are local and their interpolation is defined through the chosen quadrature scheme.

Parameters:
  • dim (int, list of int) – dimension of each variable (0 for a scalar)

  • cone (Cone, list of Cone) – cone in which each variable belongs (None if no constraint)

  • ux (float, Function) – upper bound on variable \(x\leq u_x\)

  • lx (float, Function) – lower bound on variable \(l_x\leq x\)

  • name (str) – variable name