Closed peterdsharpe closed 8 months ago
Update: resolved. Discrepancy was caused by updates to the NumPy backend from 1.24 -> 1.25, causing slight differences in floating-point operation results. This gets magnified throughout NeuralFoil's neural network, causing a tiny but measurable (on the order of 10 * floating-point epsilon, so around 10^-15) difference in NeuralFoil's outputs (lift, drag). This particular optimization case study happens to be very sensitive to initial conditions, causing it not to converge. Essentially, NeuralFoil's model landscape has a small "wiggle" near the optimum, and this floating-point math difference is enough to trip the optimizer into an infeasible local minimum. For example, changing the initial guess from a NACA0012 to a NACA0013 airfoil resolves the issue.
Fundamentally this is is a one-off issue caused by NeuralFoil's model landscape, not an issue with AeroSandbox, so closing this issue. However, it is useful to know that NumPy 1.24 and 1.25 produce computational results that, while within acceptable floating-point tolerance, are ever-so-slightly different. This may affect repeatability across versions. On the NeuralFoil note, a new version with improved model architecture will be released soon that will improve robustness to initial guesses.
By-product of this is that we can re-enable NumPy 1.25+, allowing AeroSandbox to be installed on Python 3.12+.
This code runs fine with NumPy 1.24.4, but does not work with NumPy 1.25.0. Will update as investigation continues.
Update: seems to not be an issue on Linux. Maybe Windows-only?