virtual bool get_scaling_parameters(Number& obj_scaling,
bool& use_x_scaling, Index n,
Number* x_scaling,
bool& use_g_scaling, Index m,
Number* g_scaling)
This method is called if the nlp_scaling_method is chosen as user-scaling. Then the user is to provide scaling factors for the objective function, as well as for the optimization variables and/or constraints. The return value should be true, unless an error occurred, and the program is to be aborted.
The value returned in obj_scaling determines, how IPOPT should internally scale the objective function. For example, if this number is chosen to be 10, then IPOPT solves internally an optimization problem that has 10 times the value of the original objective function provided by the TNLP. In particular, if this value is negative, then IPOPT will maximize the objective function instead of minimizing it.
The scaling factors for the variables can be returned in x_scaling, which has the same length as x in the other TNLP methods, and the factors are ordered like x. You need to set use_x_scaling to true, if you want IPOPT so scale the variables. If it is false, no internal scaling of the variables is done. Similarly, the scaling factors for the constraints can be returned in g_scaling, and this scaling is activated by setting use_g_scaling to true.
As a guideline, we suggest to scale the optimization problem (either
directly in the original formulation, or after using scaling factors)
so that all sensitivities, i.e., all non-zero first partial
derivatives, are typically of the order
.