Scaling and balancing #346
Replies: 2 comments 2 replies
-
Hi @baggepinnen, Scaling is certainly important for getting optimization problems that are well behaved. Regarding your first idea: I think such a feature addition would be better suited for JuMP, since the utility of scaling variables is not unique to InfiniteOpt problems. If JuMP were to have this feature, then InfiniteOpt would inherit it. JuMP already does something similar with handling complex variables, so I imagine that extending this capability for variable scaling should be doable. Regarding the 2nd idea: This seems doable, we would just need to expand our variable restriction syntax to support expressions. I have created an issue: #347. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick turnaround! The functionality added in the PR looks very nice 🎉 Maybe introducing scaling in JuMP is something we can discuss at JuliaCon/JuMP dev this summer, if you and Oscar will be there |
Beta Was this translation helpful? Give feedback.
-
Hi there 👋
I was reading an interesting paper on scaling and balancing of optimal-control problems (arXiv PDF), and have used some of the techniques from it with great effect. While trying to implement these scaling procedures in InfiniteOpt, my naive attempt at directly performing the scaling of the optimization variable$\tilde x$ to obtain the unscaled variable $x$ was thwarted by things like $\tilde x$ , but this is both a bit tedious and also very error prone, it's easy to forget to apply the scaling somewhere, or to apply the inverse scaling. The scaling has to be applied in a lot of places, constraints, dynamics, initial guesses etc.
x[1](1): MethodError: objects of type GenericAffExpr{Float64, GeneralVariableRef} are not callable
(example below). The workaround for this is of course to instead formulate everything in terms of the optimization variableA few ideas:
ref
andref0
arguments to functions such asadd_state, add_control
etc. The paper linked above is cited in the Dymos docs, I think they have implemented more or less the kind of scaling proposed in the paper.GenericAffExpr
) would be very handy, likex[1](1)
belowWith manually handled scaling, InfiniteOpt+Ipopt handily beats Dymos+Ipopt on the particular problem we are considering, without the scaling, Ipopt struggles to produce anything reasonable.
Beta Was this translation helpful? Give feedback.
All reactions