Problem Scaling
Posted: Tue Mar 02, 2021 11:50 am
I'm wondering if anyone knows of a good way to scale the states controls (and bonus points for kinematic constraint lagrange multipliers) in a MocoProblem? I am working in a branch of the source code but I can't figure out the best place to add in scaling to improve the problem formulation I am working with.
For a few rare parts of OpenSim the answer is not too difficult. Muscles activations and excitations are already scaled [0 1] and many actuators can be scaled by an arbitrary scale factor ("optimal_force") so one can conceivably scale them to the range [-1 1] or [-0.5 0.5] with just that property. However, I do not know of any way to scale coordinate values and most significantly, coordinate speeds and kinematic constraint lagrange multipliers. Meaning you can have a problem with a speed on the order of 1e2 with a position on the scale of 1e-2 and have a seemingly poorly scaled problem.
Is there any way to specify a simple linear scale for variables -- perhaps something hidden in a CasADi class? It would be nice to be able to specify this scaling along with setting the bounds for a state or control i.e.: setStateInfo/setControlInfo/setMultiplierBounds etc.
Optimally, I feel it would be nice for all of the variables (states, controls, lagrange multipliers, etc.) in the NLP to be scaled [1 2] or something like that.
For a few rare parts of OpenSim the answer is not too difficult. Muscles activations and excitations are already scaled [0 1] and many actuators can be scaled by an arbitrary scale factor ("optimal_force") so one can conceivably scale them to the range [-1 1] or [-0.5 0.5] with just that property. However, I do not know of any way to scale coordinate values and most significantly, coordinate speeds and kinematic constraint lagrange multipliers. Meaning you can have a problem with a speed on the order of 1e2 with a position on the scale of 1e-2 and have a seemingly poorly scaled problem.
Is there any way to specify a simple linear scale for variables -- perhaps something hidden in a CasADi class? It would be nice to be able to specify this scaling along with setting the bounds for a state or control i.e.: setStateInfo/setControlInfo/setMultiplierBounds etc.
Optimally, I feel it would be nice for all of the variables (states, controls, lagrange multipliers, etc.) in the NLP to be scaled [1 2] or something like that.