Jeroen
Jeroen

Reputation: 129

OpenMDAO: Is there an optimum magnitude of each design variable or objective function to search design space?

I am using SLSQP optimizer. I remember reading somewhere that there is an optimal magnitude of objective function or design variable (or maybe ratio between the two?)to search the design space. For example if my objective function is an order of magnitude larger, it seems like the jump in the design space is an order of magnitude larger too.

If this jump is too small, it might limit the amount of the design space it searches, or it might just take forever to reach a certain point. However, too large jumps is also not good.

Any help would be appreciated. Let me know if something is unclear. Thank you!

Upvotes: 0

Views: 206

Answers (1)

onodip
onodip

Reputation: 655

I don't think we can speak about an optimum magnitude of scaling. Scaling is just a nice way to transform your problem formulation to something that is easier to solve. Generally it is good practice to scale design variables, constraints and objectives to improve the convergence of your optimizer. Scaling the objective and constraint makes sense because all of them appear in the Jacobian matrix. Usually scaling with the initial values is a good guess. This is problematic if your initial value is close to zero, in this case choosing some other sensible value or a limiting value of the given quantity also works. For design variables scaling to get 0 and 1 for lower and upper bounds is also common. It is good if everything is within an order of magnitude of 1. Some optimization algorithms and non-linear solvers also use the value of the objective to guess the line search step. If this is not close to the order of 1, the line search might take more steps to converge (if it does).

If you are using finite differences to calculate your gradient, it is also a second reason for scaling. If design variables have a high order of magnitude, a small finite difference on them might cause only unnoticeable changes on the objective (or the changes are swallowed by truncation error). For example if your design variables is a length of 10000mm, and your finite difference step is 0.001, the perturbed variable will be 10000.001, which likely does not make a big difference in your objective.

Some external codes take input files with a finite floating point precision, an incorrect scaling might lead to no changes in the significant digits and therefore no change in the outputs.

Implementation in OpenMAO:

You can easily scale your variables in OpenMDAO, either by scaling the magnitude (scaler), offsetting the value (adder), or setting two reference values that scale it to 0 or 1 (ref and ref0). Docs of scaler, adder, ref, ref0 (including the precedence, if you use more than one): http://openmdao.org/twodocs/versions/3.0.0/features/core_features/adding_desvars_objs_consts/index.html

You can also scale all other variables in OpenMDAO to improve the behavior of solvers. More on scaling variables in OpenMDAO: http://openmdao.org/twodocs/versions/3.0.0/theory_manual/scaling.html

Upvotes: 9

Related Questions