mdolab / CMPLXFOIL

GNU General Public License v2.0
29 stars 20 forks source link

Match complex version convergence tolerances to real version #28

Closed eytanadler closed 1 month ago

eytanadler commented 1 month ago

Purpose

In some cases, the primal (real) version of XFOIL converges fine, but then the gradient evaluation with the complex version does not converge. Optimizers very much dislike when the primal succeeds and the gradient fails. Most just crash.

One of the reasons I found for this happening is that the tolerances of the real and complex XFOIL versions do not match. This PR fixes this problem. This does not solve all of the situations where the primal succeeds and gradient fails, but it helps many of them. Furthermore, converging the complex evaluations more tightly (by four orders more than before) dramatically improves optimizer convergence near the optimum design, presumably because of more accurate gradients.

Expected time until merged

ASAP as possible

Type of change

Testing

Checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.19%. Comparing base (9ab8eec) to head (1da9ee3).

Files Patch % Lines
cmplxfoil/__init__.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #28 +/- ## ======================================= Coverage 66.19% 66.19% ======================================= Files 4 4 Lines 565 565 ======================================= Hits 374 374 Misses 191 191 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.