# Reporting unimplemented stopping criteria in Cobyla

**URL:** <https://openturns.discourse.group/t/reporting-unimplemented-stopping-criteria-in-cobyla/436>\
**Category:** Development\
**Created:** [July 1, 2026, 2:14pm UTC](https://openturns.discourse.group/t/reporting-unimplemented-stopping-criteria-in-cobyla/436 "2026-07-01T14:14:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jherrmann](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jherrmann](https://openturns.discourse.group/u/jherrmann)\
**Post date:** [July 1, 2026, 2:14pm UTC](https://openturns.discourse.group/t/reporting-unimplemented-stopping-criteria-in-cobyla/436/1 "2026-07-01T14:14:15Z")

</div>

Hi everyone.

`Cobyla` inherits `setMaximumRelativeError`, `setMaximumResidualError` from `OptimizationAlgorithmImplementation`.

As far as I know from checking the code (but I could be wrong), neither of those stopping criteria can be used with `Cobyla`. Setting those fields does nothing.

Only the maximum absolute error is used ( to set `rhoEnd`, the main stopping criteria used in the original Cobyla). (see lib/src/Base/Optim/Cobyla.cxx#L105)

I think it would be great to report to the user that those stopping criteria are not implemented.

I suggest raising an exception, to stay consistent with the way unavailable stopping criteria for Simulation algorithms are reported in @m-balesdent 's recent pull request (cf [add warning for NAIS and adaptive IS by m-balesdent · Pull Request #3219 · openturns/openturns · GitHub](https://github.com/openturns/openturns/pull/3219)).

I know that the current implementation of Cobyla used by OpenTURNS is probably going to be replaced in the future by the PRIMA one. However, as far as I understand, the PRIMA implementation still doesn’t support relative errors and residual errors as stopping criteria.

The full list of parameters for PRIMA’s Cobyla is here if you want to check :

[https://github.com/libprima/prima/blob/fortran/cobyla/cobyla.f90#L56-L260](https://github.com/libprima/prima/blob/1d76fb88aeffb427cd17ed1e9d0d3b34f414913f/fortran/cobyla/cobyla.f90#L56-L260)

Therefore, I think my suggestion would still be relevant even if the implementation of Cobyla was changed for the PRIMA one.

What do you think ?

---

<div class="post-metadata">

**Author:** ![schueller](https://yyz2.discourse-cdn.com/free1/user_avatar/openturns.discourse.group/schueller/32/3_2.png) [@schueller](https://openturns.discourse.group/u/schueller)\
**Post date:** [July 6, 2026, 8:34am UTC](https://openturns.discourse.group/t/reporting-unimplemented-stopping-criteria-in-cobyla/436/2 "2026-07-06T08:34:00Z")

</div>

maybe raising an exception would prevent from switching easily between solvers (ie for persalys)
