first_order_stop_criteria module¶
Implementation of the Karush-Kuhn-Tucker residual norm stopping criterion.
- exception gemseo.algos.first_order_stop_criteria.KKTReached[source]¶
Bases:
TerminationCriterion
A termination criterion based on the Karush-Kuhn-Tucker (KKT) residual norm.
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- args¶
- gemseo.algos.first_order_stop_criteria.is_kkt_residual_norm_reached(opt_problem, x_vect, kkt_abs_tol=0.0, kkt_rel_tol=0.0, ineq_tolerance=0.0001, reference_residual=1.0)[source]¶
Test if the KKT conditions are satisfied.
- Parameters:
opt_problem (OptimizationProblem) – The optimization problem containing an optimization history.
x_vect (ndarray) – The design point vector where the KKT conditions are tested.
kkt_abs_tol (float | None) –
The absolute tolerance on the KKT condition residual. If
None
, the absolute criterion is not activated.By default it is set to 0.0.
kkt_rel_tol (float | None) –
The relative tolerance on the KKT condition residual. If
None
, the relative criterion is not activated.By default it is set to 0.0.
ineq_tolerance (float) –
The tolerance to consider a constraint as active.
By default it is set to 0.0001.
reference_residual (float) –
The reference KKT condition residual.
By default it is set to 1.0.
- Returns:
Whether the absolute or the relative KKT residual norm criterion is reached.
- Return type:
- gemseo.algos.first_order_stop_criteria.kkt_residual_computation(opt_problem, x_vect, ineq_tolerance=0.0001)[source]¶
Compute the KKT residual norm.
This implementation is inspired from Svanberg Matlab implementation of MMA algorithm see [Sva98]
- Parameters:
opt_problem (OptimizationProblem) – The optimization problem containing an optimization history.
x_vect (ndarray) – The design point vector where the KKT conditions are tested.
ineq_tolerance (float) –
The tolerance to consider a constraint as active.
By default it is set to 0.0001.
- Returns:
The KKT residual norm.
- Return type: