Issue 1033 - Fix Infinite Payload Range Looping #1034
Conversation
… of generate_payload_range
…ault for max_iter
|
We should test this as well - the original payload-range test doesn't work using the flag because we needed to get access to the off-design problems in order to check their values. I don't know if we can avoid running the whole payload-range suite twice but if would be nice if we can find a way to do so |
…ll of run_payload_range method. Modify run_payload_range to save the off design problems into the original aviary problem object to enable easier access of off design variables
… after payload_runage run
Is a cleaner potential solution to simply check for mission type and only call the payload-range method if a design mission is currently being run? |
We could do this - is there ever a time when it makes sense to run a payload_range diagram from a non-design mission? |
I can't think of any, and the payload-range method is always available to directly call if you did for some reason. |
Summary
This PR fixes a bug where setting payload_range in aviary inputs triggered an infinite looping of trying to generate a payload_range diagram.
The quick fix is to reset the aviary inputs value immediately after generate_payload_range has been set, ahead of running the first off design problem. Unfortunately this leaves mismatched aviary inputs.settings.payload_range = False and prob.generate_payload_range = True for the original parent problem. It is unclear how to fix this without introducing another variable, which seems unecessary!
There is also a small change to grab max_iter from the design/sizing problem and parse that to the optimizer for the off_design problems. This solved an issue where off_design problems failed due to hitting the default max iteration limit (50).
Related Issues
Backwards incompatibilities
None
New Dependencies
None