AeroSandbox ✈️
by Peter Sharpe (<pds [at] mit [dot] edu>)
AeroSandbox is a Python package that helps you design and optimize aircraft and other engineered systems.
At its heart, AeroSandbox is an optimization suite that combines the ease-of-use of familiar NumPy syntax with the power of modern automatic differentiation.
This automatic differentiation dramatically improves optimization performance on large problems: design problems with tens of thousands of decision variables solve in seconds on a laptop. AeroSandbox also comes with dozens of end-to-end-differentiable aerospace physics models, allowing you to simultaneously optimize an aircraft's aerodynamics, structures, propulsion, mission trajectory, stability, and more.
Keeping AeroSandbox easy to learn and use is a top priority. Complexity is optional - you can use AeroSandbox's built-in physics models where helpful, or you can drop in arbitrary custom physics models of your own.
pip install aerosandbox[full]
Use AeroSandbox to design and optimize entire aircraft:
Feather (an ultra-lightweight 1-meter-class RC motor glider) |
SEAWAY-Mini (a solar-electric, 13' wingspan seaplane) |
Use AeroSandbox to support real-world aircraft development programs, all the way from your very first sketch to your first-flight and beyond:
Dawn (later renamed SACOS) in first flight, Fall 2022 (A massive build effort with excellent engineering and coordination by Electra.aero!) |
Use AeroSandbox to explore counterintuitive, complicated design tradeoffs, all at the earliest stages of conceptual design where these insights make the most difference:
Exploring how big a solar airplane needs to be to fly, as a function of seasonality and latitude |
Use AeroSandbox as a pure aerodynamics toolkit:
Among many other discplines:
Structural optimization of a composite tube spar |
Electric motor analysis for propeller matching |
Tools to analyze unconventional propulsion (e.g., LH2) |
Detailed weights estimation for aircraft ranging from micro-UAVs to airliners |
Easily interface AeroSandbox with all your favorite tools:
Or, throw all the airplane-design-specific code out entirely, and use AeroSandbox purely as an optimization solver or as a solver for nonlinear systems of equations (or ODEs, or PDEs):
Optimize the 2D Rosenbrock function |
And much, much more. Best of all, combine these tools arbitrarily without any loss in optimization speed and without any tedious derivative math, all thanks to AeroSandbox's end-to-end automatic-differentiability.
In short:
-
pip install aerosandbox[full]
for a complete install. -
pip install aerosandbox
for a lightweight (headless) installation with minimal dependencies. All optimization, numerics, and physics models are included, but optional visualization dependencies are skipped.
For more installation details (e.g., if you're new to Python), see here.
To get started, check out the tutorials folder here! All tutorials are viewable in-browser, or you can open them as Jupyter notebooks by cloning this repository.
For a more detailed and theory-heavy introduction to AeroSandbox, please see this thesis.
For a yet-more-detailed developer-level description of AeroSandbox modules, please see the developer README.
For fully-detailed API documentation, see the documentation website.
You can print documentation and examples for any AeroSandbox object by using the built-in help()
function (e.g., help(asb.Airplane)
). AeroSandbox code is also documented extensively in the source and contains hundreds of unit test examples, so examining the source code can also be useful.
One final point to note: all inputs and outputs to AeroSandbox are expressed in base SI units, or derived units thereof (e.g., m, kg, sec, N, m/s, J, Pa). Since this unit system is coherent, an enormous number of quantities can be converted without any scaling factors. This improves readability and reduces the likelihood of errors.
There are only two exceptions to this SI-everywhere rule:
-
If alternate units are noted in a variable name's suffix. For example:
battery_capacity
→ Joulesbattery_capacity_watt_hours
→ Watt-hoursaircraft_endurance
→ Secondsaircraft_endurance_hours
→ Hours
-
Angle of attack (
alpha
, α) and sideslip angle (beta
, β) are given in degrees due to long-standing aerospace convention. All other angles and angular rates use radians.
Also, in case of any confusion on the units of a function's inputs and outputs, units are listed on all function docstrings.
If you wish to use other units, consider using aerosandbox.tools.units
to convert easily.
Please feel free to join the development of AeroSandbox - contributions are always so welcome! If you have a change you'd like to make, the easiest way to do that is by submitting a pull request.
The text file CONTRIBUTING.md
has more details for developers and power users.
If you've already made several additions and would like to be involved in a more long-term capacity, please message me! Contact information can be found next to my name near the top of this README.
If you like this software, please consider donating to support development via PayPal or GitHub Sponsors! Proceeds will go towards more coffee for the grad students.
Please, please report all bugs by creating a new issue!
AeroSandbox loosely uses semantic versioning, which should give you an idea of whether or not you can probably expect backward-compatibility and/or new features from any given update.
For more details, see the changelog.
If you find AeroSandbox useful in a research publication, please cite it using the following BibTeX snippet:
@mastersthesis{aerosandbox,
title = {AeroSandbox: A Differentiable Framework for Aircraft Design Optimization},
author = {Sharpe, Peter D.},
school = {Massachusetts Institute of Technology},
year = {2021}
}
As the MIT License applies, use AeroSandbox for anything you want (commercial or noncommercial). Attribution is strongly appreciated but not required.
Commercial users: I'm more than happy to discuss consulting work for active AeroSandbox support if this package proves helpful - use the email address in the header of this README to get in touch.
MIT License, terms here. Basically: use AeroSandbox for anything you want; no warranty express or implied.