gemseo / algos

post_optimal_analysis module

Post-optimal analysis

class gemseo.algos.post_optimal_analysis.PostOptimalAnalysis(opt_problem, ineq_tol=None)[source]

Bases: object

Post-optimal analysis of a parameterized optimization problem.

Consider the parameterized optimization problem below, whose objective and constraint functions depend on both the optimization variable \(x\) and a parameter \(p\).

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

Denote \(x^\ast(p)\) a solution of the problem, which depends on \(p\). The post-optimal analysis consists in computing the following total derivative:

\[\newcommand{\total}{\mathrm{d}} \frac{\total f(x^\ast(p),p)}{\total p}(p) =\frac{\partial f}{\partial p}(x^\ast(p),p) +\lambda_g^\top\frac{\partial g}{\partial p}(x^\ast(p),p) +\lambda_h^\top\frac{\partial h}{\partial p}(x^\ast(p),p),\]

where \(\lambda_g\) and \(\lambda_h\) are the Lagrange multipliers of \(x^\ast(p)\). N.B. the equality above relies on the assumption that

\[\newcommand{\total}{\mathrm{d}} \lambda_g^\top\frac{\total g(x^\ast(p),p)}{\total p}(p)=0 \text{ and } \lambda_h^\top\frac{\total h(x^\ast(p),p)}{\total p}(p)=0.\]


  • opt_problem (OptimizationProblem) – solved optimization problem to be analyzed

  • ineq_tol – tolerance to determine active inequality constraints. If None, its value is fetched in the optimization problem.

MULT_DOT_CONSTR_JAC = 'mult_dot_constr_jac'
check_validity(total_jac, partial_jac, parameters, threshold)[source]

Checks whether the assumption for post-optimal validity holds.

  • total_jac (dict(dict(ndarray))) – total derivatives of the post-optimal constraints

  • partial_jac – partial derivatives of the constraints

  • parameters (list(str)) – names list of the optimization problem parameters

  • threshold (number) – tolerance on the validity assumption

compute_lagrangian_jac(functions_jac, inputs)[source]

Computes the Jacobian of the Lagrangian.

  • functions_jac (dict(dict(ndarray))) – Jacobians of the optimization function w.r.t. the differentiation inputs

  • inputs (list(str)) – names list of the inputs w.r.t. which to differentiate

execute(outputs, inputs, functions_jac)[source]

Performs the post-optimal analysis.

  • outputs (list(str)) – names list of the outputs to differentiate

  • inputs (list(str)) – names list of the inputs w.r.t. which to differentiate

  • functions_jac (dict(dict(ndarray))) – Jacobians of the optimization functions w.r.t. the differentiation inputs