-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Starting a design discussion thread for nested vectorization.
Generic motivating example
A user wants to optimize the design of an aircraft. This aircraft has several different missions to complete, and the user wants to optimize over all of these missions simultaneously (the "outer vectorization"). For each mission, the aircraft has a max-payload configuration and an average-payload configuration (the "inner vectorization"). Of course the aircraft needs to be able to complete all missions with the max-payload configuration, but performance on each mission should be optimized around the average configuration. To further complicate things slightly, the climb and descent phases are discretized using VectorVariables. This means that some variables have as many as three dimensions.
Design challenges to address
Inputs
In the example given above, the payload is necessarily a 2-element substitution (average payload and maximum payload). But when the outer vectorization is introduced, GPkit currently requires that substitution to be 2xn, where n is the number of missions (the "degree(?)" of outer vectorization). Ideally this wouldn't be the case.
Slicing specific levels of vectorizations
As described in #1464, as_view (which works fine for one level of vectorization) seems to not be designed with nested vectorization in mind (please correct me if this is wrong). Maybe it's a simple fix, but would be good to know if there is perhaps something more scalable than the current as_view approach.
Printing and accessing solutions
The trusty workhorse SolutionArray.table method starts to struggle with communicating information beyond the inner vectorization. It's hard to tell which values refer to which slices of the vectorization. Maybe this is just the natural limit of plaintext solution tables, but I'm interested in discussing ways the table could be made more readable (more explicit), even with three-dimensional variables.
Even the output of sol(somethreedimensionalvariable) is hard to interpret.
Diff-ing
Closely related to the above: how do we adapt sol.diff to effectively capture changes in the solution when some variables have three dimensions.
Discuss!
I suspect one of the possible solutions could be something along the lines of Named Vectorizations, i.e. the idea of a key-oriented vectorization as opposed to an index-oriented vectorization, but I'm sure that would present lots of challenges with which I'm not yet familiar.
I'm sure we'll think of more challenges too, so this is just a start. Interested to hear people's thoughts!