fast-aircraft-design / FAST-OAD

FAST-OAD: An open source framework for rapid Overall Aircraft Design
GNU General Public License v3.0
53 stars 26 forks source link

Optimization failed with in-house model #282

Closed AleSgueglia closed 3 years ago

AleSgueglia commented 3 years ago

I developed some in-house models, for the mass and the performance, and despite the evaluation works fine, the optimization fails every time I try to launch it, no matter the tolerance and the starting point. Interesting is that if I create my own code for the loop, I have no problem and the optimization, with the same settings, converges fine. Attached the configuration file and the error that I obtain.

Conf_and_output_issue.zip

christophe-david commented 3 years ago

Unfortunately, it is difficult to conclude anything from these outputs. I would suggest to use all prints that OpenMDAO can provide by modifying your configuration with:

driver = "om.ScipyOptimizeDriver(tol=1e-6, optimizer='SLSQP', debug_print=['desvars', 'ln_cons', 'nl_cons', 'objs', 'totals'])"
...
nonlinear_solver = "om.NonlinearBlockGS(maxiter=200, iprint=2)"

Once this modification is done, I would appreciate that you send obtained outputs from these runs:

Hopefully we will see discrepancies that may help understand the problem.

AleSgueglia commented 3 years ago

Hello Christophe, thanks for the tip: using the runs I was able to detect the error and changing some setup in the linear and non linear solver I finally obtained a converged solution. It seems that with the DirectSolver as linear solver it had some convergence problem in the model, but everything works fine with the LinearBlockGS, that I also used in my own code.

Thanks again for the help!!

Regards, Alessandro Sgueglia

christophe-david commented 3 years ago

You are welcome. Thanks for the feedback.