openmdao

How to tie SNOPT jacobian row and column back to OpenMDAO objective / constraint and variable


I am doing some debugging on a problem in OpenMDAO. I am using SNOPT as my optimizer. With SNOPT, you can do a derivatives check on your problem with the option "Verify level = 2". This will check your problem partial derivatives with finite difference, from what I understand. It will print the results of these to SNOPT_print.out.

In this print out, the headings

"Column" "x(j)" "dx(j)" "Element no." "Row" "Derivative" "Difference approxn"

appear.

Now, SNOPT thinks something is wrong with one of my derivatives is wrong. The text "bad?"

appears next to the "Difference approxn" column. Sorry I'm not copy pasting directly the output, but I don't have access to it at the moment.

I would like to know the column and row number map to in my OpenMDAO problem, to see I if I can find out just what the matter is. It definitely looks like a sign flip as the Derivative provided to SNOPT and finite diff approximation equal but for the factor of -1.

I have used check_partials() on all my components, but I cannot find the mistake they all seem fine.

I am hoping that I can do some more checking by find exactly what SNOPT is complaining about. Is there some way to interrogate OpenMDAO or pyoptsparse to find out?


Solution

  • I would suggest using check_totals. That will at least tell you which design var / response combination has the issue and you may be able to narrow it down from there.