Closed auzbaig closed 4 years ago
Thanks for all the questions on the shape optimization. It helps us make improvements to the code to make it easier to use.
You are correct in that the adjoint gradients determine the direction that the optimizer moves the design variables. But this direction can (and usually does) change during the optimization process as it explores different parts of the design space. So the design variables won't always move in the same direction.
Sometimes the optimizer won't take the best step in the direction of descent. In this case, the objective function can increase. The optimizer will then try again in the same direction but with a different (usually smaller) step size. If it does achieve a reduction in the objective function, it will usually run the adjoints again to get an updated gradient direction. The objective + adjoint iterations are called major iterations and are what is output by the SLSQP algorithm. This process is more complicated when there are constraints involved.
So in summary, no it is not necessary (or likely) that the objective function will always decrease through an optimization process
Thanks, that was very helpful.
I have another question related to this., Would you suggest keeping all the control points as design variables or should the number of design variables be very selective to ensure that correct optimization direction is achieved? I have 216 control points on my FFD box, I can reduce them if I put in some extra effort in indexing them. Is it worth it?
Nah, I usually put in all the control points. It doesn't increase the computation time significantly and the optimizer should be able to handle that many control points.
I always fix one point, so the optimizer doesn't take the geometry for a walk.
@pcarruscag well you have boundaries that are fixed.
One last question before I close this thread: Are the objective functions minimized or maximized by default? @pcarruscag said a weight of +1 means minimize but is it applicable for all objective functions? Just want to be sure about this.
@pcarruscag is right. +1 weight indicates a minimization for all objective functions.
And is the minimization of the magnitude or the number?
Not sure what you mean. It reduces the objective function. This could be by small values, or by orders of magnitude, if such a reduction is possible.
If I have a value of the objective function as -3000, while minimizing, will it tend to make it -3500 (number) or -2500(magnitude)? Sorry if my terminologies are vague.
I haven't tried this, but it should minimize the number (towards -3500)
I usually try to keep it positive but if I switch the order in MARKER_ANALYZE, its sign can reverse.
Although I am minimizing my objective function, its value appears to rise in some designs while running a shape optimization. I look at my objective function value from the history_project.dat file.
It makes sense for it to move in only one direction because that's what the adjoint gradients will ask it to do, however, I don't know if this rule is actually always satisfied in shape optimization.