Learning Curve, and Applying Aviary to Low Speed, Low Weight Aircraft. #904
-
|
TL;DR: Struggling to determine where my poorly posed inputs are originating in the context of working toward a small, low-speed aircraft input deck that can be used to run multi-variable optimizations. Hello!I'm attempting to learn Aviary and apply it to smaller scale problems, think 4-seat general aviation with cruise speeds in the 120–200 KTAS range. I appreciate any help, documentation, or critique anyone is able to offer. This post serves two purposes:
I've included a fair amount of context at the end, but questions first Questions
ContextMy workflow/learning process has been as follows: start simple and slowly build up complexity. 1. Start with examplesI've started with
2. Build a Recip EngineDeckRepresents something approximating a 180 HP recip engine with a fixed-pitch prop.
3. Modify an existing input deckModify one of the existing input decks to hit a "rational" set of weight and drag numbers that can use the EngineDeck.
4. Build an input deck from scratchRepresent a Cessna 172 and compare results to POH numbers, modifying the deck as necessary.
Problems I've Encountered
asaf_5000lbm_mod.csv |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
|
Hey, will-whelan. Thank you for the detailed post; there are a lot of good suggestions here. We definitely have some work to do to get Aviary to more useful tool, and we appreciate feedback from users. I've got some answers for the main questions you asked, and below that, I have a couple of things I changed in your model to get a good converged solution.
This is an interesting idea for a graphical tool, where you select a variable and it traces back everything that contributed to it. It would get more involved once you have solver loops though. When I want to trace something back, I find
The "ref" is a value used to scale the quantity for the optimizer. Ideally, you want the design variables and constraints to operate in a range of [0, 1] or [-1, 1]. The 'ref' value is the value that will be mapped to 1, so if you have a 125000 lbm aircraft, a ref of 1.25e5 would be appropriate. There are some default refs that aren't ideal, and there are still even some hard-coded refs (and upper/lower bounds) that haven't been added to the user-facing API, so don't be afraid to adjust those when needed. Note that whether and how you scale is optimizer dependent. When using SNOPT, scaling makes a big difference. When using IPOPT, it isn't as important because IPOPT auto-scales the problem (and has some options to control that).
I somewhat agree about the time_bounds not being "needed", but it will depend on the optimizer. IPOPT performs better if every design variable has a reasonable upper and lower bound, but other optimizers are fine without them. You can certainly set it much higher. One thing about 'ft' as upper/lower bounds. There are some phases where distance is used as the integration variable for the differential equations rather than time. However, you should only see this if you are using "SOLVED_2DOF" for your settings:equations_of_motion, which would really only be needed for detailed take-off or detailed landing. You should probably be using either TWO_DEGREES_OF_FREEDOM or HEIGHT_ENERGY. Thank you for providing all of the files to run your case. I download them and played around (though I did switch over to SNOPT) and noticed that the mass constraint was the one that was still violated when it terminated. The optimizer has control of the gross_mass, so it ought to be able to just increase it here, but something is preventing it. The time constraints you mentioned weren't the culprit (and I did relax them just in case.) One common problem is the engine isn't powerful enough to fly the mission, or alternatively, the drag is too high. You can experiment with the drag by adjusting the Note, I also fixed the following, which looked like a mistake: I changed "mach_final" to 0.1, since I think that is what you meant. So yeah, I think the drag here is the problem, which comes from some old correlations for large transport aircraft, and some of the tables are probably in extrapolation mode for these flight conditions/geometry. For your small plane, you might want to consider adding a drag polar that is more representative. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Kenneth, Thank you for the detailed response! I am deeply appreciative of the time you've taken to help and run the problem. Was there anything in particular that tipped off drag/power imbalance as the culprit, or just prior experience? I was keeping an eye on the mission trajectory for any obvious errors, but nothing caught my eye. (Maybe a throttle setting of 1.04 at the beginning of the climb phase now that I'm looking closer at the failed runs?) And thank you for the |
Beta Was this translation helpful? Give feedback.
-
|
From my experience, 40% of the time that my optimization is not converging is because of scaling/tolerancing, 10% is a typo in input parameters, and the other 50% is because I have defined an impossible problem without realizing it (in your case, using an engine that can't propel the aircraft to flight speeds) ¯\_(ツ)_/¯ |
Beta Was this translation helpful? Give feedback.
-
|
The thrust/drag convergence issue is pretty common in my experience. Legacy tools like FLOPS scale the engine up/down as needed by default, which Aviary currently does not. I've thought about making engine scaling ( |
Beta Was this translation helpful? Give feedback.


Hey, will-whelan. Thank you for the detailed post; there are a lot of good suggestions here. We definitely have some work to do to get Aviary to more useful tool, and we appreciate feedback from users. I've got some answers for the main questions you asked, and below that, I have a couple of things I changed in your model to get a good converged solution.
This is an interesting idea for a graphical tool, where you select a variable and it traces back everything that contributed to it. It would get more involved once you have solver loops though.
When I want to trace something back, I find
prob.model.list_vars(units=True, print_arrays=True)to be helpful. It provides a hierarchic…