Gradient-based nested co-design of aerodynamic shape and flight trajectory for agile glider manoeuvres such as perching and soft landing.
This repository implements a differentiable bilevel optimization pipeline in which the outer loop optimizes the airfoil or wing shape, while the inner loop solves a constrained optimal control problem (OCP) for the vehicle dynamics. The dynamics use a physically informed neural network surrogate to predict aerodynamic coefficients.
The repository currently contains two related aerodynamic formulations:
- a 2D section-based formulation, which is the methodology documented and validated in our paper, and
- a 3D lifting-line-coupled extension, implemented in the codebase as a subsequent development.
The repository is organized around three complementary layers:
glider_optimization/
├── glider_optimization/ # core package
│ ├── blocks/ # differentiable pipeline blocks
│ ├── utils/ # lifting-line, geometry, and utility functions
│ ├── config.py
│ ├── runner.py
│ └── main.py
├── conf/ # run configurations
└── methods/ # aerodynamics background and modeling notes
The structure of the pipeline is designed to be modular. It is possible to change the control problem by editing glider-optimization/blocks/ocp.py, or even skip it entirely, resulting in a fixed-point shape optimization. In that case, the evaluation function defined in glider-optimization/blocks/evaluation.py should be updated accordingly.
Clone the repository and install it in editable mode:
pip install -e .Run a configuration:
glider-opt --config conf/test.yaml --run-name demo_runA few settings determine most of the behavior:
-
neuralFoilSampling.use_3d_lltfalse: use the 2D sectional formulationtrue: use the 3D lifting-line-coupled formulation
-
neuralFoilSampling.n_samples- number of aerodynamic samples used to build the local reduced-order model
-
neuralFoilSampling.neuralFoil_size- NeuralFoil model size used for sectional predictions
-
reducedModel.chebyshev_degree- degree of the Chebyshev surrogate used inside the OCP
-
evaluation.mode- task objective, for example
PerchingorSoftLanding
- task objective, for example
-
plane.wing.*- finite-wing geometry definition, including span stations, chord, sweep, twist, and dihedral
If you use this repository in academic work, please cite the accompanying paper:
@article{affinita2026gradient,
title={Gradient-based Nested Co-Design of Aerodynamic Shape and Control for Winged Robots},
author={Affinita, Daniele and Xu, Mingda and Gherardi, Beno{\^\i}t Valentin and Fua, Pascal},
journal={arXiv preprint arXiv:2603.06760},
year={2026}
}
This repository is licensed under Apache 2