gemseo / algos

lagrange_multipliers module

Implementation of the Lagrange multipliers

class gemseo.algos.lagrange_multipliers.LagrangeMultipliers(opt_problem)[source]

Bases: object

Class that implements the computation of Lagrange Multipliers

Denote \(x^\ast\) an optimal solution of the optimization problem below.

\[\begin{split}\begin{aligned} & \text{Minimize} & & f(x) \\ & \text{relative to} & & x \\ & \text{subject to} & & \left\{\begin{aligned} & g(x)\le0, \\ & h(x)=0, \\ & \ell\le x\le u. \end{aligned}\right. \end{aligned}\end{split}\]

If the constraints are qualified at \(x^\ast\) then the Lagrange multipliers of \(x^\ast\) are the vectors \(\lambda_g\), \(\lambda_h\), \(\lambda_\ell\) and \(\lambda_u\) satisfying

\[\begin{split}\left\{\begin{aligned} &\frac{\partial f}{\partial x}(x^\ast) +\lambda_g^\top\frac{\partial g}{\partial x}(x^\ast) +\lambda_h^\top\frac{\partial h}{\partial x}(x^\ast) +\sum_j\lambda_{\ell,j}+\sum_j\lambda_{u,j} =0,\\ &\lambda_{g,i}\ge0\text{ if }g_i(x^\ast)=0, \text{ otherwise }\lambda_{g,i}=0,\\ &\lambda_{\ell,j}\le0\text{ if }x^\ast_j=\ell_j, \text{ otherwise }\lambda_{\ell,j}=0,\\ &\lambda_{u,j}\ge0\text{ if }x^\ast_j=u_j, \text{ otherwise }\lambda_{u,j}=0. \end{aligned}\right.\end{split}\]



opt_problem – optimization problem on which Lagrange multipliers shall be computed

CSTR_LABELS = ['lower_bounds', 'upper_bounds', 'inequality', 'equality']
EQUALITY = 'equality'
INEQUALITY = 'inequality'
LOWER_BOUNDS = 'lower_bounds'
UPPER_BOUNDS = 'upper_bounds'
compute(x_vect, ineq_tolerance=1e-06, rcond=- 1)[source]

Computes and returns the Lagrange multipliers, as a post-processing of the optimal point.

This solves : (d ActiveConstraints)’ d Objective (——————-) . Lambda = - ———– (d X ) d X

  • x_vect – x point on which the multipliers shall be computed

  • ineq_tolerance – tolerance on inequality constraints

  • rcond – float, optional Cut-off ratio for small singular values of the jacobian. see sipy.linalg.lsq


Logs a representation of the optimization problem characteristics logs self.__repr__ message