Skip to content

Terminate refinement early if optimization fails #1214

@eytanadler

Description

@eytanadler

Proposed feature.

The current _refine_iter implementation (in dymos/grid_refinement/refinement.py) will continue refining even if the optimization fails to converge. I could see this being desirable in some cases, but there are some instances where the problem is truly infeasible. In these infeasible cases the refinement will continue until it hits its limit, which can make iterating over high level trajectory parameters cumbersome.

I propose adding a terminate_on_fail argument to _refine_iter (and exposing it in the run_problem interface). I think the implementation is very straightforward; add the following check in the refinement iteration loop here:

if not failed.success and terminate_on_fail:
    break

Though I'm not positive that the .success attribute is available in drivers other than the pyOptSparse one.

It may also be desirable to have the option to avoid running the simulation in run_problem if the optimization (or nonlinear solve) fails.

I could open a PR with a proposed implementation if that'd be helpful.

Example

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions