A professional-grade aerodynamic section synthesizer and computational surrogate model.
NAPS dynamically generates and visualizes standard NACA 4-digit aerodynamic profiles. Unlike traditional static airfoil plotters, this engine utilizes an integrated TensorFlow.js artificial neural network to solve the inverse design problem: synthesizing the required geometric parameters based on a target theoretical lift coefficient (
-
Inverse Aerodynamic Design: Specify a target
$C_L$ and let the neural network infer the exact camber ($m$ ), camber position ($p$ ), and thickness ($t$ ) required to achieve it. -
Strict Mathematical Foundation: Implements exact analytical equations for NACA 4-digit profiles and rigorous numerical integration (trapezoidal rule) for Thin Airfoil Theory
$C_L$ calculations. -
CFD-Ready Export: Generates Selig
.datformat coordinate files with guaranteed closed trailing edges for watertight meshing in solvers like OpenFOAM, XFOIL, and SU2. -
High-Performance UI: Real-time
<canvas>visualizations with resolution-independent (DPR-aware) scaling and modern aerospace-grade aesthetics. - Client-Side ML: The entire dataset generation, min-max scaling, training, and inference pipeline executes securely in-browser via TensorFlow.js.
The underlying dataset relies on classical Thin Airfoil Theory to compute the zero-lift angle (
Note on limits: TAT represents an inviscid, zero-thickness approximation. Therefore, theoretical
To bypass iterative inverse solvers, the engine trains a lightweight Multi-Layer Perceptron (MLP) on a continuously generated 2D grid of valid profile spaces.
-
Input: Target
$C_L$ (dynamically clamped and normalized via min-max scaling to maximize sigmoid resolution). -
Architecture:
1 -> 32 -> 32 -> 2 -
Output: Predicted Maximum Camber (
$m$ ) and Position ($p$ ). -
Degeneracy Handling: Purely symmetric profiles (
$m=0$ ) result in identical$C_L$ outputs across all$p$ values. The dataset builder explicitly deduplicates these degenerate states to prevent ill-posed weight averaging.
Standard NACA profiles leave a finite gap at the trailing edge. This engine adjusts the 4th-order polynomial coefficient from -0.1015 to -0.1036. This geometric trade-off (sacrificing
- Core Logic: Vanilla ES6+ JavaScript
- Machine Learning:
@tensorflow/tfjs - Styling: CSS (Custom aerospace design tokens)
- Bundler: Vite
Ensure you have Node.js installed, then run the following commands:
# Clone the repository and navigate into the project directory
git clone <repository-url>
cd naps
# Install dependencies
npm install
# Start the Vite development server
npm run dev
# Build for production
npm run buildThis project is open-source and distributed under the MIT License. See the LICENSE file for details.