LordCat
LordCat

Reputation: 518

Access values of design variables while solver is running (OpenMDAO with IPOPT)

I'm trying to do trajectory optimisation in Dymos (a library built atop OpenMDAO), but I'm not getting the convergence properties I'm expecting and I'd like to inspect the intermediate solutions of the solver in order to debug.

Is there a way, in OpenMDAO, to access the design variables as the solver is running, so that intermediate values can be printed or plotted? I believe this is theoretically possible as other libraries seem to provide this functionality for IPOPT (see the bottom of this page: https://cyipopt.readthedocs.io/en/stable/tutorial.html#scipy-compatible-interface), but I can't work out how to do this (or see any documentation) in OpenMDAO.

Upvotes: 0

Views: 68

Answers (1)

Rob Falck
Rob Falck

Reputation: 2704

One solution would be to enable the Driver's "debug_print" option. This will print the design variables at every iteration:

Debugging Drivers

Another option would be to add a recorder to the driver, so that the design variables, constraints, and objectives are recorded at each iteration. There are also options to enable the recording of other inputs and outputs in the model.

Advanced Case Recording

Upvotes: 1

Related Questions